Skip to content

Commit

Permalink
LukeIS: Adding some images to make the app show up full screen in iph…
Browse files Browse the repository at this point in the history
…one5 simulator. Chaning from xib to storyboards. Updating third_party json-framework, attempted to update third_party CocaoHTTPServer but that resulted in a lot of problems. Updated iphonesim which has been renamed ios-sim. Everything tested / working with Xcode 4.5.1 on Lion. test_iphone is limping along right now, needs some TLC. Fixes Issue 4740

r18137
  • Loading branch information
lukeis committed Nov 13, 2012
1 parent 494000c commit 8c7a4f1
Show file tree
Hide file tree
Showing 92 changed files with 903 additions and 3,194 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ task :iphone_server do
sdk = iPhoneSDK?
if sdk != nil then
puts "Building iWebDriver iphone app."
sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target iWebDriver", :verbose => false
sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target iWebDriver -configuration Debug", :verbose => false
else
puts "XCode not found. Not building the iphone driver."
end
Expand All @@ -497,7 +497,7 @@ end
task :test_iphone_server do
sdk = iPhoneSDK?
if sdk != nil then
sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target Tests"
sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target Tests -configuration Debug"
else
puts "XCode and/or iPhoneSDK not found. Not testing iphone_server."
end
Expand Down
8 changes: 4 additions & 4 deletions iphone/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSMainNibFile~ipad</key>
<string>MainWindow-iPad</string>
<key>UIMainStoryboardFile~iphone</key>
<string>Storyboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Storyboard_iPad</string>
<key>UIPrerenderedIcon</key>
<string>true</string>
</dict>
Expand Down
112 changes: 38 additions & 74 deletions iphone/iWebDriver.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions iphone/src/Storyboard_iPhone.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2843" systemVersion="11G63" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="Awl-Pe-MbD">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1929"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="T5Y-xm-HKY">
<objects>
<viewController autoresizesArchivedViewToFullSize="NO" id="Awl-Pe-MbD" customClass="MainViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="z0G-Jl-N2r">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<webView contentMode="scaleToFill" scalesPageToFit="YES" id="wAU-xQ-LCA">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<dataDetectorType key="dataDetectorTypes"/>
</webView>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="Bne-NZ-nK4">
<rect key="frame" x="0.0" y="504" width="320" height="44"/>
<items/>
</toolbar>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="qxD-tv-3dL">
<rect key="frame" x="20" y="515" width="280" height="27"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="statusLabel_" destination="qxD-tv-3dL" id="sbY-uz-p3H"/>
<outlet property="webView" destination="wAU-xQ-LCA" id="xgO-PI-EoE"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="i4T-QJ-foz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="88" y="33"/>
</scene>
</scenes>
<classes>
<class className="MainViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/MainViewController.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// FlipsideView.h
// AppDelegate.h
// iWebDriver
//
// Copyright 2009 Google Inc.
//
// Copyright 2012 Software Freedom Conservancy
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,8 +19,8 @@

#import <UIKit/UIKit.h>

@interface FlipsideView : UIView {
@interface AppDelegate : UIResponder <UIApplicationDelegate>

}
@property (strong, nonatomic) UIWindow *window;

@end
57 changes: 57 additions & 0 deletions iphone/src/objc/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// AppDelegate.m
// iWebDriver
//
//
// Copyright 2012 Software Freedom Conservancy
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
43 changes: 0 additions & 43 deletions iphone/src/objc/Classes/FlipsideView.m

This file was deleted.

27 changes: 0 additions & 27 deletions iphone/src/objc/Classes/FlipsideViewController.h

This file was deleted.

38 changes: 0 additions & 38 deletions iphone/src/objc/Classes/FlipsideViewController.m

This file was deleted.

5 changes: 4 additions & 1 deletion iphone/src/objc/Classes/MainViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
// [MainViewController sharedInstance];
// The UI element definitions are contained in MainView.xib.
@interface MainViewController : UIViewController {
IBOutlet WebViewController *webViewController;
WebViewController *webViewController;
IBOutlet UILabel *statusLabel_;
IBOutlet UIWebView *webView;
}

@property (nonatomic, retain) WebViewController *webViewController;

@property (nonatomic, retain) UIWebView *webView;

// Set the current status text.
- (void)describeLastAction:(NSString *)status;

Expand Down
26 changes: 17 additions & 9 deletions iphone/src/objc/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,22 @@

@implementation MainViewController

@synthesize webView;
@synthesize webViewController;

// Boilerplate init for loading from the nib.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {

}
return self;
}

- (void)viewDidLoad {
[super viewDidLoad];
singleton_ = self;
[webViewController.webView loadHTMLString:@"" baseURL:nil];
[webView setScalesPageToFit:NO];
webViewController = [[WebViewController alloc] init];
[webView setDelegate:webViewController];

if ([webView respondsToSelector:@selector(mediaPlaybackRequiresUserAction)]) {
[webView setMediaPlaybackRequiresUserAction:NO];
}
[webView loadHTMLString:@"" baseURL:nil];
[statusLabel_ setAdjustsFontSizeToFitWidth:YES];

}

// Override to allow orientations other than the default portrait orientation.
Expand All @@ -52,6 +53,8 @@ - (void)didReceiveMemoryWarning {
}

- (void)dealloc {
[webView release];
[webViewController dealloc];
[super dealloc];
}

Expand All @@ -63,4 +66,9 @@ + (MainViewController *)sharedInstance {
return singleton_;
}

- (void)viewDidUnload {
[webView release];
webView = nil;
[super viewDidUnload];
}
@end
51 changes: 0 additions & 51 deletions iphone/src/objc/Classes/RootViewController.h

This file was deleted.

Loading

0 comments on commit 8c7a4f1

Please sign in to comment.