From 7546f8c0a76675dfb12f77b20076b87441bf36c3 Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Mon, 9 Dec 2013 14:48:24 +0000 Subject: [PATCH] Remove server side of iphone driver. --- Rakefile | 35 +- iphone/Info.plist | 34 - iphone/RunIPhoneUnitTest.sh | 123 -- iphone/Settings.bundle/Root.plist | 77 - iphone/Settings.bundle/en.lproj/Root.strings | 7 - iphone/Tests-Info.plist | 20 - iphone/build.desc | 2 +- iphone/iWebDriver.xcodeproj/project.pbxproj | 1279 ----------------- iphone/iphone.iml | 16 - .../lib/buildtime-src/cocoahttpserver/README | 5 - .../cocoahttpserver/extensions/HTTPResource.h | 37 - .../extensions/HTTPStaticResource.h | 37 - .../extensions/HTTPStaticResource.m | 69 - .../extensions/HTTPVirtualDirectory.h | 55 - .../extensions/HTTPVirtualDirectory.m | 154 -- .../extensions/redirect_and_error.patch | 133 -- iphone/pom.xml | 47 - iphone/src/Storyboard_iPhone.storyboard | 60 - iphone/src/objc/AppDelegate.h | 26 - iphone/src/objc/AppDelegate.m | 57 - iphone/src/objc/Attribute.h | 53 - iphone/src/objc/Attribute.m | 92 -- iphone/src/objc/COPYING | 201 --- iphone/src/objc/Classes/MainView.h | 15 - iphone/src/objc/Classes/MainView.m | 32 - iphone/src/objc/Classes/MainViewController.h | 43 - iphone/src/objc/Classes/MainViewController.m | 74 - iphone/src/objc/Cookie.h | 51 - iphone/src/objc/Cookie.m | 210 --- iphone/src/objc/Css.h | 53 - iphone/src/objc/Css.m | 93 -- iphone/src/objc/Database.h | 28 - iphone/src/objc/Database.m | 237 --- iphone/src/objc/Element.h | 137 -- iphone/src/objc/Element.mm | 369 ----- iphone/src/objc/ElementStore.h | 62 - iphone/src/objc/ElementStore.m | 137 -- iphone/src/objc/FrameContext.h | 26 - iphone/src/objc/FrameContext.m | 39 - iphone/src/objc/GeoLocation.h | 37 - iphone/src/objc/GeoLocation.m | 108 -- iphone/src/objc/HTTPJSONResponse.h | 42 - iphone/src/objc/HTTPJSONResponse.m | 49 - iphone/src/objc/HTTPPNGResponse.h | 34 - iphone/src/objc/HTTPPNGResponse.m | 36 - iphone/src/objc/HTTPResponse+Utility.h | 36 - iphone/src/objc/HTTPResponse+Utility.m | 36 - iphone/src/objc/HTTPServerController.h | 47 - iphone/src/objc/HTTPServerController.m | 230 --- ...TTPVirtualDirectory+AccessViewController.h | 30 - ...TTPVirtualDirectory+AccessViewController.m | 39 - .../objc/HTTPVirtualDirectory+ExecuteScript.h | 55 - .../HTTPVirtualDirectory+ExecuteScript.mm | 192 --- .../objc/HTTPVirtualDirectory+FindElement.h | 68 - .../objc/HTTPVirtualDirectory+FindElement.mm | 106 -- iphone/src/objc/HTTPVirtualDirectory+Remove.h | 15 - iphone/src/objc/HTTPVirtualDirectory+Remove.m | 36 - iphone/src/objc/JSONRESTResource.h | 53 - iphone/src/objc/JSONRESTResource.m | 89 -- iphone/src/objc/NSData+Base64.h | 33 - iphone/src/objc/NSData+Base64.m | 299 ---- iphone/src/objc/NSException+WebDriver.h | 20 - iphone/src/objc/NSException+WebDriver.m | 39 - iphone/src/objc/NSURLRequest+IgnoreSSL.h | 24 - iphone/src/objc/NSURLRequest+IgnoreSSL.m | 28 - iphone/src/objc/RESTServiceMapping.h | 43 - iphone/src/objc/RESTServiceMapping.m | 144 -- iphone/src/objc/Session+ExecuteScript.h | 39 - iphone/src/objc/Session+ExecuteScript.m | 37 - iphone/src/objc/Session.h | 53 - iphone/src/objc/Session.m | 247 ---- iphone/src/objc/SessionRoot.h | 38 - iphone/src/objc/SessionRoot.m | 87 -- iphone/src/objc/Status.h | 26 - iphone/src/objc/Status.m | 70 - iphone/src/objc/Storage.h | 54 - iphone/src/objc/Storage.m | 150 -- iphone/src/objc/Timeouts.h | 65 - iphone/src/objc/Timeouts.m | 132 -- iphone/src/objc/UIResponder+SimulateTouch.h | 19 - iphone/src/objc/UIResponder+SimulateTouch.m | 19 - iphone/src/objc/WebDriverHTTPConnection.h | 31 - iphone/src/objc/WebDriverHTTPConnection.m | 69 - iphone/src/objc/WebDriverPreferences.h | 43 - iphone/src/objc/WebDriverPreferences.m | 166 --- iphone/src/objc/WebDriverRequestFetcher.h | 32 - iphone/src/objc/WebDriverRequestFetcher.m | 392 ----- iphone/src/objc/WebDriverResource.h | 121 -- iphone/src/objc/WebDriverResource.m | 239 --- iphone/src/objc/WebDriverResponse.h | 73 - iphone/src/objc/WebDriverResponse.m | 208 --- iphone/src/objc/WebDriverUtilities.h | 17 - iphone/src/objc/WebDriverUtilities.m | 105 -- iphone/src/objc/WebViewController.h | 100 -- iphone/src/objc/WebViewController.m | 579 -------- iphone/src/objc/iWebDriver_Prefix.pch | 8 - iphone/src/objc/main.m | 18 - iphone/src/objc/selenium-icon.png | Bin 5118 -> 0 bytes iphone/src/resources/Default-568h@2x.png | Bin 18594 -> 0 bytes iphone/src/resources/Default.png | Bin 6540 -> 0 bytes iphone/src/resources/Default@2x.png | Bin 16107 -> 0 bytes .../src/resources/Storyboard_iPad.storyboard | 51 - iphone/test/objc/Example.m | 28 - iphone/test/objc/GTMDefines.h | 388 ----- iphone/test/objc/GTMIPhoneUnitTestDelegate.h | 41 - iphone/test/objc/GTMIPhoneUnitTestDelegate.m | 216 --- iphone/test/objc/GTMIPhoneUnitTestMain.m | 33 - iphone/test/objc/GTMObjC2Runtime.h | 94 -- iphone/test/objc/GTMSenTestCase.h | 1034 ------------- iphone/test/objc/GTMSenTestCase.m | 498 ------- iphone/test/objc/GTMUnitTestDevLog.h | 79 - 111 files changed, 2 insertions(+), 11890 deletions(-) delete mode 100644 iphone/Info.plist delete mode 100755 iphone/RunIPhoneUnitTest.sh delete mode 100644 iphone/Settings.bundle/Root.plist delete mode 100644 iphone/Settings.bundle/en.lproj/Root.strings delete mode 100644 iphone/Tests-Info.plist delete mode 100755 iphone/iWebDriver.xcodeproj/project.pbxproj delete mode 100644 iphone/iphone.iml delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/README delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPResource.h delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.h delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.m delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.h delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.m delete mode 100644 iphone/lib/buildtime-src/cocoahttpserver/extensions/redirect_and_error.patch delete mode 100644 iphone/pom.xml delete mode 100644 iphone/src/Storyboard_iPhone.storyboard delete mode 100644 iphone/src/objc/AppDelegate.h delete mode 100644 iphone/src/objc/AppDelegate.m delete mode 100644 iphone/src/objc/Attribute.h delete mode 100644 iphone/src/objc/Attribute.m delete mode 100644 iphone/src/objc/COPYING delete mode 100644 iphone/src/objc/Classes/MainView.h delete mode 100644 iphone/src/objc/Classes/MainView.m delete mode 100644 iphone/src/objc/Classes/MainViewController.h delete mode 100644 iphone/src/objc/Classes/MainViewController.m delete mode 100644 iphone/src/objc/Cookie.h delete mode 100644 iphone/src/objc/Cookie.m delete mode 100644 iphone/src/objc/Css.h delete mode 100644 iphone/src/objc/Css.m delete mode 100644 iphone/src/objc/Database.h delete mode 100644 iphone/src/objc/Database.m delete mode 100644 iphone/src/objc/Element.h delete mode 100644 iphone/src/objc/Element.mm delete mode 100644 iphone/src/objc/ElementStore.h delete mode 100644 iphone/src/objc/ElementStore.m delete mode 100644 iphone/src/objc/FrameContext.h delete mode 100644 iphone/src/objc/FrameContext.m delete mode 100644 iphone/src/objc/GeoLocation.h delete mode 100644 iphone/src/objc/GeoLocation.m delete mode 100644 iphone/src/objc/HTTPJSONResponse.h delete mode 100644 iphone/src/objc/HTTPJSONResponse.m delete mode 100644 iphone/src/objc/HTTPPNGResponse.h delete mode 100644 iphone/src/objc/HTTPPNGResponse.m delete mode 100644 iphone/src/objc/HTTPResponse+Utility.h delete mode 100644 iphone/src/objc/HTTPResponse+Utility.m delete mode 100644 iphone/src/objc/HTTPServerController.h delete mode 100644 iphone/src/objc/HTTPServerController.m delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+AccessViewController.h delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+AccessViewController.m delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.h delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.mm delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+FindElement.h delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+FindElement.mm delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+Remove.h delete mode 100644 iphone/src/objc/HTTPVirtualDirectory+Remove.m delete mode 100644 iphone/src/objc/JSONRESTResource.h delete mode 100644 iphone/src/objc/JSONRESTResource.m delete mode 100644 iphone/src/objc/NSData+Base64.h delete mode 100644 iphone/src/objc/NSData+Base64.m delete mode 100644 iphone/src/objc/NSException+WebDriver.h delete mode 100644 iphone/src/objc/NSException+WebDriver.m delete mode 100644 iphone/src/objc/NSURLRequest+IgnoreSSL.h delete mode 100644 iphone/src/objc/NSURLRequest+IgnoreSSL.m delete mode 100644 iphone/src/objc/RESTServiceMapping.h delete mode 100644 iphone/src/objc/RESTServiceMapping.m delete mode 100644 iphone/src/objc/Session+ExecuteScript.h delete mode 100644 iphone/src/objc/Session+ExecuteScript.m delete mode 100644 iphone/src/objc/Session.h delete mode 100644 iphone/src/objc/Session.m delete mode 100644 iphone/src/objc/SessionRoot.h delete mode 100644 iphone/src/objc/SessionRoot.m delete mode 100644 iphone/src/objc/Status.h delete mode 100644 iphone/src/objc/Status.m delete mode 100644 iphone/src/objc/Storage.h delete mode 100644 iphone/src/objc/Storage.m delete mode 100644 iphone/src/objc/Timeouts.h delete mode 100644 iphone/src/objc/Timeouts.m delete mode 100644 iphone/src/objc/UIResponder+SimulateTouch.h delete mode 100644 iphone/src/objc/UIResponder+SimulateTouch.m delete mode 100644 iphone/src/objc/WebDriverHTTPConnection.h delete mode 100644 iphone/src/objc/WebDriverHTTPConnection.m delete mode 100644 iphone/src/objc/WebDriverPreferences.h delete mode 100644 iphone/src/objc/WebDriverPreferences.m delete mode 100644 iphone/src/objc/WebDriverRequestFetcher.h delete mode 100644 iphone/src/objc/WebDriverRequestFetcher.m delete mode 100644 iphone/src/objc/WebDriverResource.h delete mode 100644 iphone/src/objc/WebDriverResource.m delete mode 100644 iphone/src/objc/WebDriverResponse.h delete mode 100644 iphone/src/objc/WebDriverResponse.m delete mode 100644 iphone/src/objc/WebDriverUtilities.h delete mode 100644 iphone/src/objc/WebDriverUtilities.m delete mode 100644 iphone/src/objc/WebViewController.h delete mode 100644 iphone/src/objc/WebViewController.m delete mode 100644 iphone/src/objc/iWebDriver_Prefix.pch delete mode 100644 iphone/src/objc/main.m delete mode 100644 iphone/src/objc/selenium-icon.png delete mode 100644 iphone/src/resources/Default-568h@2x.png delete mode 100644 iphone/src/resources/Default.png delete mode 100644 iphone/src/resources/Default@2x.png delete mode 100644 iphone/src/resources/Storyboard_iPad.storyboard delete mode 100644 iphone/test/objc/Example.m delete mode 100644 iphone/test/objc/GTMDefines.h delete mode 100644 iphone/test/objc/GTMIPhoneUnitTestDelegate.h delete mode 100644 iphone/test/objc/GTMIPhoneUnitTestDelegate.m delete mode 100644 iphone/test/objc/GTMIPhoneUnitTestMain.m delete mode 100644 iphone/test/objc/GTMObjC2Runtime.h delete mode 100644 iphone/test/objc/GTMSenTestCase.h delete mode 100644 iphone/test/objc/GTMSenTestCase.m delete mode 100644 iphone/test/objc/GTMUnitTestDevLog.h diff --git a/Rakefile b/Rakefile index df4d13cb3dbb4..267320a96c3a0 100644 --- a/Rakefile +++ b/Rakefile @@ -35,7 +35,6 @@ require 'rake-tasks/dotnet' require 'rake-tasks/zip' require 'rake-tasks/c' require 'rake-tasks/java' -require 'rake-tasks/iphone' require 'rake-tasks/selenium' require 'rake-tasks/se-ide' require 'rake-tasks/ie_code_generator' @@ -124,8 +123,6 @@ task :support => [ "//java/client/src/org/openqa/selenium/lift", "//java/client/src/org/openqa/selenium/support", ] -task :iphone_client => ['//java/client/src/org/openqa/selenium/iphone'] -task :iphone => [:iphone_server, :iphone_client] desc 'Build the standalone server' task 'selenium-server-standalone' => '//java/server/src/org/openqa/grid/selenium:selenium:uber' @@ -175,7 +172,6 @@ task :test_support => [ "//java/client/test/org/openqa/selenium/support:SmallTests:run", "//java/client/test/org/openqa/selenium/support:LargeTests:run" ] -task :test_iphone => [:test_iphone_server, '//java/client/test/org/openqa/selenium/iphone:test:run'] # TODO(simon): test-core should go first, but it's changing the least for now. task :test_selenium => [ :'test-rc', :'test-v1-emulation', :'test-core'] @@ -254,13 +250,11 @@ if (python?) end -task :build => [:all, :iphone, :remote, :selenium] +task :build => [:all, :remote, :selenium] desc 'Clean build artifacts.' task :clean do rm_rf 'build/' - rm_rf 'iphone/build/' - rm_rf 'iphone/src/objc/atoms.h' rm_rf 'java/client/build/' rm_rf 'dist/' end @@ -583,33 +577,6 @@ task :test_selenium_py => [:'selenium-core', :'selenium-server-standalone'] do end end -#### iPhone #### -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 -configuration Debug", :verbose => false - else - puts "XCode not found. Not building the iphone driver." - end -end - -# This does not depend on :iphone_server because the dependancy is specified in xcode -task :test_iphone_server do - sdk = iPhoneSDK? - if sdk != nil then - 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 -end - -file "iphone/src/objc/atoms.h" => ["//iphone:atoms"] do |task| - puts "Writing: #{task}" - cp "build/iphone/atoms.h", "iphone/src/objc/atoms.h" -end -task :iphone_atoms => ["iphone/src/objc/atoms.h"] - file "cpp/iedriver/sizzle.h" => [ "//third_party/js/sizzle:sizzle:header" ] do cp "build/third_party/js/sizzle/sizzle.h", "cpp/iedriver/sizzle.h" end diff --git a/iphone/Info.plist b/iphone/Info.plist deleted file mode 100644 index 90f14eac37673..0000000000000 --- a/iphone/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - selenium-icon.png - CFBundleIdentifier - com.google.${PRODUCT_NAME:identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIMainStoryboardFile~iphone - Storyboard_iPhone - UIMainStoryboardFile~ipad - Storyboard_iPad - UIPrerenderedIcon - true - - diff --git a/iphone/RunIPhoneUnitTest.sh b/iphone/RunIPhoneUnitTest.sh deleted file mode 100755 index 84bc1d6575a7a..0000000000000 --- a/iphone/RunIPhoneUnitTest.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# RunIPhoneUnitTest.sh -# Copyright 2008 Google Inc. -# -# 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. -# -# Runs all unittests through the iPhone simulator. We don't handle running them -# on the device. To run on the device just choose "run". - -set -o errexit -set -o nounset -set -o verbose - -# Controlling environment variables: -# GTM_DISABLE_ZOMBIES - -# Set to a non-zero value to turn on zombie checks. You will probably -# want to turn this off if you enable leaks. -GTM_DISABLE_ZOMBIES=${GTM_DISABLE_ZOMBIES:=1} - -# GTM_ENABLE_LEAKS - -# Set to a non-zero value to turn on the leaks check. You will probably want -# to disable zombies, otherwise you will get a lot of false positives. - -# GTM_DISABLE_TERMINATION -# Set to a non-zero value so that the app doesn't terminate when it's finished -# running tests. This is useful when using it with external tools such -# as Instruments. - -# GTM_LEAKS_SYMBOLS_TO_IGNORE -# List of comma separated symbols that leaks should ignore. Mainly to control -# leaks in frameworks you don't have control over. -# Search this file for GTM_LEAKS_SYMBOLS_TO_IGNORE to see examples. -# Please feel free to add other symbols as you find them but make sure to -# reference Radars or other bug systems so we can track them. - -# GTM_REMOVE_GCOV_DATA -# Before starting the test, remove any *.gcda files for the current run so -# you won't get errors when the source file has changed and the data can't -# be merged. -# -GTM_REMOVE_GCOV_DATA=${GTM_REMOVE_GCOV_DATA:=0} - -ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") -ScriptName=$(basename "$0") -ThisScript="${ScriptDir}/${ScriptName}" - -GTMXcodeNote() { - echo ${ThisScript}:${1}: note: GTM ${2} -} - -if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then - # We kill the iPhone simulator because otherwise we run into issues where - # the unittests fail becuase the simulator is currently running, and - # at this time the iPhone SDK won't allow two simulators running at the same - # time. - set +e - /usr/bin/killall "iPhone Simulator" - set -e - - if [ $GTM_REMOVE_GCOV_DATA -ne 0 ]; then - if [ "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" != "-" ]; then - if [ -d "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" ]; then - GTMXcodeNote ${LINENO} "Removing any .gcda files" - (cd "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" && \ - find . -type f -name "*.gcda" -print0 | xargs -0 rm -f ) - fi - fi - fi - - export DYLD_ROOT_PATH="$SDKROOT" - export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR" - export IPHONE_SIMULATOR_ROOT="$SDKROOT" - export CFFIXED_USER_HOME="$TEMP_FILES_DIR/iPhone Simulator User Dir" - - # See http://developer.apple.com/technotes/tn2004/tn2124.html for an - # explanation of these environment variables. - - export MallocScribble=YES - export MallocPreScribble=YES - export MallocGuardEdges=YES - export MallocStackLogging=YES - export NSAutoreleaseFreedObjectCheckEnabled=YES - - # Turn on the mostly undocumented OBJC_DEBUG stuff. - export OBJC_DEBUG_FRAGILE_SUPERCLASSES=YES - export OBJC_DEBUG_UNLOAD=YES - # Turned off due to the amount of false positives from NS classes. - # export OBJC_DEBUG_FINALIZERS=YES - export OBJC_DEBUG_NIL_SYNC=YES - export OBJC_PRINT_REPLACED_METHODS=YES - - if [ $GTM_DISABLE_ZOMBIES -eq 0 ]; then - GTMXcodeNote ${LINENO} "Enabling zombies" - export CFZombieLevel=3 - export NSZombieEnabled=YES - fi - - # Cleanup user home and documents directory - if [ -d "$CFFIXED_USER_HOME" ]; then - rm -rf "$CFFIXED_USER_HOME" - fi - mkdir "$CFFIXED_USER_HOME" - mkdir "$CFFIXED_USER_HOME/Documents" - - # 6251475 iPhone simulator leaks @ CFHTTPCookieStore shutdown if - # CFFIXED_USER_HOME empty - GTM_LEAKS_SYMBOLS_TO_IGNORE="CFHTTPCookieStore" - - "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents -else - GTMXcodeNote ${LINENO} "Skipping running of unittests for device build." -fi -exit 0 diff --git a/iphone/Settings.bundle/Root.plist b/iphone/Settings.bundle/Root.plist deleted file mode 100644 index 5e3bb539a4132..0000000000000 --- a/iphone/Settings.bundle/Root.plist +++ /dev/null @@ -1,77 +0,0 @@ - - - - - StringsTable - Root - PreferenceSpecifiers - - - Type - PSGroupSpecifier - Title - Server - - - Type - PSTextFieldSpecifier - Title - Port - Key - preference_server_mode_port_number - DefaultValue - 3001 - IsSecure - - KeyboardType - NumberPad - AutocapitalizationType - None - AutocorrectionType - No - - - Type - PSGroupSpecifier - Title - Grid - - - Type - PSTextFieldSpecifier - Title - GridHost - Key - preference_grid_mode_host - DefaultValue - - IsSecure - - KeyboardType - URL - AutocapitalizationType - None - AutocorrectionType - No - - - Type - PSTextFieldSpecifier - Title - GridPort - Key - preference_grid_mode_port - DefaultValue - 4444 - IsSecure - - KeyboardType - NumberPad - AutocapitalizationType - None - AutocorrectionType - No - - - - diff --git a/iphone/Settings.bundle/en.lproj/Root.strings b/iphone/Settings.bundle/en.lproj/Root.strings deleted file mode 100644 index 208acada15ce9..0000000000000 --- a/iphone/Settings.bundle/en.lproj/Root.strings +++ /dev/null @@ -1,7 +0,0 @@ -/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ - -"Server" = "Server"; -"Port" = "Port"; -"Grid" = "Grid"; -"GridHost" = "Host"; -"GridPort" = "Port"; \ No newline at end of file diff --git a/iphone/Tests-Info.plist b/iphone/Tests-Info.plist deleted file mode 100644 index 050031858bbc7..0000000000000 --- a/iphone/Tests-Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.google.${PRODUCT_NAME:identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - diff --git a/iphone/build.desc b/iphone/build.desc index e84072808ad80..56974404f68e7 100644 --- a/iphone/build.desc +++ b/iphone/build.desc @@ -17,5 +17,5 @@ js_fragment_header(name = "atoms", "//javascript/webdriver/atoms/fragments:get_text:ios", "//javascript/webdriver/atoms/fragments:is_selected:ios", ], - out = "iphone/src/objc/atoms.h", + out = "build/iphone/atoms.h", utf8 = "true") diff --git a/iphone/iWebDriver.xcodeproj/project.pbxproj b/iphone/iWebDriver.xcodeproj/project.pbxproj deleted file mode 100755 index 284923e3f2751..0000000000000 --- a/iphone/iWebDriver.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1279 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 17D715560FE107B500CC479E /* HTTPPNGResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D715550FE107B500CC479E /* HTTPPNGResponse.m */; }; - 17D7163E0FE12CC100CC479E /* HTTPPNGResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D715550FE107B500CC479E /* HTTPPNGResponse.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765580DF743DE002DB57D /* CoreGraphics.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A90DB2D0DB0083E9F9 /* MainViewController.m */; }; - 40005B5F14AA759D009763C2 /* HTTPVirtualDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5E14AA759D009763C2 /* HTTPVirtualDirectory.m */; }; - 40005B6814AA764C009763C2 /* HTTPStaticResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B6514AA764C009763C2 /* HTTPStaticResource.m */; }; - 40005B6A14AA8011009763C2 /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3914AA71CF009763C2 /* DDData.m */; }; - 40005B6B14AA8011009763C2 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3B14AA71CF009763C2 /* DDNumber.m */; }; - 40005B6C14AA8011009763C2 /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3D14AA71CF009763C2 /* DDRange.m */; }; - 40005B6D14AA8011009763C2 /* HTTPAuthenticationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3F14AA71CF009763C2 /* HTTPAuthenticationRequest.m */; }; - 40005B6E14AA8011009763C2 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4114AA71CF009763C2 /* HTTPConnection.m */; }; - 40005B6F14AA8011009763C2 /* HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4414AA71CF009763C2 /* HTTPMessage.m */; }; - 40005B7014AA8011009763C2 /* HTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4714AA71CF009763C2 /* HTTPServer.m */; }; - 40005B7114AA8011009763C2 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4A14AA71CF009763C2 /* HTTPAsyncFileResponse.m */; }; - 40005B7214AA8011009763C2 /* HTTPDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4C14AA71CF009763C2 /* HTTPDataResponse.m */; }; - 40005B7314AA8011009763C2 /* HTTPDynamicFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4E14AA71CF009763C2 /* HTTPDynamicFileResponse.m */; }; - 40005B7414AA8011009763C2 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5014AA71CF009763C2 /* HTTPFileResponse.m */; }; - 40005B7514AA8011009763C2 /* HTTPRedirectResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5214AA71CF009763C2 /* HTTPRedirectResponse.m */; }; - 40005B7614AA8011009763C2 /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5414AA71CF009763C2 /* WebSocket.m */; }; - 40005B8814AA80C6009763C2 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B7B14AA80A1009763C2 /* GCDAsyncSocket.m */; }; - 40005B8914AA80C6009763C2 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B7F14AA80A1009763C2 /* DDAbstractDatabaseLogger.m */; }; - 40005B8A14AA80C6009763C2 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8114AA80A1009763C2 /* DDASLLogger.m */; }; - 40005B8B14AA80C6009763C2 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8314AA80A1009763C2 /* DDFileLogger.m */; }; - 40005B8C14AA80C6009763C2 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8514AA80A1009763C2 /* DDLog.m */; }; - 40005B8D14AA80C6009763C2 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8714AA80A1009763C2 /* DDTTYLogger.m */; }; - 4003054714CA44F80080BF72 /* FrameContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4003054614CA44F80080BF72 /* FrameContext.m */; }; - 4003054814CA44F80080BF72 /* FrameContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4003054614CA44F80080BF72 /* FrameContext.m */; }; - 402D0E4B1652182C00690ED6 /* Storyboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 402D0E4A1652182C00690ED6 /* Storyboard_iPhone.storyboard */; }; - 402D0E4F1652189C00690ED6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 402D0E4C1652189C00690ED6 /* Default-568h@2x.png */; }; - 402D0E501652189C00690ED6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 402D0E4D1652189C00690ED6 /* Default.png */; }; - 402D0E511652189C00690ED6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 402D0E4E1652189C00690ED6 /* Default@2x.png */; }; - 402D0E5316521F8700690ED6 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 402D0E5216521F8700690ED6 /* Security.framework */; }; - 402D0E5416521FBB00690ED6 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 402D0E5216521F8700690ED6 /* Security.framework */; }; - 402D0E571652203B00690ED6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 402D0E561652203B00690ED6 /* AppDelegate.m */; }; - 402D0E581652203B00690ED6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 402D0E561652203B00690ED6 /* AppDelegate.m */; }; - 402D0E671652FCCB00690ED6 /* Storyboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 402D0E661652FCCB00690ED6 /* Storyboard_iPad.storyboard */; }; - 40597F1214AB78C80056C533 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B7B14AA80A1009763C2 /* GCDAsyncSocket.m */; }; - 40597F1414AB78C80056C533 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B7F14AA80A1009763C2 /* DDAbstractDatabaseLogger.m */; }; - 40597F1614AB78C80056C533 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8114AA80A1009763C2 /* DDASLLogger.m */; }; - 40597F1814AB78C80056C533 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8314AA80A1009763C2 /* DDFileLogger.m */; }; - 40597F1A14AB78C80056C533 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8514AA80A1009763C2 /* DDLog.m */; }; - 40597F1C14AB78C80056C533 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B8714AA80A1009763C2 /* DDTTYLogger.m */; }; - 40597F1F14AB78C80056C533 /* HTTPStaticResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B6514AA764C009763C2 /* HTTPStaticResource.m */; }; - 40597F2114AB78C80056C533 /* HTTPVirtualDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5E14AA759D009763C2 /* HTTPVirtualDirectory.m */; }; - 40597F2414AB78DC0056C533 /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3914AA71CF009763C2 /* DDData.m */; }; - 40597F2614AB78DC0056C533 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3B14AA71CF009763C2 /* DDNumber.m */; }; - 40597F2814AB78DC0056C533 /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3D14AA71CF009763C2 /* DDRange.m */; }; - 40597F2A14AB78DC0056C533 /* HTTPAuthenticationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B3F14AA71CF009763C2 /* HTTPAuthenticationRequest.m */; }; - 40597F2C14AB78DC0056C533 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4114AA71CF009763C2 /* HTTPConnection.m */; }; - 40597F2F14AB78DC0056C533 /* HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4414AA71CF009763C2 /* HTTPMessage.m */; }; - 40597F3214AB78DC0056C533 /* HTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4714AA71CF009763C2 /* HTTPServer.m */; }; - 40597F3414AB78E90056C533 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4A14AA71CF009763C2 /* HTTPAsyncFileResponse.m */; }; - 40597F3614AB78E90056C533 /* HTTPDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4C14AA71CF009763C2 /* HTTPDataResponse.m */; }; - 40597F3814AB78E90056C533 /* HTTPDynamicFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B4E14AA71CF009763C2 /* HTTPDynamicFileResponse.m */; }; - 40597F3A14AB78E90056C533 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5014AA71CF009763C2 /* HTTPFileResponse.m */; }; - 40597F3C14AB78E90056C533 /* HTTPRedirectResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5214AA71CF009763C2 /* HTTPRedirectResponse.m */; }; - 40597F3E14AB78E90056C533 /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 40005B5414AA71CF009763C2 /* WebSocket.m */; }; - 409AF568147BF8ED00554A6E /* NSObject+SBJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55C147BF8EB00554A6E /* NSObject+SBJson.m */; }; - 409AF569147BF8ED00554A6E /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55D147BF8EB00554A6E /* SBJsonParser.m */; }; - 409AF56A147BF8EE00554A6E /* SBJsonStreamParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55E147BF8EB00554A6E /* SBJsonStreamParser.m */; }; - 409AF56B147BF8EE00554A6E /* SBJsonStreamParserAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55F147BF8EB00554A6E /* SBJsonStreamParserAccumulator.m */; }; - 409AF56C147BF8EE00554A6E /* SBJsonStreamParserAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF560147BF8EC00554A6E /* SBJsonStreamParserAdapter.m */; }; - 409AF56D147BF8EE00554A6E /* SBJsonStreamParserState.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF561147BF8EC00554A6E /* SBJsonStreamParserState.m */; }; - 409AF56E147BF8EE00554A6E /* SBJsonStreamWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF562147BF8EC00554A6E /* SBJsonStreamWriter.m */; }; - 409AF56F147BF8EE00554A6E /* SBJsonStreamWriterAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF563147BF8EC00554A6E /* SBJsonStreamWriterAccumulator.m */; }; - 409AF570147BF8EE00554A6E /* SBJsonStreamWriterState.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF564147BF8ED00554A6E /* SBJsonStreamWriterState.m */; }; - 409AF571147BF8EE00554A6E /* SBJsonTokeniser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF565147BF8ED00554A6E /* SBJsonTokeniser.m */; }; - 409AF572147BF8EE00554A6E /* SBJsonUTF8Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF566147BF8ED00554A6E /* SBJsonUTF8Stream.m */; }; - 409AF573147BF8EE00554A6E /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF567147BF8ED00554A6E /* SBJsonWriter.m */; }; - 409AF58F147BFB3A00554A6E /* NSObject+SBJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55C147BF8EB00554A6E /* NSObject+SBJson.m */; }; - 409AF590147BFB3A00554A6E /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55D147BF8EB00554A6E /* SBJsonParser.m */; }; - 409AF591147BFB3A00554A6E /* SBJsonStreamParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55E147BF8EB00554A6E /* SBJsonStreamParser.m */; }; - 409AF592147BFB3A00554A6E /* SBJsonStreamParserAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF55F147BF8EB00554A6E /* SBJsonStreamParserAccumulator.m */; }; - 409AF593147BFB3A00554A6E /* SBJsonStreamParserAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF560147BF8EC00554A6E /* SBJsonStreamParserAdapter.m */; }; - 409AF594147BFB3A00554A6E /* SBJsonStreamParserState.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF561147BF8EC00554A6E /* SBJsonStreamParserState.m */; }; - 409AF595147BFB3A00554A6E /* SBJsonStreamWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF562147BF8EC00554A6E /* SBJsonStreamWriter.m */; }; - 409AF596147BFB3A00554A6E /* SBJsonStreamWriterAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF563147BF8EC00554A6E /* SBJsonStreamWriterAccumulator.m */; }; - 409AF597147BFB3A00554A6E /* SBJsonStreamWriterState.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF564147BF8ED00554A6E /* SBJsonStreamWriterState.m */; }; - 409AF598147BFB3A00554A6E /* SBJsonTokeniser.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF565147BF8ED00554A6E /* SBJsonTokeniser.m */; }; - 409AF599147BFB3A00554A6E /* SBJsonUTF8Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF566147BF8ED00554A6E /* SBJsonUTF8Stream.m */; }; - 409AF59A147BFB3A00554A6E /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 409AF567147BF8ED00554A6E /* SBJsonWriter.m */; }; - 40BE09AB147714580042C6DA /* Status.m in Sources */ = {isa = PBXBuildFile; fileRef = 40BE09AA147714580042C6DA /* Status.m */; }; - 40BE09AC147715AA0042C6DA /* Status.m in Sources */ = {isa = PBXBuildFile; fileRef = 40BE09AA147714580042C6DA /* Status.m */; }; - 64084BF312B6C6A10049D2FB /* Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 731C4510128BBF4000261249 /* Storage.m */; }; - 64084BF412B6C6C90049D2FB /* Database.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D14FCC1289B6540074E63B /* Database.m */; }; - 64084BF512B6C6C90049D2FB /* GeoLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 731C450E128BBF4000261249 /* GeoLocation.m */; }; - 642C489F112260150064EB9C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 642C489E112260150064EB9C /* QuartzCore.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 642C48A4112260480064EB9C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 642C48A3112260480064EB9C /* QuartzCore.framework */; }; - 643822F712C032F600F0C7CC /* Element.mm in Sources */ = {isa = PBXBuildFile; fileRef = 643822F612C032F600F0C7CC /* Element.mm */; }; - 643822F812C032F600F0C7CC /* Element.mm in Sources */ = {isa = PBXBuildFile; fileRef = 643822F612C032F600F0C7CC /* Element.mm */; }; - 644F14ED10AB4EF400858ECA /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 644F14EC10AB4EF400858ECA /* Settings.bundle */; }; - 648EB1FD137C63B800DEFD44 /* Css.m in Sources */ = {isa = PBXBuildFile; fileRef = 648EB1FC137C63B800DEFD44 /* Css.m */; }; - 648EB1FE137C63B800DEFD44 /* Css.m in Sources */ = {isa = PBXBuildFile; fileRef = 648EB1FC137C63B800DEFD44 /* Css.m */; }; - 649AB342121D114A007FE128 /* Timeouts.m in Sources */ = {isa = PBXBuildFile; fileRef = 649AB341121D114A007FE128 /* Timeouts.m */; }; - 649AB343121D114A007FE128 /* Timeouts.m in Sources */ = {isa = PBXBuildFile; fileRef = 649AB341121D114A007FE128 /* Timeouts.m */; }; - 649EDC0210C5981B00E66D06 /* WebDriverUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6980FE150E5006E1274 /* WebDriverUtilities.m */; }; - 649EDC0510C5986400E66D06 /* WebDriverRequestFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6A80FE151D2006E1274 /* WebDriverRequestFetcher.m */; }; - 649EDC0610C5986B00E66D06 /* WebDriverPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6A60FE151D2006E1274 /* WebDriverPreferences.m */; }; - 649EDC8510C5988000E66D06 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 649EDC8610C5989200E66D06 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD61E69D0FE151A4006E1274 /* libsqlite3.dylib */; }; - 64A2262E12C1828000537E73 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 64A2262D12C1828000537E73 /* NSData+Base64.m */; }; - 64A2262F12C1828000537E73 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 64A2262D12C1828000537E73 /* NSData+Base64.m */; }; - 64BFFE5812B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = 64BFFE5712B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm */; }; - 64BFFE5912B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = 64BFFE5712B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm */; }; - 64BFFF7812B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 64BFFF7712B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm */; }; - 64BFFF7912B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 64BFFF7712B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm */; }; - 64CF265310D190820029D641 /* Cookie.m in Sources */ = {isa = PBXBuildFile; fileRef = 64CF265210D190820029D641 /* Cookie.m */; }; - 64CF265410D190820029D641 /* Cookie.m in Sources */ = {isa = PBXBuildFile; fileRef = 64CF265210D190820029D641 /* Cookie.m */; }; - 64D8AA431120B94D001649CC /* SessionRoot.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA421120B94D001649CC /* SessionRoot.m */; }; - 64D8AA441120B94D001649CC /* SessionRoot.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA421120B94D001649CC /* SessionRoot.m */; }; - 64D8AA4F1120B995001649CC /* NSURLRequest+IgnoreSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA4E1120B995001649CC /* NSURLRequest+IgnoreSSL.m */; }; - 64D8AA501120B995001649CC /* NSURLRequest+IgnoreSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA4E1120B995001649CC /* NSURLRequest+IgnoreSSL.m */; }; - 64D8AA691120B9EC001649CC /* HTTPVirtualDirectory+Remove.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA611120B9EC001649CC /* HTTPVirtualDirectory+Remove.m */; }; - 64D8AA711120B9EC001649CC /* HTTPVirtualDirectory+Remove.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D8AA611120B9EC001649CC /* HTTPVirtualDirectory+Remove.m */; }; - 731C4511128BBF4000261249 /* GeoLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 731C450E128BBF4000261249 /* GeoLocation.m */; }; - 731C4512128BBF4000261249 /* Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 731C4510128BBF4000261249 /* Storage.m */; }; - 73417ED613B3DD0700D47D70 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73417ED513B3DD0700D47D70 /* CoreLocation.framework */; }; - 739E3625122D78A8002D739F /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 739E3624122D78A8002D739F /* CoreLocation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 73D14FCD1289B6540074E63B /* Database.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D14FCC1289B6540074E63B /* Database.m */; }; - 8301250C0EFF044900BA9BE6 /* Session.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988650EE515C90074D106 /* Session.m */; }; - 8311AB7A0F44EF0500921B78 /* selenium-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8311AB790F44EF0500921B78 /* selenium-icon.png */; }; - 8316A2120EECE0F700FE869C /* HTTPResponse+Utility.m in Sources */ = {isa = PBXBuildFile; fileRef = 8316A2110EECE0F700FE869C /* HTTPResponse+Utility.m */; }; - 8316A2130EECE0F700FE869C /* HTTPResponse+Utility.m in Sources */ = {isa = PBXBuildFile; fileRef = 8316A2110EECE0F700FE869C /* HTTPResponse+Utility.m */; }; - 831962720F27E79F005D1D21 /* UIResponder+SimulateTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = 831962710F27E79F005D1D21 /* UIResponder+SimulateTouch.m */; }; - 833104800F1EB2F7000A38DB /* NSException+WebDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 8331047F0F1EB2F7000A38DB /* NSException+WebDriver.m */; }; - 835DF5D70F00C65600F3DD80 /* WebDriverResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 835DF5D60F00C65600F3DD80 /* WebDriverResource.m */; }; - 83615D920EEE47940028DAE5 /* ElementStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 83615D910EEE47940028DAE5 /* ElementStore.m */; }; - 83615D930EEE47940028DAE5 /* ElementStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 83615D910EEE47940028DAE5 /* ElementStore.m */; }; - 8361602C0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361602B0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m */; }; - 8361602D0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361602B0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m */; }; - 836160370EF7343B0028DAE5 /* WebDriverResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 836160360EF7343B0028DAE5 /* WebDriverResponse.m */; }; - 836160380EF7343B0028DAE5 /* WebDriverResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 836160360EF7343B0028DAE5 /* WebDriverResponse.m */; }; - 836666E10F089177002B05EE /* WebDriverResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 835DF5D60F00C65600F3DD80 /* WebDriverResource.m */; }; - 838B334C0F14254C00F72BC4 /* Session+ExecuteScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 838B334B0F14254C00F72BC4 /* Session+ExecuteScript.m */; }; - 838B334D0F14254C00F72BC4 /* Session+ExecuteScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 838B334B0F14254C00F72BC4 /* Session+ExecuteScript.m */; }; - 839049350F1ACEFD001A79B6 /* Attribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 839049340F1ACEFD001A79B6 /* Attribute.m */; }; - 8399865D0EE3A5000074D106 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8399865C0EE3A5000074D106 /* WebViewController.m */; }; - 839986A30EE3AA5E0074D106 /* HTTPServerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 839986A20EE3AA5E0074D106 /* HTTPServerController.m */; }; - 839986BE0EE3AB990074D106 /* WebDriverHTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 839986BD0EE3AB990074D106 /* WebDriverHTTPConnection.m */; }; - 839988660EE515C90074D106 /* Session.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988650EE515C90074D106 /* Session.m */; }; - 839988690EE535750074D106 /* RESTServiceMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988680EE535750074D106 /* RESTServiceMapping.m */; }; - 839989060EE605910074D106 /* GTMIPhoneUnitTestDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988FE0EE605670074D106 /* GTMIPhoneUnitTestDelegate.m */; }; - 839989070EE605920074D106 /* GTMIPhoneUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988FF0EE605670074D106 /* GTMIPhoneUnitTestMain.m */; }; - 839989080EE605930074D106 /* GTMSenTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 839989010EE605670074D106 /* GTMSenTestCase.m */; }; - 83998A0C0EE7630A0074D106 /* iWebDriver.app in Resources */ = {isa = PBXBuildFile; fileRef = 1D6058910D05DD3D006BFB54 /* iWebDriver.app */; }; - 83998A1C0EE763490074D106 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83B927D20EE354060011DCC4 /* CFNetwork.framework */; }; - 83998A1D0EE763490074D106 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 83998A880EE77F370074D106 /* WebDriverHTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 839986BD0EE3AB990074D106 /* WebDriverHTTPConnection.m */; }; - 83998A890EE77F380074D106 /* HTTPServerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 839986A20EE3AA5E0074D106 /* HTTPServerController.m */; }; - 83998A8B0EE77F440074D106 /* RESTServiceMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 839988680EE535750074D106 /* RESTServiceMapping.m */; }; - 839D64580F2EB4A7009645BF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765580DF743DE002DB57D /* CoreGraphics.framework */; }; - 839D645A0F2EB4BB009645BF /* HTTPJSONResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E5B30F0EFF6749004AA772 /* HTTPJSONResponse.m */; }; - 839D645B0F2EB4BC009645BF /* JSONRESTResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E5B3110EFF6749004AA772 /* JSONRESTResource.m */; }; - 839D645C0F2EB4C0009645BF /* Attribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 839049340F1ACEFD001A79B6 /* Attribute.m */; }; - 839D645D0F2EB4C3009645BF /* NSException+WebDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 8331047F0F1EB2F7000A38DB /* NSException+WebDriver.m */; }; - 839D645E0F2EB4CB009645BF /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8399865C0EE3A5000074D106 /* WebViewController.m */; }; - 839D645F0F2EB4CC009645BF /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A90DB2D0DB0083E9F9 /* MainViewController.m */; }; - 839D64600F2EB4D0009645BF /* UIResponder+SimulateTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = 831962710F27E79F005D1D21 /* UIResponder+SimulateTouch.m */; }; - 83B927D30EE354060011DCC4 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83B927D20EE354060011DCC4 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 83E5B3830EFF6DB7004AA772 /* HTTPJSONResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E5B30F0EFF6749004AA772 /* HTTPJSONResponse.m */; }; - 83E5B3840EFF6DB7004AA772 /* JSONRESTResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E5B3110EFF6749004AA772 /* JSONRESTResource.m */; }; - FD61E6990FE150E5006E1274 /* WebDriverUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6980FE150E5006E1274 /* WebDriverUtilities.m */; }; - FD61E69E0FE151A4006E1274 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD61E69D0FE151A4006E1274 /* libsqlite3.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - FD61E6A90FE151D2006E1274 /* WebDriverPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6A60FE151D2006E1274 /* WebDriverPreferences.m */; }; - FD61E6AA0FE151D2006E1274 /* WebDriverRequestFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = FD61E6A80FE151D2006E1274 /* WebDriverRequestFetcher.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 839989160EE607B10074D106 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1D6058900D05DD3D006BFB54; - remoteInfo = iWebDriver; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 17D715540FE107B500CC479E /* HTTPPNGResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPPNGResponse.h; sourceTree = ""; }; - 17D715550FE107B500CC479E /* HTTPPNGResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPPNGResponse.m; sourceTree = ""; }; - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D6058910D05DD3D006BFB54 /* iWebDriver.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iWebDriver.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 288765580DF743DE002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = ""; }; - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* iWebDriver_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iWebDriver_Prefix.pch; sourceTree = ""; }; - 40005B3814AA71CF009763C2 /* DDData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDData.h; sourceTree = ""; }; - 40005B3914AA71CF009763C2 /* DDData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDData.m; sourceTree = ""; }; - 40005B3A14AA71CF009763C2 /* DDNumber.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDNumber.h; sourceTree = ""; }; - 40005B3B14AA71CF009763C2 /* DDNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDNumber.m; sourceTree = ""; }; - 40005B3C14AA71CF009763C2 /* DDRange.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDRange.h; sourceTree = ""; }; - 40005B3D14AA71CF009763C2 /* DDRange.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDRange.m; sourceTree = ""; }; - 40005B3E14AA71CF009763C2 /* HTTPAuthenticationRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPAuthenticationRequest.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h; sourceTree = ""; }; - 40005B3F14AA71CF009763C2 /* HTTPAuthenticationRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPAuthenticationRequest.m; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m; sourceTree = ""; }; - 40005B4014AA71CF009763C2 /* HTTPConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPConnection.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPConnection.h; sourceTree = ""; }; - 40005B4114AA71CF009763C2 /* HTTPConnection.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPConnection.m; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPConnection.m; sourceTree = ""; }; - 40005B4214AA71CF009763C2 /* HTTPLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPLogging.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPLogging.h; sourceTree = ""; }; - 40005B4314AA71CF009763C2 /* HTTPMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPMessage.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPMessage.h; sourceTree = ""; }; - 40005B4414AA71CF009763C2 /* HTTPMessage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPMessage.m; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPMessage.m; sourceTree = ""; }; - 40005B4514AA71CF009763C2 /* HTTPResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPResponse.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPResponse.h; sourceTree = ""; }; - 40005B4614AA71CF009763C2 /* HTTPServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPServer.h; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPServer.h; sourceTree = ""; }; - 40005B4714AA71CF009763C2 /* HTTPServer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPServer.m; path = ../third_party/objc/CocoaHTTPServer/Core/HTTPServer.m; sourceTree = ""; }; - 40005B4914AA71CF009763C2 /* HTTPAsyncFileResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPAsyncFileResponse.h; sourceTree = ""; }; - 40005B4A14AA71CF009763C2 /* HTTPAsyncFileResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPAsyncFileResponse.m; sourceTree = ""; }; - 40005B4B14AA71CF009763C2 /* HTTPDataResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPDataResponse.h; sourceTree = ""; }; - 40005B4C14AA71CF009763C2 /* HTTPDataResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPDataResponse.m; sourceTree = ""; }; - 40005B4D14AA71CF009763C2 /* HTTPDynamicFileResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPDynamicFileResponse.h; sourceTree = ""; }; - 40005B4E14AA71CF009763C2 /* HTTPDynamicFileResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPDynamicFileResponse.m; sourceTree = ""; }; - 40005B4F14AA71CF009763C2 /* HTTPFileResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPFileResponse.h; sourceTree = ""; }; - 40005B5014AA71CF009763C2 /* HTTPFileResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPFileResponse.m; sourceTree = ""; }; - 40005B5114AA71CF009763C2 /* HTTPRedirectResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPRedirectResponse.h; sourceTree = ""; }; - 40005B5214AA71CF009763C2 /* HTTPRedirectResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPRedirectResponse.m; sourceTree = ""; }; - 40005B5314AA71CF009763C2 /* WebSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebSocket.h; path = ../third_party/objc/CocoaHTTPServer/Core/WebSocket.h; sourceTree = ""; }; - 40005B5414AA71CF009763C2 /* WebSocket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = WebSocket.m; path = ../third_party/objc/CocoaHTTPServer/Core/WebSocket.m; sourceTree = ""; }; - 40005B5E14AA759D009763C2 /* HTTPVirtualDirectory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPVirtualDirectory.m; path = "lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.m"; sourceTree = ""; }; - 40005B6114AA75F1009763C2 /* HTTPVirtualDirectory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPVirtualDirectory.h; path = "lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.h"; sourceTree = ""; }; - 40005B6314AA764C009763C2 /* HTTPResource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPResource.h; path = "lib/buildtime-src/cocoahttpserver/extensions/HTTPResource.h"; sourceTree = ""; }; - 40005B6414AA764C009763C2 /* HTTPStaticResource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPStaticResource.h; path = "lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.h"; sourceTree = ""; }; - 40005B6514AA764C009763C2 /* HTTPStaticResource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPStaticResource.m; path = "lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.m"; sourceTree = ""; }; - 40005B7914AA80A1009763C2 /* About.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = About.txt; sourceTree = ""; }; - 40005B7A14AA80A1009763C2 /* GCDAsyncSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GCDAsyncSocket.h; sourceTree = ""; }; - 40005B7B14AA80A1009763C2 /* GCDAsyncSocket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GCDAsyncSocket.m; sourceTree = ""; }; - 40005B7D14AA80A1009763C2 /* About.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = About.txt; sourceTree = ""; }; - 40005B7E14AA80A1009763C2 /* DDAbstractDatabaseLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDAbstractDatabaseLogger.h; sourceTree = ""; }; - 40005B7F14AA80A1009763C2 /* DDAbstractDatabaseLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDAbstractDatabaseLogger.m; sourceTree = ""; }; - 40005B8014AA80A1009763C2 /* DDASLLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDASLLogger.h; sourceTree = ""; }; - 40005B8114AA80A1009763C2 /* DDASLLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDASLLogger.m; sourceTree = ""; }; - 40005B8214AA80A1009763C2 /* DDFileLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDFileLogger.h; sourceTree = ""; }; - 40005B8314AA80A1009763C2 /* DDFileLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDFileLogger.m; sourceTree = ""; }; - 40005B8414AA80A1009763C2 /* DDLog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDLog.h; sourceTree = ""; }; - 40005B8514AA80A1009763C2 /* DDLog.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDLog.m; sourceTree = ""; }; - 40005B8614AA80A1009763C2 /* DDTTYLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDTTYLogger.h; sourceTree = ""; }; - 40005B8714AA80A1009763C2 /* DDTTYLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDTTYLogger.m; sourceTree = ""; }; - 4003054514CA44F80080BF72 /* FrameContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameContext.h; sourceTree = ""; }; - 4003054614CA44F80080BF72 /* FrameContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FrameContext.m; sourceTree = ""; }; - 402D0E4A1652182C00690ED6 /* Storyboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard_iPhone.storyboard; path = src/Storyboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; - 402D0E4C1652189C00690ED6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "src/resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; - 402D0E4D1652189C00690ED6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = src/resources/Default.png; sourceTree = SOURCE_ROOT; }; - 402D0E4E1652189C00690ED6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "src/resources/Default@2x.png"; sourceTree = SOURCE_ROOT; }; - 402D0E5216521F8700690ED6 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; - 402D0E551652203B00690ED6 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 402D0E561652203B00690ED6 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 402D0E661652FCCB00690ED6 /* Storyboard_iPad.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard_iPad.storyboard; path = src/resources/Storyboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; - 409AF55C147BF8EB00554A6E /* NSObject+SBJson.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "NSObject+SBJson.m"; path = "../third_party/objc/json-framework/Classes/NSObject+SBJson.m"; sourceTree = ""; }; - 409AF55D147BF8EB00554A6E /* SBJsonParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonParser.m; path = "../third_party/objc/json-framework/Classes/SBJsonParser.m"; sourceTree = ""; }; - 409AF55E147BF8EB00554A6E /* SBJsonStreamParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParser.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParser.m"; sourceTree = ""; }; - 409AF55F147BF8EB00554A6E /* SBJsonStreamParserAccumulator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserAccumulator.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserAccumulator.m"; sourceTree = ""; }; - 409AF560147BF8EC00554A6E /* SBJsonStreamParserAdapter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserAdapter.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserAdapter.m"; sourceTree = ""; }; - 409AF561147BF8EC00554A6E /* SBJsonStreamParserState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserState.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserState.m"; sourceTree = ""; }; - 409AF562147BF8EC00554A6E /* SBJsonStreamWriter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriter.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriter.m"; sourceTree = ""; }; - 409AF563147BF8EC00554A6E /* SBJsonStreamWriterAccumulator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriterAccumulator.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriterAccumulator.m"; sourceTree = ""; }; - 409AF564147BF8ED00554A6E /* SBJsonStreamWriterState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriterState.m; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriterState.m"; sourceTree = ""; }; - 409AF565147BF8ED00554A6E /* SBJsonTokeniser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonTokeniser.m; path = "../third_party/objc/json-framework/Classes/SBJsonTokeniser.m"; sourceTree = ""; }; - 409AF566147BF8ED00554A6E /* SBJsonUTF8Stream.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonUTF8Stream.m; path = "../third_party/objc/json-framework/Classes/SBJsonUTF8Stream.m"; sourceTree = ""; }; - 409AF567147BF8ED00554A6E /* SBJsonWriter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SBJsonWriter.m; path = "../third_party/objc/json-framework/Classes/SBJsonWriter.m"; sourceTree = ""; }; - 409AF574147BF92000554A6E /* NSObject+SBJson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSObject+SBJson.h"; path = "../third_party/objc/json-framework/Classes/NSObject+SBJson.h"; sourceTree = ""; }; - 409AF575147BF92000554A6E /* SBJson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJson.h; path = "../third_party/objc/json-framework/Classes/SBJson.h"; sourceTree = ""; }; - 409AF576147BF92000554A6E /* SBJsonParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonParser.h; path = "../third_party/objc/json-framework/Classes/SBJsonParser.h"; sourceTree = ""; }; - 409AF577147BF92000554A6E /* SBJsonStreamParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParser.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParser.h"; sourceTree = ""; }; - 409AF578147BF92100554A6E /* SBJsonStreamParserAccumulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserAccumulator.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserAccumulator.h"; sourceTree = ""; }; - 409AF579147BF92100554A6E /* SBJsonStreamParserAdapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserAdapter.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserAdapter.h"; sourceTree = ""; }; - 409AF57A147BF92100554A6E /* SBJsonStreamParserState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserState.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamParserState.h"; sourceTree = ""; }; - 409AF57B147BF92100554A6E /* SBJsonStreamWriter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriter.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriter.h"; sourceTree = ""; }; - 409AF57C147BF92100554A6E /* SBJsonStreamWriterAccumulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriterAccumulator.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriterAccumulator.h"; sourceTree = ""; }; - 409AF57D147BF92200554A6E /* SBJsonStreamWriterState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriterState.h; path = "../third_party/objc/json-framework/Classes/SBJsonStreamWriterState.h"; sourceTree = ""; }; - 409AF57E147BF92200554A6E /* SBJsonTokeniser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonTokeniser.h; path = "../third_party/objc/json-framework/Classes/SBJsonTokeniser.h"; sourceTree = ""; }; - 409AF57F147BF92200554A6E /* SBJsonUTF8Stream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonUTF8Stream.h; path = "../third_party/objc/json-framework/Classes/SBJsonUTF8Stream.h"; sourceTree = ""; }; - 409AF580147BF92200554A6E /* SBJsonWriter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBJsonWriter.h; path = "../third_party/objc/json-framework/Classes/SBJsonWriter.h"; sourceTree = ""; }; - 40BE09A9147714580042C6DA /* Status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Status.h; sourceTree = ""; }; - 40BE09AA147714580042C6DA /* Status.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Status.m; sourceTree = ""; }; - 642C489E112260150064EB9C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 642C48A3112260480064EB9C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 643822E812C0305900F0C7CC /* atoms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atoms.h; sourceTree = ""; }; - 643822F612C032F600F0C7CC /* Element.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Element.mm; sourceTree = ""; }; - 644F14EC10AB4EF400858ECA /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; - 648EB1FB137C63B800DEFD44 /* Css.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Css.h; sourceTree = ""; }; - 648EB1FC137C63B800DEFD44 /* Css.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Css.m; sourceTree = ""; }; - 649AB340121D114A007FE128 /* Timeouts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timeouts.h; sourceTree = ""; }; - 649AB341121D114A007FE128 /* Timeouts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Timeouts.m; sourceTree = ""; }; - 64A2262C12C1828000537E73 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = ""; }; - 64A2262D12C1828000537E73 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = ""; }; - 64BFFE5612B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HTTPVirtualDirectory+ExecuteScript.h"; sourceTree = ""; }; - 64BFFE5712B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "HTTPVirtualDirectory+ExecuteScript.mm"; sourceTree = ""; }; - 64BFFF7612B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HTTPVirtualDirectory+FindElement.h"; sourceTree = ""; }; - 64BFFF7712B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "HTTPVirtualDirectory+FindElement.mm"; sourceTree = ""; }; - 64CF265110D190820029D641 /* Cookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cookie.h; sourceTree = ""; }; - 64CF265210D190820029D641 /* Cookie.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cookie.m; sourceTree = ""; }; - 64D8AA411120B94D001649CC /* SessionRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionRoot.h; sourceTree = ""; }; - 64D8AA421120B94D001649CC /* SessionRoot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionRoot.m; sourceTree = ""; }; - 64D8AA4D1120B995001649CC /* NSURLRequest+IgnoreSSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLRequest+IgnoreSSL.h"; sourceTree = ""; }; - 64D8AA4E1120B995001649CC /* NSURLRequest+IgnoreSSL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURLRequest+IgnoreSSL.m"; sourceTree = ""; }; - 64D8AA601120B9EC001649CC /* HTTPVirtualDirectory+Remove.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HTTPVirtualDirectory+Remove.h"; sourceTree = ""; }; - 64D8AA611120B9EC001649CC /* HTTPVirtualDirectory+Remove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HTTPVirtualDirectory+Remove.m"; sourceTree = ""; }; - 731C450D128BBF4000261249 /* GeoLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeoLocation.h; sourceTree = ""; }; - 731C450E128BBF4000261249 /* GeoLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeoLocation.m; sourceTree = ""; usesTabs = 0; }; - 731C450F128BBF4000261249 /* Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Storage.h; sourceTree = ""; }; - 731C4510128BBF4000261249 /* Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Storage.m; sourceTree = ""; tabWidth = 1; usesTabs = 0; }; - 73417ED513B3DD0700D47D70 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 73417F4513B3E2AB00D47D70 /* GTMObjC2Runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMObjC2Runtime.h; sourceTree = ""; }; - 73417F4613B3E2AB00D47D70 /* GTMUnitTestDevLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMUnitTestDevLog.h; sourceTree = ""; }; - 73576C0713D7832A00C76F95 /* errorcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = errorcodes.h; path = "../../../cpp/webdriver-interactions/errorcodes.h"; sourceTree = ""; }; - 739E3624122D78A8002D739F /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 73D14FCB1289B6540074E63B /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Database.h; sourceTree = ""; }; - 73D14FCC1289B6540074E63B /* Database.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Database.m; sourceTree = ""; }; - 8311AB790F44EF0500921B78 /* selenium-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "selenium-icon.png"; sourceTree = ""; }; - 8316A2100EECE0F700FE869C /* HTTPResponse+Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HTTPResponse+Utility.h"; sourceTree = ""; }; - 8316A2110EECE0F700FE869C /* HTTPResponse+Utility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HTTPResponse+Utility.m"; sourceTree = ""; }; - 831962700F27E79F005D1D21 /* UIResponder+SimulateTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIResponder+SimulateTouch.h"; sourceTree = ""; }; - 831962710F27E79F005D1D21 /* UIResponder+SimulateTouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIResponder+SimulateTouch.m"; sourceTree = ""; }; - 833103FC0F1D7F57000A38DB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8331047E0F1EB2F7000A38DB /* NSException+WebDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSException+WebDriver.h"; sourceTree = ""; }; - 8331047F0F1EB2F7000A38DB /* NSException+WebDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSException+WebDriver.m"; sourceTree = ""; }; - 835DF5D50F00C65600F3DD80 /* WebDriverResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverResource.h; sourceTree = ""; }; - 835DF5D60F00C65600F3DD80 /* WebDriverResource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverResource.m; sourceTree = ""; }; - 83615D900EEE47940028DAE5 /* ElementStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementStore.h; sourceTree = ""; }; - 83615D910EEE47940028DAE5 /* ElementStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ElementStore.m; sourceTree = ""; }; - 8361602A0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HTTPVirtualDirectory+AccessViewController.h"; sourceTree = ""; }; - 8361602B0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HTTPVirtualDirectory+AccessViewController.m"; sourceTree = ""; }; - 836160350EF7343B0028DAE5 /* WebDriverResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverResponse.h; sourceTree = ""; }; - 836160360EF7343B0028DAE5 /* WebDriverResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverResponse.m; sourceTree = ""; }; - 838B334A0F14254C00F72BC4 /* Session+ExecuteScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Session+ExecuteScript.h"; sourceTree = ""; }; - 838B334B0F14254C00F72BC4 /* Session+ExecuteScript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Session+ExecuteScript.m"; sourceTree = ""; }; - 838B33770F142CE800F72BC4 /* Element.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Element.h; sourceTree = ""; }; - 839049330F1ACEFD001A79B6 /* Attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attribute.h; sourceTree = ""; }; - 839049340F1ACEFD001A79B6 /* Attribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Attribute.m; sourceTree = ""; }; - 8399865B0EE3A5000074D106 /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = ""; }; - 8399865C0EE3A5000074D106 /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = ""; }; - 839986A10EE3AA5E0074D106 /* HTTPServerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPServerController.h; sourceTree = ""; }; - 839986A20EE3AA5E0074D106 /* HTTPServerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPServerController.m; sourceTree = ""; }; - 839986BC0EE3AB990074D106 /* WebDriverHTTPConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverHTTPConnection.h; sourceTree = ""; }; - 839986BD0EE3AB990074D106 /* WebDriverHTTPConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverHTTPConnection.m; sourceTree = ""; }; - 839988640EE515C90074D106 /* Session.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Session.h; sourceTree = ""; }; - 839988650EE515C90074D106 /* Session.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Session.m; sourceTree = ""; }; - 839988670EE535750074D106 /* RESTServiceMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RESTServiceMapping.h; sourceTree = ""; }; - 839988680EE535750074D106 /* RESTServiceMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RESTServiceMapping.m; sourceTree = ""; }; - 839988DF0EE6052D0074D106 /* Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tests.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 839988FD0EE605670074D106 /* GTMIPhoneUnitTestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMIPhoneUnitTestDelegate.h; sourceTree = ""; }; - 839988FE0EE605670074D106 /* GTMIPhoneUnitTestDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMIPhoneUnitTestDelegate.m; sourceTree = ""; }; - 839988FF0EE605670074D106 /* GTMIPhoneUnitTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMIPhoneUnitTestMain.m; sourceTree = ""; }; - 839989000EE605670074D106 /* GTMSenTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMSenTestCase.h; sourceTree = ""; }; - 839989010EE605670074D106 /* GTMSenTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMSenTestCase.m; sourceTree = ""; }; - 839989050EE605820074D106 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = ""; }; - 83B927D20EE354060011DCC4 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; - 83E5B30E0EFF6749004AA772 /* HTTPJSONResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTTPJSONResponse.h; sourceTree = ""; }; - 83E5B30F0EFF6749004AA772 /* HTTPJSONResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTTPJSONResponse.m; sourceTree = ""; }; - 83E5B3100EFF6749004AA772 /* JSONRESTResource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONRESTResource.h; sourceTree = ""; }; - 83E5B3110EFF6749004AA772 /* JSONRESTResource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JSONRESTResource.m; sourceTree = ""; }; - FD61E6970FE150E5006E1274 /* WebDriverUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverUtilities.h; sourceTree = ""; }; - FD61E6980FE150E5006E1274 /* WebDriverUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverUtilities.m; sourceTree = ""; }; - FD61E69D0FE151A4006E1274 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = /usr/lib/libsqlite3.dylib; sourceTree = ""; }; - FD61E6A50FE151D2006E1274 /* WebDriverPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverPreferences.h; sourceTree = ""; }; - FD61E6A60FE151D2006E1274 /* WebDriverPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverPreferences.m; sourceTree = ""; }; - FD61E6A70FE151D2006E1274 /* WebDriverRequestFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDriverRequestFetcher.h; sourceTree = ""; }; - FD61E6A80FE151D2006E1274 /* WebDriverRequestFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebDriverRequestFetcher.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 402D0E5316521F8700690ED6 /* Security.framework in Frameworks */, - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */, - 83B927D30EE354060011DCC4 /* CFNetwork.framework in Frameworks */, - FD61E69E0FE151A4006E1274 /* libsqlite3.dylib in Frameworks */, - 642C489F112260150064EB9C /* QuartzCore.framework in Frameworks */, - 739E3625122D78A8002D739F /* CoreLocation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 839988DD0EE6052D0074D106 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 402D0E5416521FBB00690ED6 /* Security.framework in Frameworks */, - 83998A1D0EE763490074D106 /* Foundation.framework in Frameworks */, - 649EDC8510C5988000E66D06 /* UIKit.framework in Frameworks */, - 839D64580F2EB4A7009645BF /* CoreGraphics.framework in Frameworks */, - 83998A1C0EE763490074D106 /* CFNetwork.framework in Frameworks */, - 649EDC8610C5989200E66D06 /* libsqlite3.dylib in Frameworks */, - 642C48A4112260480064EB9C /* QuartzCore.framework in Frameworks */, - 73417ED613B3DD0700D47D70 /* CoreLocation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 17D715530FE1078C00CC479E /* HTTP + PNG */ = { - isa = PBXGroup; - children = ( - 64A2262C12C1828000537E73 /* NSData+Base64.h */, - 64A2262D12C1828000537E73 /* NSData+Base64.m */, - 17D715540FE107B500CC479E /* HTTPPNGResponse.h */, - 17D715550FE107B500CC479E /* HTTPPNGResponse.m */, - ); - name = "HTTP + PNG"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* iWebDriver.app */, - 839988DF0EE6052D0074D106 /* Tests.app */, - ); - name = Products; - sourceTree = ""; - }; - 289233A00DB2D0730083E9F9 /* Main View */ = { - isa = PBXGroup; - children = ( - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */, - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */, - 8399865B0EE3A5000074D106 /* WebViewController.h */, - 8399865C0EE3A5000074D106 /* WebViewController.m */, - 831962700F27E79F005D1D21 /* UIResponder+SimulateTouch.h */, - 831962710F27E79F005D1D21 /* UIResponder+SimulateTouch.m */, - ); - name = "Main View"; - path = src/objc; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - 839988BA0EE5F0500074D106 /* Tests */, - 839986AC0EE3AA720074D106 /* Web server extensions */, - 289233A00DB2D0730083E9F9 /* Main View */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 738AB21112023E07003833A2 /* Resources-iPad */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - 833103FC0F1D7F57000A38DB /* Info.plist */, - 644F14EC10AB4EF400858ECA /* Settings.bundle */, - 642C489E112260150064EB9C /* QuartzCore.framework */, - 642C48A3112260480064EB9C /* QuartzCore.framework */, - 73417ED513B3DD0700D47D70 /* CoreLocation.framework */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 402D0E551652203B00690ED6 /* AppDelegate.h */, - 402D0E561652203B00690ED6 /* AppDelegate.m */, - 29B97316FDCFA39411CA2CEA /* main.m */, - 32CA4F630368D1EE00C91783 /* iWebDriver_Prefix.pch */, - ); - name = "Other Sources"; - path = src/objc; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 402D0E4C1652189C00690ED6 /* Default-568h@2x.png */, - 402D0E4D1652189C00690ED6 /* Default.png */, - 402D0E4E1652189C00690ED6 /* Default@2x.png */, - 402D0E4A1652182C00690ED6 /* Storyboard_iPhone.storyboard */, - 8311AB790F44EF0500921B78 /* selenium-icon.png */, - 402D0E661652FCCB00690ED6 /* Storyboard_iPad.storyboard */, - ); - name = Resources; - path = src/objc; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 40005B3514AA70FC009763C2 /* CocoaHTTPServer */, - 409AF58E147BF9CE00554A6E /* SBJson */, - FD61E69D0FE151A4006E1274 /* libsqlite3.dylib */, - 83B927D20EE354060011DCC4 /* CFNetwork.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765580DF743DE002DB57D /* CoreGraphics.framework */, - 739E3624122D78A8002D739F /* CoreLocation.framework */, - 402D0E5216521F8700690ED6 /* Security.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 40005B3514AA70FC009763C2 /* CocoaHTTPServer */ = { - isa = PBXGroup; - children = ( - 40005B7714AA80A1009763C2 /* Vendor */, - 40005B6914AA7656009763C2 /* extensions */, - 40005B3714AA71CF009763C2 /* Categories */, - 40005B3E14AA71CF009763C2 /* HTTPAuthenticationRequest.h */, - 40005B3F14AA71CF009763C2 /* HTTPAuthenticationRequest.m */, - 40005B4014AA71CF009763C2 /* HTTPConnection.h */, - 40005B4114AA71CF009763C2 /* HTTPConnection.m */, - 40005B4214AA71CF009763C2 /* HTTPLogging.h */, - 40005B4314AA71CF009763C2 /* HTTPMessage.h */, - 40005B4414AA71CF009763C2 /* HTTPMessage.m */, - 40005B4514AA71CF009763C2 /* HTTPResponse.h */, - 40005B4614AA71CF009763C2 /* HTTPServer.h */, - 40005B4714AA71CF009763C2 /* HTTPServer.m */, - 40005B4814AA71CF009763C2 /* Responses */, - 40005B5314AA71CF009763C2 /* WebSocket.h */, - 40005B5414AA71CF009763C2 /* WebSocket.m */, - ); - name = CocoaHTTPServer; - sourceTree = ""; - }; - 40005B3714AA71CF009763C2 /* Categories */ = { - isa = PBXGroup; - children = ( - 40005B3814AA71CF009763C2 /* DDData.h */, - 40005B3914AA71CF009763C2 /* DDData.m */, - 40005B3A14AA71CF009763C2 /* DDNumber.h */, - 40005B3B14AA71CF009763C2 /* DDNumber.m */, - 40005B3C14AA71CF009763C2 /* DDRange.h */, - 40005B3D14AA71CF009763C2 /* DDRange.m */, - ); - name = Categories; - path = ../third_party/objc/CocoaHTTPServer/Core/Categories; - sourceTree = ""; - }; - 40005B4814AA71CF009763C2 /* Responses */ = { - isa = PBXGroup; - children = ( - 40005B4914AA71CF009763C2 /* HTTPAsyncFileResponse.h */, - 40005B4A14AA71CF009763C2 /* HTTPAsyncFileResponse.m */, - 40005B4B14AA71CF009763C2 /* HTTPDataResponse.h */, - 40005B4C14AA71CF009763C2 /* HTTPDataResponse.m */, - 40005B4D14AA71CF009763C2 /* HTTPDynamicFileResponse.h */, - 40005B4E14AA71CF009763C2 /* HTTPDynamicFileResponse.m */, - 40005B4F14AA71CF009763C2 /* HTTPFileResponse.h */, - 40005B5014AA71CF009763C2 /* HTTPFileResponse.m */, - 40005B5114AA71CF009763C2 /* HTTPRedirectResponse.h */, - 40005B5214AA71CF009763C2 /* HTTPRedirectResponse.m */, - ); - name = Responses; - path = ../third_party/objc/CocoaHTTPServer/Core/Responses; - sourceTree = ""; - }; - 40005B6914AA7656009763C2 /* extensions */ = { - isa = PBXGroup; - children = ( - 40005B6314AA764C009763C2 /* HTTPResource.h */, - 40005B6414AA764C009763C2 /* HTTPStaticResource.h */, - 40005B6514AA764C009763C2 /* HTTPStaticResource.m */, - 40005B6114AA75F1009763C2 /* HTTPVirtualDirectory.h */, - 40005B5E14AA759D009763C2 /* HTTPVirtualDirectory.m */, - ); - name = extensions; - sourceTree = ""; - }; - 40005B7714AA80A1009763C2 /* Vendor */ = { - isa = PBXGroup; - children = ( - 40005B7814AA80A1009763C2 /* CocoaAsyncSocket */, - 40005B7C14AA80A1009763C2 /* CocoaLumberjack */, - ); - name = Vendor; - path = ../third_party/objc/CocoaHTTPServer/Vendor; - sourceTree = ""; - }; - 40005B7814AA80A1009763C2 /* CocoaAsyncSocket */ = { - isa = PBXGroup; - children = ( - 40005B7914AA80A1009763C2 /* About.txt */, - 40005B7A14AA80A1009763C2 /* GCDAsyncSocket.h */, - 40005B7B14AA80A1009763C2 /* GCDAsyncSocket.m */, - ); - path = CocoaAsyncSocket; - sourceTree = ""; - }; - 40005B7C14AA80A1009763C2 /* CocoaLumberjack */ = { - isa = PBXGroup; - children = ( - 40005B7D14AA80A1009763C2 /* About.txt */, - 40005B7E14AA80A1009763C2 /* DDAbstractDatabaseLogger.h */, - 40005B7F14AA80A1009763C2 /* DDAbstractDatabaseLogger.m */, - 40005B8014AA80A1009763C2 /* DDASLLogger.h */, - 40005B8114AA80A1009763C2 /* DDASLLogger.m */, - 40005B8214AA80A1009763C2 /* DDFileLogger.h */, - 40005B8314AA80A1009763C2 /* DDFileLogger.m */, - 40005B8414AA80A1009763C2 /* DDLog.h */, - 40005B8514AA80A1009763C2 /* DDLog.m */, - 40005B8614AA80A1009763C2 /* DDTTYLogger.h */, - 40005B8714AA80A1009763C2 /* DDTTYLogger.m */, - ); - path = CocoaLumberjack; - sourceTree = ""; - }; - 409AF58E147BF9CE00554A6E /* SBJson */ = { - isa = PBXGroup; - children = ( - 409AF574147BF92000554A6E /* NSObject+SBJson.h */, - 409AF575147BF92000554A6E /* SBJson.h */, - 409AF576147BF92000554A6E /* SBJsonParser.h */, - 409AF577147BF92000554A6E /* SBJsonStreamParser.h */, - 409AF578147BF92100554A6E /* SBJsonStreamParserAccumulator.h */, - 409AF579147BF92100554A6E /* SBJsonStreamParserAdapter.h */, - 409AF57A147BF92100554A6E /* SBJsonStreamParserState.h */, - 409AF57B147BF92100554A6E /* SBJsonStreamWriter.h */, - 409AF57C147BF92100554A6E /* SBJsonStreamWriterAccumulator.h */, - 409AF57D147BF92200554A6E /* SBJsonStreamWriterState.h */, - 409AF57E147BF92200554A6E /* SBJsonTokeniser.h */, - 409AF57F147BF92200554A6E /* SBJsonUTF8Stream.h */, - 409AF580147BF92200554A6E /* SBJsonWriter.h */, - 409AF55C147BF8EB00554A6E /* NSObject+SBJson.m */, - 409AF55D147BF8EB00554A6E /* SBJsonParser.m */, - 409AF55E147BF8EB00554A6E /* SBJsonStreamParser.m */, - 409AF55F147BF8EB00554A6E /* SBJsonStreamParserAccumulator.m */, - 409AF560147BF8EC00554A6E /* SBJsonStreamParserAdapter.m */, - 409AF561147BF8EC00554A6E /* SBJsonStreamParserState.m */, - 409AF562147BF8EC00554A6E /* SBJsonStreamWriter.m */, - 409AF563147BF8EC00554A6E /* SBJsonStreamWriterAccumulator.m */, - 409AF564147BF8ED00554A6E /* SBJsonStreamWriterState.m */, - 409AF565147BF8ED00554A6E /* SBJsonTokeniser.m */, - 409AF566147BF8ED00554A6E /* SBJsonUTF8Stream.m */, - 409AF567147BF8ED00554A6E /* SBJsonWriter.m */, - ); - name = SBJson; - sourceTree = ""; - }; - 738AB21112023E07003833A2 /* Resources-iPad */ = { - isa = PBXGroup; - children = ( - ); - name = "Resources-iPad"; - sourceTree = ""; - }; - 83169E840EE8DE0100FE869C /* HTTP Server configuration */ = { - isa = PBXGroup; - children = ( - 839986BC0EE3AB990074D106 /* WebDriverHTTPConnection.h */, - 839986BD0EE3AB990074D106 /* WebDriverHTTPConnection.m */, - ); - name = "HTTP Server configuration"; - sourceTree = ""; - }; - 838B332C0F1422F600F72BC4 /* REST Service */ = { - isa = PBXGroup; - children = ( - 648EB1FB137C63B800DEFD44 /* Css.h */, - 648EB1FC137C63B800DEFD44 /* Css.m */, - 731C450D128BBF4000261249 /* GeoLocation.h */, - 731C450E128BBF4000261249 /* GeoLocation.m */, - 40BE09A9147714580042C6DA /* Status.h */, - 40BE09AA147714580042C6DA /* Status.m */, - 731C450F128BBF4000261249 /* Storage.h */, - 731C4510128BBF4000261249 /* Storage.m */, - 64D8AA411120B94D001649CC /* SessionRoot.h */, - 64D8AA421120B94D001649CC /* SessionRoot.m */, - 839988640EE515C90074D106 /* Session.h */, - 839988650EE515C90074D106 /* Session.m */, - 838B334A0F14254C00F72BC4 /* Session+ExecuteScript.h */, - 838B334B0F14254C00F72BC4 /* Session+ExecuteScript.m */, - 649AB340121D114A007FE128 /* Timeouts.h */, - 649AB341121D114A007FE128 /* Timeouts.m */, - 64CF265110D190820029D641 /* Cookie.h */, - 64CF265210D190820029D641 /* Cookie.m */, - 83615D900EEE47940028DAE5 /* ElementStore.h */, - 83615D910EEE47940028DAE5 /* ElementStore.m */, - 838B33770F142CE800F72BC4 /* Element.h */, - 643822F612C032F600F0C7CC /* Element.mm */, - 839049330F1ACEFD001A79B6 /* Attribute.h */, - 839049340F1ACEFD001A79B6 /* Attribute.m */, - 73D14FCB1289B6540074E63B /* Database.h */, - 73D14FCC1289B6540074E63B /* Database.m */, - 4003054514CA44F80080BF72 /* FrameContext.h */, - 4003054614CA44F80080BF72 /* FrameContext.m */, - ); - name = "REST Service"; - sourceTree = ""; - }; - 839986AC0EE3AA720074D106 /* Web server extensions */ = { - isa = PBXGroup; - children = ( - 73576C0713D7832A00C76F95 /* errorcodes.h */, - 643822E812C0305900F0C7CC /* atoms.h */, - FD61E6970FE150E5006E1274 /* WebDriverUtilities.h */, - FD61E6980FE150E5006E1274 /* WebDriverUtilities.m */, - FD61E6A50FE151D2006E1274 /* WebDriverPreferences.h */, - FD61E6A60FE151D2006E1274 /* WebDriverPreferences.m */, - FD61E6A70FE151D2006E1274 /* WebDriverRequestFetcher.h */, - FD61E6A80FE151D2006E1274 /* WebDriverRequestFetcher.m */, - 8316A2100EECE0F700FE869C /* HTTPResponse+Utility.h */, - 8316A2110EECE0F700FE869C /* HTTPResponse+Utility.m */, - 839986A10EE3AA5E0074D106 /* HTTPServerController.h */, - 839986A20EE3AA5E0074D106 /* HTTPServerController.m */, - 64D8AA601120B9EC001649CC /* HTTPVirtualDirectory+Remove.h */, - 64D8AA611120B9EC001649CC /* HTTPVirtualDirectory+Remove.m */, - 64D8AA4D1120B995001649CC /* NSURLRequest+IgnoreSSL.h */, - 64D8AA4E1120B995001649CC /* NSURLRequest+IgnoreSSL.m */, - 8331047E0F1EB2F7000A38DB /* NSException+WebDriver.h */, - 8331047F0F1EB2F7000A38DB /* NSException+WebDriver.m */, - 83E5B30D0EFF6749004AA772 /* HTTP + JSON */, - 17D715530FE1078C00CC479E /* HTTP + PNG */, - 83169E840EE8DE0100FE869C /* HTTP Server configuration */, - 839988600EE515B50074D106 /* REST Mapping */, - 838B332C0F1422F600F72BC4 /* REST Service */, - ); - name = "Web server extensions"; - path = src/objc; - sourceTree = ""; - }; - 839988600EE515B50074D106 /* REST Mapping */ = { - isa = PBXGroup; - children = ( - 839988670EE535750074D106 /* RESTServiceMapping.h */, - 839988680EE535750074D106 /* RESTServiceMapping.m */, - 8361602A0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.h */, - 8361602B0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m */, - 64BFFE5612B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.h */, - 64BFFE5712B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm */, - 64BFFF7612B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.h */, - 64BFFF7712B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm */, - 836160350EF7343B0028DAE5 /* WebDriverResponse.h */, - 836160360EF7343B0028DAE5 /* WebDriverResponse.m */, - 835DF5D50F00C65600F3DD80 /* WebDriverResource.h */, - 835DF5D60F00C65600F3DD80 /* WebDriverResource.m */, - ); - name = "REST Mapping"; - sourceTree = ""; - }; - 839988BA0EE5F0500074D106 /* Tests */ = { - isa = PBXGroup; - children = ( - 839988E50EE6053C0074D106 /* GTM Unit testing */, - ); - name = Tests; - path = test/objc; - sourceTree = ""; - }; - 839988E50EE6053C0074D106 /* GTM Unit testing */ = { - isa = PBXGroup; - children = ( - 73417F4513B3E2AB00D47D70 /* GTMObjC2Runtime.h */, - 73417F4613B3E2AB00D47D70 /* GTMUnitTestDevLog.h */, - 839988FD0EE605670074D106 /* GTMIPhoneUnitTestDelegate.h */, - 839988FE0EE605670074D106 /* GTMIPhoneUnitTestDelegate.m */, - 839988FF0EE605670074D106 /* GTMIPhoneUnitTestMain.m */, - 839989000EE605670074D106 /* GTMSenTestCase.h */, - 839989010EE605670074D106 /* GTMSenTestCase.m */, - 839989050EE605820074D106 /* GTMDefines.h */, - ); - name = "GTM Unit testing"; - sourceTree = ""; - }; - 83E5B30D0EFF6749004AA772 /* HTTP + JSON */ = { - isa = PBXGroup; - children = ( - 83E5B30E0EFF6749004AA772 /* HTTPJSONResponse.h */, - 83E5B30F0EFF6749004AA772 /* HTTPJSONResponse.m */, - 83E5B3100EFF6749004AA772 /* JSONRESTResource.h */, - 83E5B3110EFF6749004AA772 /* JSONRESTResource.m */, - ); - name = "HTTP + JSON"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* iWebDriver */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iWebDriver" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 64BFFD4612B6F42000FEB710 /* ShellScript */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = iWebDriver; - productName = iWebDriver; - productReference = 1D6058910D05DD3D006BFB54 /* iWebDriver.app */; - productType = "com.apple.product-type.application"; - }; - 839988DE0EE6052D0074D106 /* Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 839988E40EE6052F0074D106 /* Build configuration list for PBXNativeTarget "Tests" */; - buildPhases = ( - 839988DB0EE6052D0074D106 /* Resources */, - 839988DC0EE6052D0074D106 /* Sources */, - 839988DD0EE6052D0074D106 /* Frameworks */, - 8399890A0EE605A30074D106 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 839989170EE607B10074D106 /* PBXTargetDependency */, - ); - name = Tests; - productName = Tests; - productReference = 839988DF0EE6052D0074D106 /* Tests.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iWebDriver" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* iWebDriver */, - 839988DE0EE6052D0074D106 /* Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8311AB7A0F44EF0500921B78 /* selenium-icon.png in Resources */, - 644F14ED10AB4EF400858ECA /* Settings.bundle in Resources */, - 402D0E4B1652182C00690ED6 /* Storyboard_iPhone.storyboard in Resources */, - 402D0E4F1652189C00690ED6 /* Default-568h@2x.png in Resources */, - 402D0E501652189C00690ED6 /* Default.png in Resources */, - 402D0E511652189C00690ED6 /* Default@2x.png in Resources */, - 402D0E671652FCCB00690ED6 /* Storyboard_iPad.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 839988DB0EE6052D0074D106 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 83998A0C0EE7630A0074D106 /* iWebDriver.app in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 64BFFD4612B6F42000FEB710 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ ! -e ${PROJECT_DIR}/src/objc/atoms.h ]; then\n if [ -e ${PROJECT_DIR}/../go ]; then\n cd ${PROJECT_DIR}/..\n echo \"Regenerating iPhone atoms header file\"\n\n ./go iphone_atoms\n BUILD_RESULT=$?\n if [ $BUILD_RESULT -ne 0 ]; then\n echo \"Failed to regenerate header file\"; exit $BUILD_RESULT\n fi\nelse\n echo \"Unable to locate \\\"go\\\" script;\"\nfi\nfi\n"; - }; - 8399890A0EE605A30074D106 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "${TARGET_BUILD_DIR}/../../RunIPhoneUnitTest.sh"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 40005B8814AA80C6009763C2 /* GCDAsyncSocket.m in Sources */, - 40005B8914AA80C6009763C2 /* DDAbstractDatabaseLogger.m in Sources */, - 40005B8A14AA80C6009763C2 /* DDASLLogger.m in Sources */, - 40005B8B14AA80C6009763C2 /* DDFileLogger.m in Sources */, - 40005B8C14AA80C6009763C2 /* DDLog.m in Sources */, - 40005B8D14AA80C6009763C2 /* DDTTYLogger.m in Sources */, - 40005B6A14AA8011009763C2 /* DDData.m in Sources */, - 40005B6B14AA8011009763C2 /* DDNumber.m in Sources */, - 40005B6C14AA8011009763C2 /* DDRange.m in Sources */, - 40005B6D14AA8011009763C2 /* HTTPAuthenticationRequest.m in Sources */, - 40005B6E14AA8011009763C2 /* HTTPConnection.m in Sources */, - 40005B6F14AA8011009763C2 /* HTTPMessage.m in Sources */, - 40005B7014AA8011009763C2 /* HTTPServer.m in Sources */, - 40005B7114AA8011009763C2 /* HTTPAsyncFileResponse.m in Sources */, - 40005B7214AA8011009763C2 /* HTTPDataResponse.m in Sources */, - 40005B7314AA8011009763C2 /* HTTPDynamicFileResponse.m in Sources */, - 40005B7414AA8011009763C2 /* HTTPFileResponse.m in Sources */, - 40005B7514AA8011009763C2 /* HTTPRedirectResponse.m in Sources */, - 40005B7614AA8011009763C2 /* WebSocket.m in Sources */, - 40005B6814AA764C009763C2 /* HTTPStaticResource.m in Sources */, - 40005B5F14AA759D009763C2 /* HTTPVirtualDirectory.m in Sources */, - 409AF568147BF8ED00554A6E /* NSObject+SBJson.m in Sources */, - 409AF569147BF8ED00554A6E /* SBJsonParser.m in Sources */, - 409AF56A147BF8EE00554A6E /* SBJsonStreamParser.m in Sources */, - 409AF56B147BF8EE00554A6E /* SBJsonStreamParserAccumulator.m in Sources */, - 409AF56C147BF8EE00554A6E /* SBJsonStreamParserAdapter.m in Sources */, - 409AF56D147BF8EE00554A6E /* SBJsonStreamParserState.m in Sources */, - 409AF56E147BF8EE00554A6E /* SBJsonStreamWriter.m in Sources */, - 409AF56F147BF8EE00554A6E /* SBJsonStreamWriterAccumulator.m in Sources */, - 409AF570147BF8EE00554A6E /* SBJsonStreamWriterState.m in Sources */, - 409AF571147BF8EE00554A6E /* SBJsonTokeniser.m in Sources */, - 409AF572147BF8EE00554A6E /* SBJsonUTF8Stream.m in Sources */, - 409AF573147BF8EE00554A6E /* SBJsonWriter.m in Sources */, - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */, - 8399865D0EE3A5000074D106 /* WebViewController.m in Sources */, - 839986A30EE3AA5E0074D106 /* HTTPServerController.m in Sources */, - 839986BE0EE3AB990074D106 /* WebDriverHTTPConnection.m in Sources */, - 839988660EE515C90074D106 /* Session.m in Sources */, - 839988690EE535750074D106 /* RESTServiceMapping.m in Sources */, - 8316A2130EECE0F700FE869C /* HTTPResponse+Utility.m in Sources */, - 83615D920EEE47940028DAE5 /* ElementStore.m in Sources */, - 8361602C0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m in Sources */, - 836160370EF7343B0028DAE5 /* WebDriverResponse.m in Sources */, - 83E5B3830EFF6DB7004AA772 /* HTTPJSONResponse.m in Sources */, - 83E5B3840EFF6DB7004AA772 /* JSONRESTResource.m in Sources */, - 836666E10F089177002B05EE /* WebDriverResource.m in Sources */, - 838B334D0F14254C00F72BC4 /* Session+ExecuteScript.m in Sources */, - 839049350F1ACEFD001A79B6 /* Attribute.m in Sources */, - 833104800F1EB2F7000A38DB /* NSException+WebDriver.m in Sources */, - 831962720F27E79F005D1D21 /* UIResponder+SimulateTouch.m in Sources */, - FD61E6990FE150E5006E1274 /* WebDriverUtilities.m in Sources */, - FD61E6A90FE151D2006E1274 /* WebDriverPreferences.m in Sources */, - FD61E6AA0FE151D2006E1274 /* WebDriverRequestFetcher.m in Sources */, - 17D715560FE107B500CC479E /* HTTPPNGResponse.m in Sources */, - 64CF265310D190820029D641 /* Cookie.m in Sources */, - 64D8AA431120B94D001649CC /* SessionRoot.m in Sources */, - 64D8AA4F1120B995001649CC /* NSURLRequest+IgnoreSSL.m in Sources */, - 64D8AA691120B9EC001649CC /* HTTPVirtualDirectory+Remove.m in Sources */, - 649AB342121D114A007FE128 /* Timeouts.m in Sources */, - 73D14FCD1289B6540074E63B /* Database.m in Sources */, - 731C4511128BBF4000261249 /* GeoLocation.m in Sources */, - 731C4512128BBF4000261249 /* Storage.m in Sources */, - 64BFFE5912B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm in Sources */, - 64BFFF7812B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm in Sources */, - 643822F712C032F600F0C7CC /* Element.mm in Sources */, - 64A2262E12C1828000537E73 /* NSData+Base64.m in Sources */, - 648EB1FD137C63B800DEFD44 /* Css.m in Sources */, - 40BE09AB147714580042C6DA /* Status.m in Sources */, - 4003054714CA44F80080BF72 /* FrameContext.m in Sources */, - 402D0E571652203B00690ED6 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 839988DC0EE6052D0074D106 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4003054814CA44F80080BF72 /* FrameContext.m in Sources */, - 40597F3414AB78E90056C533 /* HTTPAsyncFileResponse.m in Sources */, - 40597F3614AB78E90056C533 /* HTTPDataResponse.m in Sources */, - 40597F3814AB78E90056C533 /* HTTPDynamicFileResponse.m in Sources */, - 40597F3A14AB78E90056C533 /* HTTPFileResponse.m in Sources */, - 40597F3C14AB78E90056C533 /* HTTPRedirectResponse.m in Sources */, - 40597F3E14AB78E90056C533 /* WebSocket.m in Sources */, - 40597F2414AB78DC0056C533 /* DDData.m in Sources */, - 40597F2614AB78DC0056C533 /* DDNumber.m in Sources */, - 40597F2814AB78DC0056C533 /* DDRange.m in Sources */, - 40597F2A14AB78DC0056C533 /* HTTPAuthenticationRequest.m in Sources */, - 40597F2C14AB78DC0056C533 /* HTTPConnection.m in Sources */, - 40597F2F14AB78DC0056C533 /* HTTPMessage.m in Sources */, - 40597F3214AB78DC0056C533 /* HTTPServer.m in Sources */, - 40597F1214AB78C80056C533 /* GCDAsyncSocket.m in Sources */, - 40597F1414AB78C80056C533 /* DDAbstractDatabaseLogger.m in Sources */, - 40597F1614AB78C80056C533 /* DDASLLogger.m in Sources */, - 40597F1814AB78C80056C533 /* DDFileLogger.m in Sources */, - 40597F1A14AB78C80056C533 /* DDLog.m in Sources */, - 40597F1C14AB78C80056C533 /* DDTTYLogger.m in Sources */, - 40597F1F14AB78C80056C533 /* HTTPStaticResource.m in Sources */, - 40597F2114AB78C80056C533 /* HTTPVirtualDirectory.m in Sources */, - 409AF58F147BFB3A00554A6E /* NSObject+SBJson.m in Sources */, - 409AF590147BFB3A00554A6E /* SBJsonParser.m in Sources */, - 409AF591147BFB3A00554A6E /* SBJsonStreamParser.m in Sources */, - 409AF592147BFB3A00554A6E /* SBJsonStreamParserAccumulator.m in Sources */, - 409AF593147BFB3A00554A6E /* SBJsonStreamParserAdapter.m in Sources */, - 409AF594147BFB3A00554A6E /* SBJsonStreamParserState.m in Sources */, - 409AF595147BFB3A00554A6E /* SBJsonStreamWriter.m in Sources */, - 409AF596147BFB3A00554A6E /* SBJsonStreamWriterAccumulator.m in Sources */, - 409AF597147BFB3A00554A6E /* SBJsonStreamWriterState.m in Sources */, - 409AF598147BFB3A00554A6E /* SBJsonTokeniser.m in Sources */, - 409AF599147BFB3A00554A6E /* SBJsonUTF8Stream.m in Sources */, - 409AF59A147BFB3A00554A6E /* SBJsonWriter.m in Sources */, - 40BE09AC147715AA0042C6DA /* Status.m in Sources */, - 64084BF412B6C6C90049D2FB /* Database.m in Sources */, - 64084BF512B6C6C90049D2FB /* GeoLocation.m in Sources */, - 64084BF312B6C6A10049D2FB /* Storage.m in Sources */, - 649EDC0610C5986B00E66D06 /* WebDriverPreferences.m in Sources */, - 649EDC0510C5986400E66D06 /* WebDriverRequestFetcher.m in Sources */, - 649EDC0210C5981B00E66D06 /* WebDriverUtilities.m in Sources */, - 839989060EE605910074D106 /* GTMIPhoneUnitTestDelegate.m in Sources */, - 839989070EE605920074D106 /* GTMIPhoneUnitTestMain.m in Sources */, - 839989080EE605930074D106 /* GTMSenTestCase.m in Sources */, - 83998A880EE77F370074D106 /* WebDriverHTTPConnection.m in Sources */, - 83998A890EE77F380074D106 /* HTTPServerController.m in Sources */, - 83998A8B0EE77F440074D106 /* RESTServiceMapping.m in Sources */, - 8316A2120EECE0F700FE869C /* HTTPResponse+Utility.m in Sources */, - 83615D930EEE47940028DAE5 /* ElementStore.m in Sources */, - 8361602D0EF72F190028DAE5 /* HTTPVirtualDirectory+AccessViewController.m in Sources */, - 836160380EF7343B0028DAE5 /* WebDriverResponse.m in Sources */, - 8301250C0EFF044900BA9BE6 /* Session.m in Sources */, - 835DF5D70F00C65600F3DD80 /* WebDriverResource.m in Sources */, - 838B334C0F14254C00F72BC4 /* Session+ExecuteScript.m in Sources */, - 839D645A0F2EB4BB009645BF /* HTTPJSONResponse.m in Sources */, - 17D7163E0FE12CC100CC479E /* HTTPPNGResponse.m in Sources */, - 839D645B0F2EB4BC009645BF /* JSONRESTResource.m in Sources */, - 839D645C0F2EB4C0009645BF /* Attribute.m in Sources */, - 839D645D0F2EB4C3009645BF /* NSException+WebDriver.m in Sources */, - 839D645E0F2EB4CB009645BF /* WebViewController.m in Sources */, - 839D645F0F2EB4CC009645BF /* MainViewController.m in Sources */, - 839D64600F2EB4D0009645BF /* UIResponder+SimulateTouch.m in Sources */, - 64CF265410D190820029D641 /* Cookie.m in Sources */, - 64D8AA441120B94D001649CC /* SessionRoot.m in Sources */, - 64D8AA501120B995001649CC /* NSURLRequest+IgnoreSSL.m in Sources */, - 64D8AA711120B9EC001649CC /* HTTPVirtualDirectory+Remove.m in Sources */, - 649AB343121D114A007FE128 /* Timeouts.m in Sources */, - 64BFFE5812B8367E00FEB710 /* HTTPVirtualDirectory+ExecuteScript.mm in Sources */, - 64BFFF7912B8496E00FEB710 /* HTTPVirtualDirectory+FindElement.mm in Sources */, - 643822F812C032F600F0C7CC /* Element.mm in Sources */, - 64A2262F12C1828000537E73 /* NSData+Base64.m in Sources */, - 648EB1FE137C63B800DEFD44 /* Css.m in Sources */, - 402D0E581652203B00690ED6 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 839989170EE607B10074D106 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 1D6058900D05DD3D006BFB54 /* iWebDriver */; - targetProxy = 839989160EE607B10074D106 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - COCOAHTTPSERVER_HEADERS = "\"$(PROJECT_DIR)/lib/buildtime-src/cocoahttpserver/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/usr/local/include\""; - CODE_SIGN_ENTITLEMENTS = ""; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/objc/iWebDriver_Prefix.pch; - HEADER_SEARCH_PATHS = "$(COCOAHTTPSERVER_HEADERS)/**"; - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/iphoneos.sdk/usr/local/lib\"", - "\"$(SRCROOT)/../CocoaHTTPServer/build/Debug\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = iWebDriver; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = i386; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/objc/iWebDriver_Prefix.pch; - HEADER_SEARCH_PATHS = "$(COCOAHTTPSERVER_HEADERS)/**"; - INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/iphoneos.sdk/usr/local/lib\"", - "\"$(SRCROOT)/../CocoaHTTPServer/build/Debug\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = iWebDriver; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = i386; - }; - name = Release; - }; - 839988E20EE6052E0074D106 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h"; - HEADER_SEARCH_PATHS = "$(COCOAHTTPSERVER_HEADERS)/**"; - INFOPLIST_FILE = "Tests-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../CocoaHTTPServer/build/Debug\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-framework", - CoreLocation, - "-framework", - Foundation, - "-framework", - UIKit, - ); - PREBINDING = NO; - PRODUCT_NAME = Tests; - PROVISIONING_PROFILE = ""; - SDKROOT = iphoneos; - VALID_ARCHS = i386; - }; - name = Debug; - }; - 839988E30EE6052E0074D106 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "Don't Code Sign"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h"; - HEADER_SEARCH_PATHS = "$(COCOAHTTPSERVER_HEADERS)/**"; - INFOPLIST_FILE = "Tests-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../CocoaHTTPServer/build/Debug\"", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-framework", - CoreLocation, - "-framework", - Foundation, - "-framework", - UIKit, - ); - PREBINDING = NO; - PRODUCT_NAME = Tests; - PROVISIONING_PROFILE = ""; - SDKROOT = iphoneos; - VALID_ARCHS = i386; - ZERO_LINK = NO; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; - COCOAHTTPSERVER_HEADERS = "$(PROJECT_DIR)/lib/buildtime-src/cocoahttpserver/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/usr/local/include"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - OBJROOT = "$(SYMROOT)"; - ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = ""; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; - COCOAHTTPSERVER_HEADERS = "$(PROJECT_DIR)/lib/buildtime-src/cocoahttpserver/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/usr/local/include"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - OBJROOT = "$(SYMROOT)"; - ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iWebDriver" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 839988E40EE6052F0074D106 /* Build configuration list for PBXNativeTarget "Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 839988E20EE6052E0074D106 /* Debug */, - 839988E30EE6052E0074D106 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iWebDriver" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/iphone/iphone.iml b/iphone/iphone.iml deleted file mode 100644 index 72a993f1e8988..0000000000000 --- a/iphone/iphone.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/iphone/lib/buildtime-src/cocoahttpserver/README b/iphone/lib/buildtime-src/cocoahttpserver/README deleted file mode 100644 index 9b0431411e970..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/README +++ /dev/null @@ -1,5 +0,0 @@ -CocoaHTTPServer is a project hosted here: http://code.google.com/p/cocoahttpserver/ - -Webdriver iphone uses it to host the REST webserver running on the iphone. - -There is a set of extensions to this project which the webdriver iphone project requires. These are found in the patches in the extensions/ directory. diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPResource.h b/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPResource.h deleted file mode 100644 index 0bc2144766cf5..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPResource.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// HTTPResource.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPResponse.h" - -// An HTTPResource is an element which can respond to queries. It represents -// an element in a virtual subdirectory; eg /foo/bar -@protocol HTTPResource - -// Get the HTTP response to this request -- (id)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData; - -// Fetch the sub-resource for this relative query string. This may be -// recursively called on contents of subdirectories. The query string is -// relative to the reciever; so if the string is empty you should probably -// return self. -- (id)elementWithQuery:(NSString *)query; - -@end diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.h b/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.h deleted file mode 100644 index 89690fd770898..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// HTTPStaticResource.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 Software Freedom Convervancy. -// -// 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 -#import "HTTPResource.h" -#import "HTTPRedirectResponse.h" - -// An HTTPResource which always responds with a particular response. -@interface HTTPStaticResource : NSObject { - HTTPRedirectResponse* response; -} - -@property(nonatomic, retain) HTTPRedirectResponse* response; - -- (id)initWithResponse:(HTTPRedirectResponse*)theResponse; - -+ (HTTPStaticResource *)resourceWithResponse:(HTTPRedirectResponse*)theResponse; - -+ (HTTPStaticResource *)redirectWithURL:(NSString *)url; - -@end diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.m b/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.m deleted file mode 100644 index 34c74f7068632..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPStaticResource.m +++ /dev/null @@ -1,69 +0,0 @@ -// -// HTTPStaticResource.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 Software Freedom Convervancy. -// -// 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 "HTTPStaticResource.h" -#import "HTTPRedirectResponse.h" - -@implementation HTTPStaticResource - -@synthesize response; - -- (id)initWithResponse:(HTTPRedirectResponse*)theResponse -{ - if (![super init]) - return nil; - - [self setResponse:theResponse]; - - return self; -} - -- (void)dealloc -{ - [response release]; - - [super dealloc]; -} - -+ (HTTPStaticResource *)resourceWithResponse:(HTTPRedirectResponse*)theResponse -{ - return [[[self alloc] initWithResponse:theResponse] autorelease]; -} - -+ (HTTPStaticResource *)redirectWithURL:(NSString *)url -{ - return [self resourceWithResponse: - [[HTTPRedirectResponse alloc] initWithPath:url] - ]; -} - -// Get the HTTP response to this request -- (HTTPRedirectResponse*)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData -{ - return response; -} - -- (id)elementWithQuery:(NSString *)query -{ - return self; -} - -@end diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.h b/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.h deleted file mode 100644 index 6530c1b2c2945..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// VirtualDirectory.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 Software Freedom Convervancy. -// -// 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 -#import "HTTPResource.h" - -// A VirtualDirectory represents a particular directory in the URL heirachy. -// It does not need to be mapped by actual files. -@interface HTTPVirtualDirectory : NSObject { - // This maps virtual subdirectory -> HTTPResource element - NSMutableDictionary *contents; - - // The index (or root) element of the directory - id index; - - // If this is set, it redirects /foo/self to /foo/self/ - // If this is not set, /foo/self returns index. - BOOL redirectBaseToIndex; -} - -// The index of the vdir. This will be returnd on .../vdir/ and .../vdir -// You can make this a redirect to index.html or something if you want. -@property (nonatomic, retain) NSObject* index; - -// Do we redirect /foo/self to /foo/self/ or just return index? -@property (nonatomic) BOOL redirectBaseToIndex; - -// Make and return an autoreleased VirtualDirectory -+ (HTTPVirtualDirectory *)virtualDirectory; - -// Set a virtual file in the VirtualDirectory. The resource is retained. -// If resource is nil, this method removes the named resource from the -// VirtualDirectory. -- (void)setResource:(NSObject*)resource withName:(NSString *)name; - -// Remove a resource from the VirtualDirectory. -- (void)removeResourceWithName:(NSString *)name; - -@end diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.m b/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.m deleted file mode 100644 index 28992fad6e0e2..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/HTTPVirtualDirectory.m +++ /dev/null @@ -1,154 +0,0 @@ -// -// VirtualDirectory.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 Software Freedom Convervancy. -// -// 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 "HTTPVirtualDirectory.h" -#import "HTTPStaticResource.h" - -@implementation HTTPVirtualDirectory - -@synthesize index, redirectBaseToIndex; - -- (id)init -{ - if (![super init]) - return nil; - - redirectBaseToIndex = NO; - contents = [[NSMutableDictionary alloc] init]; - - return self; -} - -- (void)dealloc -{ - [contents release]; - [index release]; - [super dealloc]; -} - -+ (HTTPVirtualDirectory *)virtualDirectory -{ - return [[[self alloc] init] autorelease]; -} - -- (void)setResource:(NSObject*)resource withName:(NSString *)name -{ - [contents setValue:resource forKey:name]; -} - -- (void)removeResourceWithName:(NSString *)name -{ - [contents removeObjectForKey:name]; -} - -// Trim leading and trailing '/' characters -+ (NSString *)trimPathSeparatorFrom:(NSString *)query -{ - if ([query isEqualToString:@""]) - return query; - - NSCharacterSet *separators = [NSCharacterSet characterSetWithCharactersInString:@"/"]; - - return [query stringByTrimmingCharactersInSet:separators]; -} - -// Discard everything after the next '/' or '?' character -+ (NSString *)getNextPathElementInQuery:(NSString *)query Remainder:(NSString **)remainder -{ - if ([query isEqualToString:@""]) - { - if (remainder) - *remainder = @""; - return query; - } - - // Discard duplicate '/' characters in the query string to make up for client bugs. - while ([query characterAtIndex:0] == '/') - { - query = [query substringFromIndex:1]; - } - - NSCharacterSet *separators = [NSCharacterSet characterSetWithCharactersInString:@"/?"]; - NSRange range = [query rangeOfCharacterFromSet:separators]; - - if (range.location == NSNotFound) - { - if (remainder) - *remainder = @""; - return query; - } - else - { - if (remainder) - *remainder = [query substringFromIndex:range.location]; - return [query substringToIndex:range.location]; - } -} - -- (id)elementWithQuery:(NSString *)query -{ - // There's no file specified. Return the directory's index - if ([query isEqualToString:@""] - || [query isEqualToString:@"/"]) - { - return index; - } - - NSString *remainder; - NSString *element = [[self class] getNextPathElementInQuery:query - Remainder:&remainder]; - - if ([element isEqualToString:@""]) - { - NSLog(@"Invalid query: %@", query); - return nil; - } - -// NSLog(@"extracting element %@", element); - id resource = [contents objectForKey:element]; - - if ([remainder isEqualToString:@""] - && [resource isKindOfClass:[HTTPVirtualDirectory class]] - && [(HTTPVirtualDirectory*)resource redirectBaseToIndex] == YES) - { - // So at this stage, we've distilled the URL down to the final element. - // If the final element is a directory, we should bounce the client to - // foo/ - which will then send the directory's index. - // Its a bit of a kludge putting it here. - return [HTTPStaticResource redirectWithURL:[NSString stringWithFormat:@"%@/", element]]; - } - else - { - resource = [resource elementWithQuery:remainder]; - } - - return resource; -} - -- (id)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData -{ - // This will recursively find the correct handler for this URL - id resource = [self elementWithQuery:query]; - - return [resource httpResponseForQuery:query method:method withData:theData]; -} - -@end diff --git a/iphone/lib/buildtime-src/cocoahttpserver/extensions/redirect_and_error.patch b/iphone/lib/buildtime-src/cocoahttpserver/extensions/redirect_and_error.patch deleted file mode 100644 index 572e95304cff9..0000000000000 --- a/iphone/lib/buildtime-src/cocoahttpserver/extensions/redirect_and_error.patch +++ /dev/null @@ -1,133 +0,0 @@ -diff -Naur old/HTTPConnection.m new/HTTPConnection.m ---- old/HTTPConnection.m 2009-01-23 09:45:12.000000000 +1100 -+++ new/HTTPConnection.m 2009-01-23 09:51:11.000000000 +1100 -@@ -668,25 +668,60 @@ - return; - } - -- // Check for specific range request -- NSString *rangeHeader = [NSMakeCollectable(CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Range"))) autorelease]; -+ CFHTTPMessageRef response = NULL; - -- BOOL isRangeRequest = NO; -+ BOOL isRedirect = NO; - -- if(rangeHeader) -+ if ([httpResponse respondsToSelector:@selector(redirectURL)]) - { -- if([self parseRangeRequest:rangeHeader withContentLength:contentLength]) -+ NSString *redirectURL = [httpResponse redirectURL]; -+ if (redirectURL != nil) - { -- isRangeRequest = YES; -+ isRedirect = YES; -+ int statusCode = 302; -+ if ([httpResponse respondsToSelector:@selector(redirectStatusCode)]) -+ statusCode = [httpResponse redirectStatusCode]; -+ -+ response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, statusCode, NULL, kCFHTTPVersion1_1); -+ CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Location"), (CFStringRef)redirectURL); - } - } -+ -+ if ([httpResponse respondsToSelector:@selector(isError)] -+ && [httpResponse isError]) -+ { -+ int statusCode = 500; -+ if ([httpResponse respondsToSelector:@selector(errorStatusCode)]) -+ statusCode = [httpResponse errorStatusCode]; -+ response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, statusCode, NULL, kCFHTTPVersion1_1); -+ } - -- CFHTTPMessageRef response; -+ BOOL isRangeRequest = NO; -+ -+ // We do not support range request responses for redirects or errors. -+ // They're really not necessary. -+ if (response == NULL) -+ { -+ // Check for specific range request -+ NSString *rangeHeader = [NSMakeCollectable(CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Range"))) autorelease]; -+ -+ if(rangeHeader) -+ { -+ if([self parseRangeRequest:rangeHeader withContentLength:contentLength]) -+ { -+ isRangeRequest = YES; -+ } -+ } -+ } - - if(!isRangeRequest) - { -- // Status Code 200 - OK -- response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 200, NULL, kCFHTTPVersion1_1); -+ // The response may already be set by a redirect -+ if (response == NULL) -+ { -+ // Status Code 200 - OK -+ response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 200, NULL, kCFHTTPVersion1_1); -+ } - - NSString *contentLengthStr = [NSString stringWithFormat:@"%qu", contentLength]; - CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Length"), (CFStringRef)contentLengthStr); -@@ -705,13 +740,19 @@ - - // If they issue a 'HEAD' command, we don't have to include the file - // If they issue a 'GET' command, we need to include the file -- if([method isEqual:@"HEAD"]) -+ if([method isEqualToString:@"HEAD"]) - { - NSData *responseData = [self preprocessResponse:response]; - [asyncSocket writeData:responseData withTimeout:WRITE_HEAD_TIMEOUT tag:HTTP_RESPONSE]; - } - else - { -+ if ([httpResponse respondsToSelector:@selector(contentType)]) -+ { -+ NSString *contentType = [httpResponse contentType]; -+ CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Type"), (CFStringRef)contentType); -+ } -+ - // Write the header response - NSData *responseData = [self preprocessResponse:response]; - [asyncSocket writeData:responseData withTimeout:WRITE_HEAD_TIMEOUT tag:HTTP_PARTIAL_RESPONSE_HEADER]; -@@ -719,6 +760,9 @@ - // Now we need to send the body of the response - if(!isRangeRequest) - { -+ // Incase an old response is being reused... -+ [httpResponse setOffset:0]; -+ - // Regular request - NSData *data = [httpResponse readDataOfLength:READ_CHUNKSIZE]; - -@@ -1225,7 +1269,7 @@ - - // Check for a Content-Length field - NSString *contentLength = -- [NSMakeCollectable(CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Content-Length"))) autorelease]; -+ [NSMakeCollectable(CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Content-Length"))) autorelease]; - - // Content-Length MUST be present for upload methods (such as POST or PUT) - // and MUST NOT be present for other methods. -diff -Naur old/HTTPResponse.h new/HTTPResponse.h ---- old/HTTPResponse.h 2009-01-16 11:47:48.000000000 +1100 -+++ new/HTTPResponse.h 2009-01-23 09:51:30.000000000 +1100 -@@ -10,6 +10,16 @@ - - - (NSData *)readDataOfLength:(unsigned int)length; - -+@optional -+ -+- (NSString *)redirectURL; -+- (int)redirectStatusCode; -+ -+- (NSString *)contentType; -+ -+- (BOOL)isError; -+- (int)errorStatusCode; -+ - @end - - @interface HTTPFileResponse : NSObject diff --git a/iphone/pom.xml b/iphone/pom.xml deleted file mode 100644 index 18609ae209bd2..0000000000000 --- a/iphone/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - 4.0.0 - - - org.seleniumhq.selenium - selenium-parent - 2.0-SNAPSHOT - - selenium-iphone-driver - selenium-iphone-driver - - - - org.seleniumhq.selenium - selenium-remote-client - ${project.version} - - - - org.seleniumhq.selenium - selenium-common - ${project.version} - tests - test - - - - - src/java - test/java - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*TestSuite.java - - - - - - - diff --git a/iphone/src/Storyboard_iPhone.storyboard b/iphone/src/Storyboard_iPhone.storyboard deleted file mode 100644 index 3af2efe3146e8..0000000000000 --- a/iphone/src/Storyboard_iPhone.storyboard +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/iphone/src/objc/AppDelegate.h b/iphone/src/objc/AppDelegate.h deleted file mode 100644 index 68be671f44063..0000000000000 --- a/iphone/src/objc/AppDelegate.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// AppDelegate.h -// 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/iphone/src/objc/AppDelegate.m b/iphone/src/objc/AppDelegate.m deleted file mode 100644 index 0457df8971d82..0000000000000 --- a/iphone/src/objc/AppDelegate.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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 diff --git a/iphone/src/objc/Attribute.h b/iphone/src/objc/Attribute.h deleted file mode 100644 index ca336e920d0c3..0000000000000 --- a/iphone/src/objc/Attribute.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Attribute.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class Element; - -// This represents the element/:elementId/attribute virtual directory. -@interface Attribute : HTTPVirtualDirectory { - Element *element_; -} - -+ (Attribute *)attributeDirectoryForElement:(Element *)element; - -// Designated initialiser. Does not retain the element as per -// parent retain pattern. -- (id)initForElement:(Element *)element; - -@end - -// This represents the element/:elementId/attribute/:name virtual directory. -// This directory is dynamically added by |Attribute| the first time a request -// is received for |:name|. -@interface NamedAttribute : HTTPVirtualDirectory { - @private - Element* element_; - NSString* name_; -} - -+ (NamedAttribute *)namedAttributeDirectoryForElement:(Element *)element - andName:(NSString *)name; -- (id)initForElement:(Element *)element - andName:(NSString *)name; - -- (id)getAttribute; - -@end diff --git a/iphone/src/objc/Attribute.m b/iphone/src/objc/Attribute.m deleted file mode 100644 index 9a8613ff43914..0000000000000 --- a/iphone/src/objc/Attribute.m +++ /dev/null @@ -1,92 +0,0 @@ -// -// Attribute.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "Attribute.h" -#import "WebDriverResource.h" -#import "Element.h" -#import "WebDriverResponse.h" -#import "HTTPVirtualDirectory+ExecuteScript.h" -#import "HTTPStaticResource.h" - -@implementation Attribute - -- (id)initForElement:(Element *)element { - if (![super init]) - return nil; - - // Not retained as per delegate pattern - avoids circular dependancies. - element_ = element; - - return self; -} - -+ (Attribute *)attributeDirectoryForElement:(Element *)element { - return [[[Attribute alloc] initForElement:element] autorelease]; -} - -- (id)elementWithQuery:(NSString *)query { - if ([query length] > 0) { - NSString *queriedAttribute = [query substringFromIndex:1]; - id resource = [contents objectForKey:queriedAttribute]; - if (resource == nil) { - resource = [NamedAttribute - namedAttributeDirectoryForElement:element_ - andName:queriedAttribute]; - [self setResource:resource withName:queriedAttribute]; - } - } - // Need to delegate back to |super| so |Session| can set the session ID on - // the response. - return [super elementWithQuery:query]; -} - -@end - -@implementation NamedAttribute - -- (id) initForElement:(Element *)element - andName:(NSString *)name { - if (![super init]) { - return nil; - } - // Not retained as per delegate pattern - avoids circular dependancies. - element_ = element; - name_ = name; - - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getAttribute) - POSTAction:NULL - PUTAction:NULL - DELETEAction:NULL]]; - return self; -} - -+ (NamedAttribute *)namedAttributeDirectoryForElement:(Element *)element - andName:(NSString *)name { - return [[[NamedAttribute alloc] initForElement:element andName:name] - autorelease]; -} - -- (id)getAttribute { - return [element_ attribute:name_]; -} - -@end - - diff --git a/iphone/src/objc/COPYING b/iphone/src/objc/COPYING deleted file mode 100644 index 261eeb9e9f8b2..0000000000000 --- a/iphone/src/objc/COPYING +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/iphone/src/objc/Classes/MainView.h b/iphone/src/objc/Classes/MainView.h deleted file mode 100644 index 0529026ae9631..0000000000000 --- a/iphone/src/objc/Classes/MainView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// MainView.h -// iWebDriver -// -// Created by Joseph Gentle on 11/27/08. -// Copyright __MyCompanyName__ 2008. All rights reserved. -// - -#import - -@interface MainView : UIView { - -} - -@end diff --git a/iphone/src/objc/Classes/MainView.m b/iphone/src/objc/Classes/MainView.m deleted file mode 100644 index 6682a000e47a9..0000000000000 --- a/iphone/src/objc/Classes/MainView.m +++ /dev/null @@ -1,32 +0,0 @@ -// -// MainView.m -// iWebDriver -// -// Created by Joseph Gentle on 11/27/08. -// Copyright __MyCompanyName__ 2008. All rights reserved. -// - -#import "MainView.h" - -@implementation MainView - - -- (id)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - // Initialization code - } - return self; -} - - -- (void)drawRect:(CGRect)rect { - // Drawing code -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/iphone/src/objc/Classes/MainViewController.h b/iphone/src/objc/Classes/MainViewController.h deleted file mode 100644 index 7c65d001aa450..0000000000000 --- a/iphone/src/objc/Classes/MainViewController.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// MainViewController.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "WebViewController.h" - -// |MainViewController| is the |UIViewController| responsible for the main -// view. The view contains a |UIWebView and a |UILabel| for status display. -// The class is singleton. The singleton instance can be accessed with -// [MainViewController sharedInstance]; -// The UI element definitions are contained in MainView.xib. -@interface MainViewController : UIViewController { - 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; - -// Access the singleton object. -+ (MainViewController *)sharedInstance; - -@end diff --git a/iphone/src/objc/Classes/MainViewController.m b/iphone/src/objc/Classes/MainViewController.m deleted file mode 100644 index f8c03a029fa5b..0000000000000 --- a/iphone/src/objc/Classes/MainViewController.m +++ /dev/null @@ -1,74 +0,0 @@ -// -// MainViewController.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "MainViewController.h" -#import "MainView.h" -#import "HTTPServerController.h" - -static MainViewController *singleton_; - -@implementation MainViewController - -@synthesize webView; -@synthesize webViewController; - -- (void)viewDidLoad { - [super viewDidLoad]; - singleton_ = self; - [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. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // We support orientation changes. - return YES; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -- (void)dealloc { - [webView release]; - [webViewController dealloc]; - [super dealloc]; -} - -- (void)describeLastAction:(NSString *)status { - [statusLabel_ setText:status]; -} - -+ (MainViewController *)sharedInstance { - return singleton_; -} - -- (void)viewDidUnload { - [webView release]; - webView = nil; - [super viewDidUnload]; -} -@end diff --git a/iphone/src/objc/Cookie.h b/iphone/src/objc/Cookie.h deleted file mode 100644 index 84189490814d9..0000000000000 --- a/iphone/src/objc/Cookie.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// Cookie.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class WebDriverResponse; - -// This |HTTPVirtualDirectory| matches the /hub/:session/cookie -// directory in the WebDriver REST service. -@interface Cookie : HTTPVirtualDirectory { -} - -- (NSURL *)currentUrl; -- (NSArray *)getCookies; -- (void)addCookie:(NSDictionary *)cookie; -- (void)deleteAllCookies; - -@end - -// This |HTTPVirtualDirectory| matches the /hub/:session/cookie/:name directory -// in the WebDriver REST service. -@interface NamedCookie : HTTPVirtualDirectory { - @private - NSString* name_; -} - -+ (NamedCookie *)namedCookie:(NSString *)name; - -- (id)initWithName:(NSString *)name; - -- (NSDictionary *)getCookie; - -- (void)deleteCookie; - -@end diff --git a/iphone/src/objc/Cookie.m b/iphone/src/objc/Cookie.m deleted file mode 100644 index a37849705d19e..0000000000000 --- a/iphone/src/objc/Cookie.m +++ /dev/null @@ -1,210 +0,0 @@ -// -// Cookie.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "Cookie.h" -#import "HTTPStaticResource.h" -#import "HTTPVirtualDirectory+AccessViewController.h" -#import "NSException+WebDriver.h" -#import "NSObject+SBJson.h" -#import "WebDriverResource.h" -#import "WebDriverResponse.h" -#import "WebViewController.h" -#import "errorcodes.h" - -@implementation Cookie - -- (id) init { - self = [super init]; - if (!self) { - return nil; - } - - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getCookies) - POSTAction:@selector(addCookie:) - PUTAction:NULL - DELETEAction:@selector(deleteAllCookies)]]; - - return self; -} - - -- (NSURL *)currentUrl { - return [NSURL URLWithString:[[self viewController] URL]]; -} - -- (void) deleteAllCookies { - NSHTTPCookieStorage* cookieStorage = - [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSArray* theCookies = [cookieStorage cookiesForURL:[self currentUrl]]; - for (NSHTTPCookie *cookie in theCookies) { - [cookieStorage deleteCookie:cookie]; - } -} - -- (NSArray*) getCookies { - NSHTTPCookieStorage* cookieStorage = - [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSArray* theCookies = [cookieStorage cookiesForURL:[self currentUrl]]; - NSMutableArray* toReturn = [NSMutableArray arrayWithCapacity: - [theCookies count]]; - for (NSHTTPCookie *cookie in theCookies) { - NSMutableDictionary* cookieDict = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - [cookie name], @"name", - [cookie value], @"value", - [cookie domain], @"domain", - [cookie path], @"path", - [NSNumber numberWithBool:[cookie isSecure]], @"secure", - nil]; - - NSDate* expires = [cookie expiresDate]; - if ([expires isKindOfClass:[NSDate class]]) { - NSNumber* expiry = - [NSNumber numberWithLong:[expires timeIntervalSince1970]]; - [cookieDict setObject:expiry forKey:@"expiry"]; - } - [toReturn addObject:cookieDict]; - } - return toReturn; -} - -- (void)addCookie:(NSDictionary *)cookie { - cookie = [cookie objectForKey:@"cookie"]; - NSURL* currentUrl = [self currentUrl]; - NSString* domain = [cookie objectForKey:@"domain"]; - if (domain == (id)[NSNull null] || domain.length == 0) { - domain = [currentUrl host]; - } else { - // Strip off the port if the domain has one. - domain = [[domain componentsSeparatedByString:@":"] objectAtIndex:0]; - if (![[currentUrl host] hasSuffix:domain]) { - @throw [NSException webDriverExceptionWithMessage: - [NSString stringWithFormat: - @"You may only set cookies for the current domain:" - " Expected <%@>, but was <%@>", [currentUrl host], domain] - andStatusCode:EINVALIDCOOKIEDOMAIN]; - } - } - - NSString* path = [cookie objectForKey:@"path"]; - if (path == (id)[NSNull null] || path.length == 0) { - path = @"/"; - } - // We need to convert the cookie data from the format used by WebDriver to one - // recognized by the NSHTTPCookie class. - NSMutableDictionary* cookieProperties = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - [cookie objectForKey:@"name"], NSHTTPCookieName, - [cookie objectForKey:@"value"], NSHTTPCookieValue, - domain, NSHTTPCookieDomain, - path, NSHTTPCookiePath, - nil]; - - NSNumber* expires = [cookie objectForKey:@"expiry"]; - if ([expires isKindOfClass:[NSNumber class]]) { - NSDate* expiresDate = - [NSDate dateWithTimeIntervalSince1970:[expires doubleValue]]; - [cookieProperties setObject:expiresDate forKey:NSHTTPCookieExpires]; - } - - NSNumber* secure = [cookie objectForKey:@"secure"]; - if ([secure boolValue] == YES) { - [cookieProperties setObject:@"true" forKey:NSHTTPCookieSecure]; - } - - NSArray *cookieToAdd = [NSArray arrayWithObject: - [NSHTTPCookie cookieWithProperties:cookieProperties]]; - [[NSHTTPCookieStorage sharedHTTPCookieStorage] - setCookies:cookieToAdd forURL:currentUrl mainDocumentURL:nil]; -} - -- (id)elementWithQuery:(NSString *)query { - if ([query length] > 0) { - NSString *cookieName = [query substringFromIndex:1]; - id resource = [contents objectForKey:cookieName]; - if (resource == nil) { - [self setResource:[NamedCookie namedCookie:cookieName] - withName:cookieName]; - } - } - return [super elementWithQuery:query]; -} - -@end - -@implementation NamedCookie - -- (id)initWithName:(NSString *)name { - if (![super init]) { - return nil; - } - name_ = name; - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getCookie) - POSTAction:NULL - PUTAction:NULL - DELETEAction:@selector(deleteCookie)]]; - return self; -} - -+ (NamedCookie *)namedCookie:(NSString *)name { - return [[[NamedCookie alloc] initWithName:name] autorelease]; -} - -- (NSDictionary *)getCookie { - NSHTTPCookieStorage* cookieStorage = - [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSURL* currentUrl = [NSURL URLWithString:[[self viewController] URL]]; - NSArray* theCookies = [cookieStorage cookiesForURL:currentUrl]; - for (NSHTTPCookie *cookie in theCookies) { - if ([[cookie name] isEqualToString:name_]) { - NSMutableDictionary* cookieDict = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - [cookie name], @"name", - [cookie value], @"value", - [cookie domain], @"domain", - [cookie path], @"path", - [NSNumber numberWithBool:[cookie isSecure]], @"secure", - nil]; - NSDate* expires = [cookie expiresDate]; - if ([expires isKindOfClass:[NSDate class]]) { - [cookieDict setObject:[expires description] forKey:@"expires"]; - } - return cookieDict; - } - } - return nil; -} - -- (void)deleteCookie { - NSHTTPCookieStorage* cookieStorage = - [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSURL* currentUrl = [NSURL URLWithString:[[self viewController] URL]]; - NSArray* theCookies = [cookieStorage cookiesForURL:currentUrl]; - for (NSHTTPCookie *cookie in theCookies) { - if ([[cookie name] isEqualToString:name_]) { - [cookieStorage deleteCookie:cookie]; - break; - } - } -} - -@end diff --git a/iphone/src/objc/Css.h b/iphone/src/objc/Css.h deleted file mode 100644 index 038470973a7f9..0000000000000 --- a/iphone/src/objc/Css.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Css.h -// iWebDriver -// -// Copyright 2011 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class Element; - -// This represents the element/:elementId/css virtual directory. -@interface Css : HTTPVirtualDirectory { - Element *element_; -} - -+ (Css *)cssDirectoryForElement:(Element *)element; - -// Designated initialiser. Does not retain the element as per -// parent retain pattern. -- (id)initForElement:(Element *)element; - -@end - -// This represents the element/:elementId/css/:name virtual directory. -// This directory is dynamically added by |Css| the first time a request -// is received for |:name|. -@interface NamedCssProperty : HTTPVirtualDirectory { - @private - Element* element_; - NSString* name_; -} - -+ (NamedCssProperty *)namedCssPropertyDirectoryForElement:(Element *)element - andName:(NSString *)name; -- (id)initForElement:(Element *)element - andName:(NSString *)name; - -- (NSString*)getProperty; - -@end diff --git a/iphone/src/objc/Css.m b/iphone/src/objc/Css.m deleted file mode 100644 index 8cb4f2b9d3e46..0000000000000 --- a/iphone/src/objc/Css.m +++ /dev/null @@ -1,93 +0,0 @@ -// -// Css.m -// iWebDriver -// -// Copyright 2011 Google Inc. -// -// 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 "Css.h" -#import "WebDriverResource.h" -#import "Element.h" -#import "WebDriverResponse.h" -#import "HTTPVirtualDirectory+ExecuteScript.h" -#import "HTTPStaticResource.h" -#import "WebViewController.h" - -@implementation Css - -- (id)initForElement:(Element *)element { - if (![super init]) - return nil; - - // Not retained as per delegate pattern - avoids circular dependancies. - element_ = element; - - return self; -} - -+ (Css *)cssDirectoryForElement:(Element *)element { - return [[[Css alloc] initForElement:element] autorelease]; -} - -- (id)elementWithQuery:(NSString *)query { - if ([query length] > 0) { - NSString *queriedAttribute = [query substringFromIndex:1]; - id resource = [contents objectForKey:queriedAttribute]; - if (resource == nil) { - resource = [NamedCssProperty - namedCssPropertyDirectoryForElement:element_ - andName:queriedAttribute]; - [self setResource:resource withName:queriedAttribute]; - } - } - // Need to delegate back to |super| so |Session| can set the session ID on - // the response. - return [super elementWithQuery:query]; -} - -@end - -@implementation NamedCssProperty - -- (id) initForElement:(Element *)element - andName:(NSString *)name { - if (![super init]) { - return nil; - } - // Not retained as per delegate pattern - avoids circular dependancies. - element_ = element; - name_ = name; - - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getProperty) - POSTAction:NULL - PUTAction:NULL - DELETEAction:NULL]]; - return self; -} - -+ (NamedCssProperty *)namedCssPropertyDirectoryForElement:(Element *)element - andName:(NSString *)name { - return [[[NamedCssProperty alloc] initForElement:element andName:name] - autorelease]; -} - -- (NSString*)getProperty { - return [element_ css:name_]; -} - -@end - - diff --git a/iphone/src/objc/Database.h b/iphone/src/objc/Database.h deleted file mode 100644 index 034c15daebb89..0000000000000 --- a/iphone/src/objc/Database.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - Copyright 2011 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 -#import "HTTPVirtualDirectory.h" -#import - -@interface Database : HTTPVirtualDirectory { -} - -- (NSDictionary *)executeSql:(NSDictionary *)dict; - -@end diff --git a/iphone/src/objc/Database.m b/iphone/src/objc/Database.m deleted file mode 100644 index 8efe123964c3d..0000000000000 --- a/iphone/src/objc/Database.m +++ /dev/null @@ -1,237 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - - 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 "Database.h" -#import "NSException+WebDriver.h" -#import "WebDriverResource.h" -#import "HTTPVirtualDirectory+AccessViewController.h" -#import "errorcodes.h" - -static const NSString* kQueryDicKey = @"query"; -static const NSString* kQueryArgsDicKey = @"args"; -static const NSString* kQueryDatabaseDicKey = @"dbName"; - -@implementation Database - -- (id)init { - self = [super init]; - if (!self) { - return nil; - } - - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(executeSql:) - PUTAction:NULL - DELETEAction:NULL]]; - return self; -} - - -// Get HTML5 database path + db name from local db path -// return autoreleased object. -// dbInfo contains 'html5 database name', 'db version', 'db display name' string -- (NSString *)getDatabasePath:(NSString *)dbInfo { - NSArray* dbInfoItems = [dbInfo componentsSeparatedByString:@","]; - NSString* name = [dbInfoItems objectAtIndex:0]; - NSString* displayName = [dbInfoItems objectAtIndex:2]; - - sqlite3 *database = NULL; - NSString *path = @""; - if ([NSHomeDirectory() length] > 0) { - NSString *databasePath = [NSHomeDirectory() stringByAppendingPathComponent: - @"Library/WebKit/Databases/Databases.db"]; - // Open the database from the users file system - if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { - NSString *sqlStatement = [NSString stringWithFormat: - @"select * from Databases where" - " name=%@ and displayName=%@;", - name, displayName]; - const char* cSqlStatement = [sqlStatement // get query as char * - cStringUsingEncoding:NSUTF8StringEncoding]; - sqlite3_stmt *compiledStatement = NULL; - if (sqlite3_prepare_v2(database, cSqlStatement, -1, &compiledStatement, - NULL) == SQLITE_OK) { - while (sqlite3_step(compiledStatement) == SQLITE_ROW) { - NSString *dbSubDir = [NSString stringWithUTF8String:(char *) - sqlite3_column_text(compiledStatement, 1)]; - NSString *dbName = [NSString stringWithUTF8String:(char *) - sqlite3_column_text(compiledStatement, 5)]; - NSString *dbNameAndPartPath = [NSString stringWithFormat: - @"Library/WebKit/Databases/%@/%@", - dbSubDir, dbName]; - path = [[[NSHomeDirectory() stringByAppendingPathComponent: - dbNameAndPartPath] copy] autorelease]; - break; - } - if (compiledStatement) { - sqlite3_finalize(compiledStatement); - } - } - if (database) { - sqlite3_close(database); - } - } - } - return path; -} - -// Bind arguments to SQL query. We support numeric and text arguments -// it does not support BLOB and VVV. if there is ? argument, we try to -// pass it as text. -// if we detect error we thow an exception. -- (NSString *)bindArgumentsToQuery:(sqlite3_stmt *)statement - arguments:(NSArray *)args{ - NSString *result = @""; - if (sqlite3_bind_parameter_count(statement) != [args count]) { - result = @"Bind parameter count doesn't match number of question marks"; - return result; - } - for (unsigned i = 1; i <= [args count]; ++i) { - const char *cBindName = sqlite3_bind_parameter_name(statement, i); - NSString* argument = [args objectAtIndex:i - 1]; - int bindResult = SQLITE_ERROR; - // We support only numeric and text arguments at this momemnt. - if (cBindName == "?NNN") { // numeric - NSScanner *sc = [NSScanner scannerWithString:argument]; - if ([sc scanDouble:NULL]) { // double argument - double argumentAsDouble = [argument doubleValue]; - bindResult = sqlite3_bind_double(statement, i, argumentAsDouble); - } else { // integer argument - if ([sc scanInt:NULL]) { - int argumentInt = [argument intValue]; - bindResult = sqlite3_bind_double(statement, i, argumentInt); - } - } - } else { // "?" without a following integer have no name and are - // also referred to as "anonymous parameters - const char* cArgument = [argument cStringUsingEncoding: - NSUTF8StringEncoding]; - bindResult = sqlite3_bind_text(statement, i, cArgument, -1, - SQLITE_TRANSIENT); - } - if (bindResult != SQLITE_OK) { - result = [[[NSString stringWithFormat: - @"Failed to bind value index %i to statement'", i] copy] - autorelease]; - } - } - return result; -} - -- (NSMutableArray *)retrieveRows:(sqlite3_stmt *)statement { - NSMutableArray *rows = [NSMutableArray array]; - while(sqlite3_step(statement) == SQLITE_ROW) { - int columnCount = sqlite3_data_count(statement); - NSMutableDictionary *record = [NSMutableDictionary dictionary]; - - for(int i = 0; i < columnCount; i++) { - int columnType = sqlite3_column_type(statement, i); - const char *cColumnName = sqlite3_column_name(statement, i); - NSString *columnNameAsKey = [NSString stringWithUTF8String: - cColumnName]; - switch (columnType) { - case SQLITE_INTEGER: { - NSNumber *value = [NSNumber numberWithInt: - sqlite3_column_int(statement, i)]; - [record setObject:value forKey:columnNameAsKey]; - } break; - case SQLITE_FLOAT: { - NSNumber *value = [NSNumber numberWithFloat: - sqlite3_column_double(statement, i)]; - [record setObject:value forKey:columnNameAsKey]; - } break; - case SQLITE3_TEXT: { - NSString *value = [NSString stringWithUTF8String:(char *) - sqlite3_column_text(statement, i)]; - [record setObject:value forKey:columnNameAsKey]; - } break; - default: { - // return nil string for unsupported type - [record setObject:@"" forKey:columnNameAsKey]; - } - break; - } //end of switch - } // end of columns loop - [rows addObject:record]; - } // end of record loop - return rows; -} - -- (NSDictionary *)executeSql:(NSDictionary *)dict { - NSString *query = [dict objectForKey:kQueryDicKey]; - NSArray *arguments = [dict objectForKey:kQueryArgsDicKey]; // query arguments - NSString *dbInfo = [dict objectForKey:kQueryDatabaseDicKey]; - NSString *dbPathAndName = [self getDatabasePath:dbInfo]; - - NSMutableDictionary *resultSet; - sqlite3 *database = NULL; - - if ([dbPathAndName length] > 0) { - // Open the database from the users file system - if(sqlite3_open([dbPathAndName UTF8String], &database) == SQLITE_OK) { - const char* cSqlStatement = [query cStringUsingEncoding: - NSUTF8StringEncoding]; - sqlite3_stmt *statement = NULL; - if(sqlite3_prepare_v2(database, cSqlStatement, -1, &statement, - NULL) == SQLITE_OK) { - NSString *msgResult = [self bindArgumentsToQuery:statement - arguments:arguments]; - if ([msgResult length] > 0) { // could not bind args, throw except-n - if (statement) sqlite3_finalize(statement); - if (database) sqlite3_close(database); - @throw [NSException webDriverExceptionWithMessage:msgResult - andStatusCode:EUNHANDLEDERROR]; - } - - NSMutableArray *rows = [self retrieveRows:statement]; - - int lastInsertedRowId = sqlite3_last_insert_rowid(database); - int rowsAffected = sqlite3_changes(database); - - if (lastInsertedRowId == 0) { - lastInsertedRowId = -1; - } - - resultSet = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:lastInsertedRowId], @"insertId", - [NSNumber numberWithInt:rowsAffected], @"rowsAffected", - rows, @"rows", - nil]; - - if (statement) { - sqlite3_finalize(statement); - } - } // end of prepare sql request - } else { // end of process html5 db - NSString *message = @"Could not find HTML5 database, check name and display name."; - @throw [NSException webDriverExceptionWithMessage:message - andStatusCode:EUNHANDLEDERROR]; - } - } else { - NSString *message = @"Could not find local Database.db."; - @throw [NSException webDriverExceptionWithMessage:message - andStatusCode:EUNHANDLEDERROR]; - } - if (database) { - sqlite3_close(database); - } - return resultSet; -} - -@end diff --git a/iphone/src/objc/Element.h b/iphone/src/objc/Element.h deleted file mode 100644 index 6a2bebef62a9d..0000000000000 --- a/iphone/src/objc/Element.h +++ /dev/null @@ -1,137 +0,0 @@ -// -// Element.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class Session; - -// This represents a web element accessible via :session/element/X where X is an -// opaque ID assigned by the server when the element is first located on the -// page. -@interface Element : HTTPVirtualDirectory { - @private - // The opaque ID assigned by the server. - NSString* elementId_; - Session* session_; -} - -@property (nonatomic, readonly, copy) NSString *elementId; -@property (nonatomic, readonly, retain) Session *session; - -// Designated initializer. Don't call this directly - instead -// use |elementWithId|. -- (id)initWithId:(NSString*)elementId - andSession:(Session*)session; - -// Create a new element. -+ (Element*)elementWithId:(NSString*)elementId - andSession:(Session*)session; - -// Get the JSON dictionary with this element's ID for transmission -// over the wire: |{"ELEMENT": "elementId"}|. -- (NSDictionary *)idDictionary; - -// Locates the first element under this element that matches the given |query|. -// The |query| must have two keys: -// @li "using" - The locator strategy to use. -// @li "value" - The value to search for using the strategy. -// Returns the JSON representation of the located element. --(NSDictionary*) findElement:(NSDictionary*)query; - -// Locates every element on under this element matching the given |query|. -// The |query| must have two keys: -// @li "using" - The locator strategy to use. -// @li "value" - The value to search for using the strategy. -// Returns an array of elements in their JSON representation. --(NSArray*) findElements:(NSDictionary*)query; - -// Simulate a click on the element. -// Dictionary parameters are passed in by REST service, but are redundant -// with directory ID and are thus ignored. -- (void)click:(NSDictionary*)ignored; - -// Clear the contents of this input field. -// Dictionary parameters are passed in by REST service, but are redundant -// with directory ID and are thus ignored. -- (void)clear:(NSDictionary*)ignored; - -// Submit this form, or the form containing this element. -// Dictionary parameters are passed in by REST service, but are redundant -// with directory ID and are thus ignored. -- (void)submit:(NSDictionary*)ignored; - -// The text contained in the element. -- (NSString *)text; - -// Type these keys into the element. -// Dictionary parameters are passed in by REST service, but are redundant -// with directory ID and are thus ignored. -- (void)sendKeys:(NSDictionary *)dict; - -// Is the element checked? -// This method is only valid on checkboxes and radio buttons. -- (NSNumber *)isChecked; - -// Is the element enabled? -- (NSNumber *)isEnabled; - -// Is the element displayed on the screen? -- (NSNumber *)isDisplayed; - -// Get the attribute with the given name. -- (id)attribute:(NSString *)attributeName; - -// Get the effective CSS property with the given name. -- (NSString*)css:(NSString*)property; - -// Get the tag name of this element, not the value of the name attribute: -// will return "input" for the element -- (NSString *)name; - -@end - - -// Directory acts as a bridge, creating subdirectories on demand to handle -// requests to /session/:id/element/:elementId/equals/:other. -@interface ElementComparatorBridge : HTTPVirtualDirectory { - @private - Element* element_; -} - -@property (nonatomic, readonly, retain) Element* element; - -+ (ElementComparatorBridge*) comparatorBridgeFor:(Element*)element; -- (id) initFor:(Element*)element; - -@end - -// Temporary directory that handles element equality comparisons. -@interface ElementComparator : HTTPVirtualDirectory { - @private - ElementComparatorBridge* parentDirectory_; - NSDictionary* otherElementId_; -} - -- (id) initFor:(ElementComparatorBridge*)parentDirectory - compareWith:(NSDictionary*)otherElementId; - -- (id) compareElements; - -@end - diff --git a/iphone/src/objc/Element.mm b/iphone/src/objc/Element.mm deleted file mode 100644 index 879f4732c17e0..0000000000000 --- a/iphone/src/objc/Element.mm +++ /dev/null @@ -1,369 +0,0 @@ -// -// Element.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "Element.h" -#import "JSONRESTResource.h" -#import "HTTPRedirectResponse.h" -#import "ElementStore.h" -#import "WebDriverResource.h" -#import "HTTPVirtualDirectory+ExecuteScript.h" -#import "HTTPVirtualDirectory+FindElement.h" -#import "Attribute.h" -#import "Css.h" -#import "MainViewController.h" -#import "WebViewController.h" -#import "NSObject+SBJson.h" -#import "NSException+WebDriver.h" -#import "Session.h" -#include "atoms.h" -#import "errorcodes.h" - -static NSString* const kElementIdKey = @"ELEMENT"; - -@implementation Element - -@synthesize elementId = elementId_; -@synthesize session = session_; - -- (id)initWithId:(NSString *)elementId - andSession:(Session*)session { - if (![super init]) { - return nil; - } - - elementId_ = [elementId copy]; - session_ = session; - - [self setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(findElement:)] - withName:@"element"]; - - [self setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(findElements:)] - withName:@"elements"]; - - [self setMyWebDriverHandlerWithGETAction:NULL - POSTAction:@selector(click:) - withName:@"click"]; -// [self setMyWebDriverHandlerWithGETAction:NULL -// POSTAction:@selector(clickSimulate:) -// withName:@"click"]; - - [self setMyWebDriverHandlerWithGETAction:NULL - POSTAction:@selector(clear:) - withName:@"clear"]; - - [self setMyWebDriverHandlerWithGETAction:NULL - POSTAction:@selector(submit:) - withName:@"submit"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(text) - POSTAction:NULL - withName:@"text"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(value) - POSTAction:@selector(sendKeys:) - withName:@"value"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(isChecked) - POSTAction:@selector(setChecked:) - withName:@"selected"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(isEnabled) - POSTAction:NULL - withName:@"enabled"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(isDisplayed) - POSTAction:NULL - withName:@"displayed"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(locationAsDictionary) - POSTAction:NULL - withName:@"location"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(sizeAsDictionary) - POSTAction:NULL - withName:@"size"]; - - [self setMyWebDriverHandlerWithGETAction:@selector(name) - POSTAction:NULL - withName:@"name"]; - - [self setResource:[Attribute attributeDirectoryForElement:self] - withName:@"attribute"]; - - [self setResource:[Css cssDirectoryForElement:self] - withName:@"css"]; - - [self setResource:[ElementComparatorBridge comparatorBridgeFor:self] - withName:@"equals"]; - - return self; -} - -- (void)dealloc { - [elementId_ release]; - [super dealloc]; -} - -+ (Element *)elementWithId:(NSString *)elementId - andSession:(Session*)session { - return [[[Element alloc] initWithId:elementId - andSession:session] autorelease]; -} - -- (NSDictionary *)idDictionary { - return [NSDictionary dictionaryWithObjectsAndKeys: - [self elementId], kElementIdKey, - nil]; -} - -#pragma mark Webdriver methods - --(NSDictionary*) findElement:(NSDictionary*)query { - return [self findElement:query - root:[self idDictionary] - implicitlyWait:[session_ implicitWait]]; -} - --(NSArray*) findElements:(NSDictionary*)query { - return [self findElements:query - root:[self idDictionary] - implicitlyWait:[session_ implicitWait]]; -} - -- (void)click:(NSDictionary*)ignored { - [self executeAtom:webdriver::atoms::CLICK - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -// This returns the pixel position of the element on the page in page -// coordinates. -- (CGPoint)location { - NSDictionary* result = (NSDictionary*) - [self executeAtom:webdriver::atoms::GET_LOCATION - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; - - NSNumber* x = [result objectForKey:@"x"]; - NSNumber* y = [result objectForKey:@"y"]; - - return CGPointMake([x floatValue], [y floatValue]); -} - -// Fetches the size of the element in page coordinates. -- (CGSize)size { - NSDictionary* result = (NSDictionary*) [self - executeJsFunction:@"function(){return {width:arguments[0].offsetWidth," - "height:arguments[0].offsetHeight};}" - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; - - NSNumber* width = [result objectForKey:@"width"]; - NSNumber* height = [result objectForKey:@"height"]; - - return CGSizeMake([width floatValue], [height floatValue]); -} - -// Fetches the bounds of the element in page coordinates. This is built from -// |size| and |location|. -- (CGRect)bounds { - CGRect bounds; - bounds.origin = [self location]; - bounds.size = [self size]; - return bounds; -} - -- (void)clickSimulate:(NSDictionary *)dict { - CGRect currentPosition = [self bounds]; - CGPoint midpoint = CGPointMake(CGRectGetMidX(currentPosition), - CGRectGetMidY(currentPosition)); - [[[MainViewController sharedInstance] webViewController] - clickOnPageElementAt:midpoint]; -} - -- (void)clear:(NSDictionary*)ignored { - [self executeAtom:webdriver::atoms::CLEAR - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (void)submit:(NSDictionary*)ignored { - [self executeAtom:webdriver::atoms::SUBMIT - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (NSString *)text { - return (NSString*) [self - executeAtom:webdriver::atoms::GET_TEXT - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (void)sendKeys:(NSDictionary *)dict { - NSString* stringToType = - [[dict objectForKey:@"value"] componentsJoinedByString:@""]; - [self executeAtom:webdriver::atoms::TYPE - withArgs:[NSArray arrayWithObjects:[self idDictionary], - stringToType, nil]]; -} - -- (NSString *)value { - return (NSString*) [self - executeJsFunction:@"function(){return arguments[0].value;}" - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -// This method is only valid on option elements, checkboxes and radio buttons. -- (NSNumber *)isChecked { - return (NSNumber*) [self - executeAtom:webdriver::atoms::IS_SELECTED - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (NSNumber *)isEnabled { - return (NSNumber*) [self - executeAtom:webdriver::atoms::IS_ENABLED - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (NSNumber *)isDisplayed { - return (NSNumber*) [self - executeAtom:webdriver::atoms::IS_DISPLAYED - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; -} - -- (NSDictionary *)locationAsDictionary { - CGPoint location = [self location]; - return [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat:location.x], @"x", - [NSNumber numberWithFloat:location.y], @"y", - nil]; -} - -- (NSDictionary *)sizeAsDictionary { - CGSize size = [self size]; - return [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat:size.width], @"width", - [NSNumber numberWithFloat:size.height], @"height", - nil]; -} - -// Get an attribute with the given name. --(id) attribute:(NSString *)name { - return [self executeAtom:webdriver::atoms::GET_ATTRIBUTE - withArgs:[NSArray arrayWithObjects: - [self idDictionary], name, nil]]; -} - --(NSString *) css:(NSString *)property { - return [self executeAtom:webdriver::atoms::GET_EFFECTIVE_STYLE - withArgs:[NSArray arrayWithObjects: - [self idDictionary], property, nil]]; -} - -// Get the tag name of this element, not the value of the name attribute: -// will return "input" for the element -- (NSString *)name { - NSString* name = [self - executeJsFunction:@"function(){return arguments[0].tagName;}" - withArgs:[NSArray arrayWithObject:[self idDictionary]]]; - return [name lowercaseString]; -} - -@end - -@implementation ElementComparatorBridge - -@synthesize element = element_; - -- (id) initFor:(Element*)element { - if (![super init]) { - return nil; - } - element_ = element; - return self; -} - -+ (ElementComparatorBridge*) comparatorBridgeFor:(Element*)element { - return [[[ElementComparatorBridge alloc] initFor:element] autorelease]; -} - -// Configures a temporary directory to handle /element/:elementId/equals/:other. -// The directory will remove itself after a singel request. -- (id)elementWithQuery:(NSString *)query { - if ([query length] > 0) { - NSString* otherId = [query substringFromIndex:1]; - id resource = [contents objectForKey:otherId]; - if (resource == nil) { - NSLog(@"Adding comparator for element %@", otherId); - NSDictionary* idDict = [NSDictionary dictionaryWithObject:otherId - forKey:kElementIdKey]; - resource = [[ElementComparator alloc] initFor:self - compareWith:idDict]; - [resource autorelease]; - } - } - return [super elementWithQuery:query]; -} - -@end - -@implementation ElementComparator - -- (id) initFor:(ElementComparatorBridge*)parentDirectory - compareWith:(NSDictionary*)otherElementId { - if (![super init]) { - return nil; - } - parentDirectory_ = parentDirectory; - otherElementId_ = [otherElementId retain]; - - [parentDirectory_ setResource:[WebDriverResource - resourceWithTarget:self - GETAction:@selector(compareElements) - POSTAction:NULL] - withName:[otherElementId objectForKey:kElementIdKey]]; - return self; -} - -- (void) dealloc { - [otherElementId_ release]; - [super dealloc]; -} - -- (id) compareElements { - id result; - @try { - NSArray* args = [NSArray arrayWithObjects: - [[parentDirectory_ element] idDictionary], otherElementId_, nil]; - result = [self executeJsFunction: - @"function(){return arguments[0]==arguments[1];}" - withArgs:args]; - } @finally { - // This is a one shot directory; remove ourselves from the parent directory. - NSLog(@"Removing comparator tmp directory"); - [parentDirectory_ removeResourceWithName: - [otherElementId_ objectForKey:kElementIdKey]]; - } - return result; -} - -@end - diff --git a/iphone/src/objc/ElementStore.h b/iphone/src/objc/ElementStore.h deleted file mode 100644 index 3d6ca3ec85e15..0000000000000 --- a/iphone/src/objc/ElementStore.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// Element.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class Session; -@class Element; - -// This represents the /:session/element 'directory'. -// All the elements are in /element/X where X is the element's id. -// Elements are cached in a JS object on the current page, ensuring the cache is -// cleared whenever a new page is loaded. The keyword "active" is a special -// element ID reserved for specifying the element which has focus on the page. -@interface ElementStore : HTTPVirtualDirectory { - @protected - Session* session_; -} - -@property (nonatomic, readonly, retain) Session *session; - -- (id) initWithSession:(Session*)session; - -// Make an element store. Installs itself as the /element and /elements -// virtual directory handler for the given |session|. -+ (ElementStore *)elementStoreForSession:(Session*)session; - -// Locates the element that currently has focus on the page, falling back to -// the body element if it cannot be determined. -// Returns the WebElement JSON dictionary for the located element. -- (NSDictionary*) getActiveElement:(NSDictionary *)ignored; - -// Locates the first element on the page that matches the given |query|. The -// |query| must have two keys: -// @li "using" - The locator strategy to use. -// @li "value" - The value to search for using the strategy. -// Returns the JSON representation of the located element. --(NSDictionary*) findElement:(NSDictionary*)query; - -// Locates every element on the page matching the given |query|. The |query| -// must have two keys: -// @li "using" - The locator strategy to use. -// @li "value" - The value to search for using the strategy. -// Returns an array of elements in their JSON representation. --(NSArray*) findElements:(NSDictionary*)query; - -@end diff --git a/iphone/src/objc/ElementStore.m b/iphone/src/objc/ElementStore.m deleted file mode 100644 index c19e701745d2a..0000000000000 --- a/iphone/src/objc/ElementStore.m +++ /dev/null @@ -1,137 +0,0 @@ -// -// Element.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "ElementStore.h" - -#import "JSONRESTResource.h" -#import "HTTPRedirectResponse.h" -#import "WebViewController.h" -#import "HTTPVirtualDirectory+AccessViewController.h" -#import "HTTPVirtualDirectory+ExecuteScript.h" -#import "HTTPVirtualDirectory+FindElement.h" -#import "WebDriverResource.h" -#import "Element.h" -#import "NSException+WebDriver.h" -#import "Session.h" -#import "errorcodes.h" - -@implementation ElementStore - -@synthesize session = session_; - -- (id)initWithSession:(Session*) session { - if (![super init]) { - return nil; - } - - session_ = session; - - // Install ourselves under the session's virtual directory - [session setResource:self withName:@"element"]; - [self setIndex:[WebDriverResource resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(findElement:)]]; - - [session setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(findElements:)] - withName:@"elements"]; - - // Install the special handler that retrieves the active element on the page. - [self setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(getActiveElement:)] - withName:@"active"]; - - return self; -} - -- (void)dealloc { - [super dealloc]; -} - -+ (ElementStore *)elementStoreForSession:(Session*)session { - return [[[ElementStore alloc] initWithSession:session] autorelease]; -} - -// Discard everything after the next '/' or '?' character -- (NSString *)getNextPathElementInQuery:(NSString *)query { - if ([query isEqualToString:@""]) { - return query; - } - - // Discard duplicate '/' characters in the query string to - // make up for client bugs. - while ([query characterAtIndex:0] == '/') { - query = [query substringFromIndex:1]; - } - - NSCharacterSet *separators = - [NSCharacterSet characterSetWithCharactersInString:@"/?"]; - NSRange range = [query rangeOfCharacterFromSet:separators]; - - return range.location == NSNotFound - ? query - : [query substringToIndex:range.location]; -} - -// Overrides |elementWithQuery| to redirect a request for an |Element| resource -// to that specific subdirectory. -- (id)elementWithQuery:(NSString *)query { - if ([query length] > 0) { - NSString* queriedElement = [self getNextPathElementInQuery:query]; - - // Check if there is a already a handler registered for this element. - // Note that "active" is a reserved ID whose handler is registered in - // this class's initializer. - id resource = [contents objectForKey:queriedElement]; - if (resource == nil) { - NSLog(@"Adding directory for element %@", queriedElement); - // TODO(jleyba): Fix memory leak and remove stale element directories. - resource = [Element elementWithId:queriedElement - andSession:session_]; - [self setResource:resource withName:queriedElement]; - } - } - // Need to delegate back to |super| so |Session| can set the session ID on the - // response. - return [super elementWithQuery:query]; -} - -- (NSDictionary*) getActiveElement:(NSDictionary *)ignored { - return (NSDictionary*) [self - executeJsFunction:@"function() {return document.activeElement || " - "document.body;}" - withArgs:[NSArray array]]; -} - --(NSDictionary*) findElement:(NSDictionary*)query { - return [self findElement:query - root:nil - implicitlyWait:[session_ implicitWait]]; -} - --(NSArray*) findElements:(NSDictionary*)query { - return [self findElements:query - root:nil - implicitlyWait:[session_ implicitWait]]; -} - -@end diff --git a/iphone/src/objc/FrameContext.h b/iphone/src/objc/FrameContext.h deleted file mode 100644 index 8e73136384025..0000000000000 --- a/iphone/src/objc/FrameContext.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// FrameContext.h -// iWebDriver -// -// Created by Luke Inman-Semerau on 1/20/12. -// Copyright (c) 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 - -@interface FrameContext : NSMutableArray - -+(FrameContext*)sharedInstance; - -@end diff --git a/iphone/src/objc/FrameContext.m b/iphone/src/objc/FrameContext.m deleted file mode 100644 index 5d073a6c2aad3..0000000000000 --- a/iphone/src/objc/FrameContext.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// FrameContext.m -// iWebDriver -// -// Created by Luke Inman-Semerau on 1/20/12. -// Copyright (c) 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 "FrameContext.h" - -@implementation FrameContext - -// Apologies to all those who know Obj-C way better. -// This was to have a global variable that's an NSMutableArray -// I would much prefer this to be on the Session object and then fetched -// via WebViewController, but alas WVC doesn't have access to the Session -// object and it would be a significant effort to make it available. -static FrameContext *singleton = nil; - -+(FrameContext*) sharedInstance { - if (singleton == nil) { - singleton = [[NSMutableArray alloc] init]; - } - - return singleton; -} - -@end diff --git a/iphone/src/objc/GeoLocation.h b/iphone/src/objc/GeoLocation.h deleted file mode 100644 index 886348fc108da..0000000000000 --- a/iphone/src/objc/GeoLocation.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - - 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 - -// We redefine coordinate and altitude getters to emulate geo location -// possition. it is the same if we do lazy swizzling -@interface CLLocation (Synthesize) -@end - -// mock object (singleton) to keep fake geo positions -@interface GeoLocation : NSObject { - CLLocationCoordinate2D coordinate_; - CLLocationDistance altitude_; -} - -+ (GeoLocation *)sharedManager; -- (CLLocationCoordinate2D)getCoordinate; -- (CLLocationDistance)getAltitude; -- (void)setCoordinate:(CLLocationDegrees)longitude - latitude:(CLLocationDegrees)latitude; -- (void)setAltitude:(CLLocationDistance)altitude; -@end diff --git a/iphone/src/objc/GeoLocation.m b/iphone/src/objc/GeoLocation.m deleted file mode 100644 index 9d7cb761ed090..0000000000000 --- a/iphone/src/objc/GeoLocation.m +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - - 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 "GeoLocation.h" - -@implementation CLLocation (Synthesize) - -- (CLLocationCoordinate2D)coordinate { - GeoLocation *locStorage = [GeoLocation sharedManager]; - return [locStorage getCoordinate]; -} - -- (CLLocationDistance)altitude { - GeoLocation *locStorage = [GeoLocation sharedManager]; - return [locStorage getAltitude]; -} - -@end - -@implementation GeoLocation - -- (CLLocationCoordinate2D)getCoordinate { - return coordinate_; -} - -- (CLLocationDistance)getAltitude { - return altitude_; -} - -- (void)setCoordinate:(CLLocationDegrees)longitude - latitude:(CLLocationDegrees)latitude { - coordinate_.longitude = longitude; - coordinate_.latitude = latitude; -} - -- (void)setAltitude:(CLLocationDistance)altitude { - altitude_ = altitude; -} - -static GeoLocation *sharedLocationStorage = nil; - -+ (GeoLocation *)sharedManager { - @synchronized(self) { - if (!sharedLocationStorage) { - [[self alloc] init]; - } - } - return sharedLocationStorage; -} - -+ (id)allocWithZone:(NSZone *)zone { - @synchronized(self) { - if (!sharedLocationStorage) { - return [super allocWithZone:zone]; - } - } - return sharedLocationStorage; -} - -- (id)init { - Class myClass = [self class]; - @synchronized(myClass) { - if (!sharedLocationStorage) { - if (self = [super init]) { - sharedLocationStorage = self; - coordinate_.latitude = 0.0f; - coordinate_.longitude = 0.0f; - altitude_ = 0.0f; - } - } - } - return sharedLocationStorage; -} - -- (id)copyWithZone:(NSZone *)zone { - return self; -} - -- (id)retain { - return self; -} - -- (unsigned)retainCount { - return UINT_MAX; -} - -- (void)release { -} - -- (id)autorelease { - return self; -} - -@end diff --git a/iphone/src/objc/HTTPJSONResponse.h b/iphone/src/objc/HTTPJSONResponse.h deleted file mode 100644 index 3852be89ddaf2..0000000000000 --- a/iphone/src/objc/HTTPJSONResponse.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// HTTPJSONResponse.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import "HTTPDataResponse.h" - -// |HTTPJSONResponse| wraps |HTTPDataResponse| for JSON data. It is used to -// return JSON from an HTTP method. -// -// Memory use is proportional to the size of the JSON of the object returned. -// Be careful returning very large objects! -@interface HTTPJSONResponse : HTTPDataResponse { - -} - -// Create an |HTTPJSONResponse| from the object. The object is serialised to -// JSON immediately. -// Object must be one of NSNumber, NSString, NSDictionary, NSArray. -- (id)initWithObject:(id)object; - -// A helper method for |initWithObject:| above. As with |initWithObject:|, -// object must be one of NSNumber, NSString, NSDictionary, NSArray. -// Follows standard autorelease pattern. -+ (HTTPJSONResponse *)responseWithObject:(id)object; - -@end diff --git a/iphone/src/objc/HTTPJSONResponse.m b/iphone/src/objc/HTTPJSONResponse.m deleted file mode 100644 index 6497c2f37f915..0000000000000 --- a/iphone/src/objc/HTTPJSONResponse.m +++ /dev/null @@ -1,49 +0,0 @@ -// -// HTTPJSONResponse.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "HTTPJSONResponse.h" -#import "NSObject+SBJson.h" - -@implementation HTTPJSONResponse - -- (id)initWithData:(NSData *)data { - NSLog(@"Use initWithObject for HTTPJSONResponse"); - return nil; -} - -// Designated initaliser -- (id)initWithObject:(id)object { - NSString *contents = [object JSONRepresentation]; - NSLog(@"Sending JSON: %@", contents); - NSData *theData = [contents dataUsingEncoding:NSUTF8StringEncoding]; - return [super initWithData:theData]; -} - -+ (HTTPJSONResponse *)responseWithObject:(id)object { - if (object == nil) - return nil; - else - return [[[self alloc] initWithObject:object] autorelease]; -} - -- (NSDictionary *)httpHeaders { - return [NSDictionary dictionaryWithObject:@"application/json; charset=UTF-8" forKey:@"Content-Type"]; -} - -@end diff --git a/iphone/src/objc/HTTPPNGResponse.h b/iphone/src/objc/HTTPPNGResponse.h deleted file mode 100644 index 04d739d41b779..0000000000000 --- a/iphone/src/objc/HTTPPNGResponse.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// HTTPPNGResponse.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import "HTTPDataResponse.h" - -// |HTTPPNGResponse| wraps |HTTPDataResponse| for image data. It is used to -// return a PNG from an HTTP method. -// -// Memory use is proportional to the size of the PNG of the object returned. -// Be careful returning very large images! -@interface HTTPPNGResponse : HTTPDataResponse { - -} - -- (id)initWithImage:(UIImage *)image; - -@end diff --git a/iphone/src/objc/HTTPPNGResponse.m b/iphone/src/objc/HTTPPNGResponse.m deleted file mode 100644 index d77588e934272..0000000000000 --- a/iphone/src/objc/HTTPPNGResponse.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// HTTPPNGResponse.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "HTTPPNGResponse.h" -#import "NSData+Base64.h" - -@implementation HTTPPNGResponse - -- (id)initWithImage:(UIImage *)image { - NSData *imageData = UIImagePNGRepresentation(image); - NSString *encodedImageString = [imageData base64EncodedString]; - NSData *encodedImageData = [encodedImageString dataUsingEncoding:NSUTF8StringEncoding]; - NSLog(@"Sending PNG image of size %d bytes", [encodedImageData length]); - return [super initWithData:encodedImageData]; -} - -- (NSString *) contentType { - return @"image/png"; -} - -@end diff --git a/iphone/src/objc/HTTPResponse+Utility.h b/iphone/src/objc/HTTPResponse+Utility.h deleted file mode 100644 index ab934092b5de6..0000000000000 --- a/iphone/src/objc/HTTPResponse+Utility.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// HTTPDataResponse+Utility.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import "HTTPDataResponse.h" - -// The |Utility| category adds some convenience methods to HTTPDataResponse -// allowing |HTTPDataResponse|s to be created from strings. -@interface HTTPDataResponse (Utility) - -// Init an |HTTPDataResponse| containing the given string encoded in UTF8. -- (id)initWithString:(NSString *)str; - -// Create and return an |HTTPDataResponse| containing the given string encoded -// in UTF8. Returned object is autoreleased. -+ (HTTPDataResponse *)responseWithString:(NSString *)str; - -- (NSString *)description; - -@end diff --git a/iphone/src/objc/HTTPResponse+Utility.m b/iphone/src/objc/HTTPResponse+Utility.m deleted file mode 100644 index 0ddd07ff3195b..0000000000000 --- a/iphone/src/objc/HTTPResponse+Utility.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// HTTPDataResponse+Utility.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "HTTPResponse+Utility.h" - -@implementation HTTPDataResponse (Utility) - -- (id)initWithString:(NSString *)str { - return [self initWithData:[str dataUsingEncoding:NSUTF8StringEncoding]]; -} - -+ (HTTPDataResponse *)responseWithString:(NSString *)str { - return [[[self alloc] initWithString:str] autorelease]; -} - -- (NSString *)description { - return [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; -} - -@end diff --git a/iphone/src/objc/HTTPServerController.h b/iphone/src/objc/HTTPServerController.h deleted file mode 100644 index d87dedc629dbe..0000000000000 --- a/iphone/src/objc/HTTPServerController.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// HTTPServerController.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import - -@class HTTPServer; -@class WebViewController; -@class RESTServiceMapping; - -// |HTTPServerController| creates, configures and controls the web server. -@interface HTTPServerController : NSObject { - HTTPServer *server_; - - WebViewController *viewController_; - - // The current status of the server for users. - NSString *status_; - - RESTServiceMapping *serviceMapping_; -} - -@property (retain, nonatomic) WebViewController *viewController; -@property (readonly, nonatomic) RESTServiceMapping *serviceMapping; -@property (readonly, nonatomic, copy) NSString *status; - -+(HTTPServerController *)sharedInstance; - --(NSObject *)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData; -@end diff --git a/iphone/src/objc/HTTPServerController.m b/iphone/src/objc/HTTPServerController.m deleted file mode 100644 index a7d85ec0be92d..0000000000000 --- a/iphone/src/objc/HTTPServerController.m +++ /dev/null @@ -1,230 +0,0 @@ -// -// HTTPServerController.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "HTTPServerController.h" -#import "HTTPServer.h" -#import "WebDriverHTTPConnection.h" -#import "RESTServiceMapping.h" -#import "WebDriverPreferences.h" -#import "Status.h" -#import "NSObject+SBJson.h" - -#import -#import -#import -#import - -@implementation HTTPServerController - -@synthesize status = status_; -@synthesize viewController = viewController_; -@synthesize serviceMapping = serviceMapping_; - -static NSMutableData *webData; - --(NSString *)getAddress { - - struct ifaddrs *head; - if (getifaddrs(&head)) - return @"unknown"; - - // Default to return localhost. - NSString *address = @"127.0.0.1"; - - // |head| contains the first element in a linked list of interface addresses. - // Iterate through the list. - for (struct ifaddrs *ifaddr = head; - ifaddr != NULL; - ifaddr = ifaddr->ifa_next) { - - struct sockaddr *sock = ifaddr->ifa_addr; - - NSString *interfaceName = [NSString stringWithUTF8String:ifaddr->ifa_name]; - - // Ignore localhost. - if ([interfaceName isEqualToString:@"lo0"]) - continue; - - // Ignore IPv6 for now. - if (sock->sa_family == AF_INET) { - struct in_addr inaddr = ((struct sockaddr_in *)sock)->sin_addr; - char *name = inet_ntoa(inaddr); - address = [NSString stringWithUTF8String:name]; - // if wifi use this, otherwise it's the carrier network (pdp_ip0) - // keep looking for the wifi, if no other network interface is found - // it will use the carrier network. - if ([interfaceName isEqualToString:@"en0"]) { - break; - } - } - } - - freeifaddrs(head); - - return address; -} - --(id) init { - if (![super init]) - return nil; - UInt16 portNumber = [[WebDriverPreferences sharedInstance] serverPortNumber]; - NSString* grid = [[WebDriverPreferences sharedInstance] gridLocation]; - - server_ = [[HTTPServer alloc] init]; - - [server_ setType:@"_http._tcp."]; - [server_ setPort:portNumber]; - [server_ setConnectionClass:[WebDriverHTTPConnection class]]; - - NSError *error; - BOOL success = [server_ start:&error]; - - if(!success) { - NSLog(@"Error starting HTTP Server: %@", error); - } - - NSLog(@"HTTP server started on addr %@ port %d", - [self getAddress], - [server_ port]); - - status_ = [[NSString alloc] initWithFormat:@"Started at http://%@:%d/wd/hub/", - [self getAddress], - [server_ port]]; - - if([grid length] > 0) { - NSString* gridPort = [[WebDriverPreferences sharedInstance] gridPort]; - - NSString *registerUrlStr = [NSString stringWithFormat:@"http://%@:%@/grid/register", grid, gridPort]; - - NSNumber *num = [NSNumber numberWithInt:1]; - - // just want "iPad" or "iPhone" - NSString *device = [[[[UIDevice currentDevice] model] componentsSeparatedByString:@" "] objectAtIndex:0]; - - NSDictionary *capabilitiesDict = [NSDictionary dictionaryWithObjectsAndKeys: - @"WebDriver", @"seleniumProtocol", - device, @"browserName", - num, @"maxInstances", - @"MAC", @"platform", // TODO change from MAC to iOS - nil]; - - - NSDictionary *configurationDict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:[server_ port]], @"port", - [NSNumber numberWithBool:true], @"register", - [self getAddress], @"host", - @"org.openqa.grid.selenium.proxy.DefaultRemoteProxy", @"proxy", - num, @"maxSession", - grid, @"hubHost", - gridPort, @"hubPort", - @"wd", @"role", - [NSNumber numberWithInt:5000], @"registerCycle", - registerUrlStr, @"hub", - [NSString stringWithFormat:@"http://%@:%d", [self getAddress], [server_ port] ], @"remoteHost", - nil]; - - NSDictionary *gridRegistrationData = [NSDictionary dictionaryWithObjectsAndKeys: - @"org.openqa.grid.common.RegistrationRequest", @"class", - [NSArray arrayWithObject:capabilitiesDict], @"capabilities", - configurationDict, @"configuration", - nil]; - - NSURL *registerUrl = [NSURL URLWithString:registerUrlStr]; - - NSMutableURLRequest *gridRegister = [NSMutableURLRequest requestWithURL:registerUrl]; - - NSString *json = [gridRegistrationData JSONRepresentation]; - - NSString *msgLength = [NSString stringWithFormat:@"%d", [json length]]; - - [gridRegister addValue: msgLength forHTTPHeaderField:@"Content-Length"]; - [gridRegister setHTTPMethod:@"POST"]; - [gridRegister setHTTPBody: [json dataUsingEncoding:NSUTF8StringEncoding]]; - - NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:gridRegister delegate:self]; - - if (theConnection) { - // Create the NSMutableData to hold the received data. - // receivedData is an instance variable declared elsewhere. - webData = [[NSMutableData data] retain]; - } else { - // Inform the user that the connection failed. - status_ = [NSString stringWithFormat:@"Couldn't connect to grid at %@", registerUrlStr]; - } - - } - - serviceMapping_ = [[RESTServiceMapping alloc] initWithIpAddress:[self getAddress] - port:[server_ port]]; - - return self; -} - --(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response -{ - [webData setLength: 0]; -} - --(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data -{ - [webData appendData:data]; -} - --(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error -{ - NSLog(@"ERROR with theConenction"); - [connection release]; - [webData release]; -} - --(void)connectionDidFinishLoading:(NSURLConnection *)connection -{ - NSLog(@"DONE. Received Bytes: %d", [webData length]); - NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] - length:[webData length] - encoding:NSUTF8StringEncoding]; - NSLog(@"%@",theXML); - [theXML release]; -} - -// Singleton - -static HTTPServerController *singleton = nil; - -+(HTTPServerController*) sharedInstance { - if (singleton == nil) { - singleton = [[HTTPServerController alloc] init]; - } - - return singleton; -} - -- (NSObject *)httpResponseForRequest:(HTTPMessage*)request { - return [serviceMapping_ httpResponseForRequest:request]; -} - -- (NSObject *)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData { - return [serviceMapping_.serverRoot httpResponseForQuery:query - method:method - withData:theData]; -} - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.h b/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.h deleted file mode 100644 index 8f3568ee2a539..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// VirtualDirectory+AccessViewController.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class WebViewController; - -// This category gives |HTTPVirtualDirectory| objects access to the -// |WebViewController|. -@interface HTTPVirtualDirectory (AccessViewController) - -- (WebViewController *)viewController; - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.m b/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.m deleted file mode 100644 index cd8a7fa49c962..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+AccessViewController.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// VirtualDirectory+AccessViewController.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "HTTPVirtualDirectory+AccessViewController.h" -#import "HTTPServerController.h" -#import "WebDriverPreferences.h" -#import "WebDriverRequestFetcher.h" - -@implementation HTTPVirtualDirectory (AccessViewController) - -- (WebViewController *)viewController { - // This is a somewhat ugly implementation. It is implemented like this so - // if we have multiple view controllers (eg, tabs), all VirtualDirectory - // access of the viewController can be easily changed. - - NSString* mode = [[WebDriverPreferences sharedInstance] mode]; - if ([mode isEqualToString:@"Server"]) { - return [[HTTPServerController sharedInstance] viewController]; - } else { - return [[WebDriverRequestFetcher sharedInstance] viewController]; - } -} - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.h b/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.h deleted file mode 100644 index 0ee75a4d8e40c..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// HTTPVirtualDirectory+ExecuteScript.h -// iWebDriver -// -// Copyright 2010 WebDriver committers -// Copyright 2010 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@interface HTTPVirtualDirectory (ExecuteScript) - -// Compiles and executes a JavaScript |atom| in the |UIViewController|. The -// |atom|, which must be defined by a function literal, must be specified in a -// NULL terminated array. Each script argument must be a JSON friendly value: -// NSNumber, NSString, NSNull, NSArray, or NSDictionary. If an argument value is -// a NSDictionary, and contaisn the "ELEMENT" key, it will be interpreted as a -// DOM element reference, as defined by the WebDriver wire protocol: -// http://code.google.com/p/selenium/wiki/JsonWireProtocol -// -// Returns the script result; throws an exception if it fails. --(id) executeAtom:(const char* const[])atom - withArgs:(NSArray*) arguments; - -// Executes a JavaScript function in the |UIViewController|. Each script -// argument mut be a JSON friendly value: NSNumber, NSString, NSNUll, NSArray, -// or NSDictionary. If an argument value is a NSDictionary and contains the -// "ELEMENT" key, it will be interpreted as a DOM element reference, as defined -// by the WebDriver wire protocol: -// http://code.google.com/p/selenium/wiki/JsonWireProtocol -// -// Returns the script result; throws an exception if it fails. --(id) executeJsFunction:(NSString*)functionAsString - withArgs:(NSArray*)args; - -// Similar to |executeJsFunction:withArgs:|, except the |script| defines the -// body of an asynchronous function. The last argument to this function will be -// a callback which must be invoked to signal the script has finished. --(id) executeAsyncJsFunction:(NSString*)script - withArgs:(NSArray*)args - withTimeout:(NSTimeInterval)timeout; - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.mm b/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.mm deleted file mode 100644 index af15216a6eedb..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+ExecuteScript.mm +++ /dev/null @@ -1,192 +0,0 @@ -// -// HTTPVirtualDirectory+ExecuteScript.m -// iWebDriver -// -// Copyright 2010 WebDriver committers -// Copyright 2010 Google Inc. -// -// 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 "HTTPVirtualDirectory+ExecuteScript.h" - -#include -#import "HTTPVirtualDirectory+AccessViewController.h" -#import "NSException+WebDriver.h" -#import "NSObject+SBJSON.h" -#import "WebViewController.h" -#include "atoms.h" -#include "errorcodes.h" - - -@interface SimpleObserver : NSObject { - NSDictionary* data_; -} - -+(SimpleObserver*) simpleObserverForAction:(NSString*) action - andSender:(id)notificationSender; - --(id) initObserverForAction:(NSString*)action - andSender:(id)notificationSender; - --(void) onNotification:(NSNotification*)notification; --(NSDictionary*) waitForData; - -@end - -@implementation SimpleObserver - --(id) initObserverForAction:(NSString*)action - andSender:(id)notificationSender { - if (![super init]) { - return nil; - } - data_ = nil; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onNotification:) - name:action - object:notificationSender]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onPageLoad:) - name:@"webdriver:pageLoad" - object:notificationSender]; - return self; -} - -- (void) dealloc { - [data_ release]; - [super dealloc]; -} - - -+(SimpleObserver*) simpleObserverForAction:(NSString*) action - andSender:(id)sender { - return [[[SimpleObserver alloc] initObserverForAction:action - andSender:sender] autorelease]; -} - --(void) onPageLoad:(NSNotification*)notification { - @synchronized(self) { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - NSLog(@"[SimpleObserver onPageLoad:]"); - NSDictionary* value = [NSDictionary - dictionaryWithObject:@"Page load detected; async scripts did not work " - "across page loads" - forKey:@"message"]; - data_ = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:EUNHANDLEDERROR], @"status", - value, @"value", - nil]; - [data_ retain]; - } -} - --(void) onNotification:(NSNotification*)notification { - @synchronized(self) { - NSLog(@"[SimpleObserver onNotification:]"); - [[NSNotificationCenter defaultCenter] removeObserver:self]; - data_ = [[notification userInfo] retain]; - } -} - --(NSDictionary*) waitForData { - while (true) { - @synchronized(self) { - if (data_ != nil) { - // If data_ is not nil, then we've already removed ourselves as an - // observer. - return data_; - } - } - [NSThread sleepForTimeInterval:0.25]; - } -} - -@end - - -@implementation HTTPVirtualDirectory (ExecuteScript) - --(id) executeAtom:(const char* const[])atom - withArgs:(NSArray*) args { - std::string compiled(""); - for (size_t i = 0; atom[i] != NULL; i++) { - compiled.append(atom[i]); - } - - return [self executeJsFunction:[NSString stringWithCString:compiled.c_str() encoding:NSUTF8StringEncoding] - withArgs:args]; -} - --(id) verifyResult:(NSDictionary*)resultDict { - int status = [(NSNumber*) [resultDict objectForKey:@"status"] intValue]; - if (status != WD_SUCCESS) { - NSDictionary* value = (NSDictionary*) [resultDict objectForKey:@"value"]; - NSString* message = (NSString*) [value objectForKey:@"message"]; - @throw [NSException webDriverExceptionWithMessage:message - andStatusCode:status]; - } - return [resultDict objectForKey:@"value"]; -} - --(id) executeScript:(NSString*)script - withArgs:(NSArray*)args { - std::string compiled(""); - for (size_t i = 0; webdriver::atoms::EXECUTE_SCRIPT[i] != NULL; i++) { - compiled.append(webdriver::atoms::EXECUTE_SCRIPT[i]); - } - - NSString* result = [[self viewController] jsEval:@"(%@)(%@,%@,true)", - [NSString stringWithCString:compiled.c_str() encoding:NSUTF8StringEncoding], - script, - [args JSONRepresentation]]; - NSLog(@"Got result: %@", result); - - NSDictionary* resultDict = (NSDictionary*) [result JSONValue]; - return [self verifyResult:resultDict]; -} - --(id) executeJsFunction:(NSString*)script - withArgs:(NSArray*)args { - return [self executeScript:script withArgs:args]; -} - --(id) executeAsyncJsFunction:(NSString*)script - withArgs:(NSArray*)args - withTimeout:(NSTimeInterval)timeout { - // The |WebViewController| will broadcast a |webdriver:executeAsyncScript| - // notification when the web view tries to load a URL of the form: - // webdriver://executeAsyncScript?query. - // The |EXECUTE_ASYNC_SCRIPT| loads this URL to notify that it has finished, - // encoding its response in the query string. - SimpleObserver* observer = - [SimpleObserver simpleObserverForAction:@"webdriver:executeAsyncScript" - andSender:[self viewController]]; - - std::string compiled(""); - for (size_t i = 0; webdriver::atoms::EXECUTE_ASYNC_SCRIPT[i] != NULL; i++) { - compiled.append(webdriver::atoms::EXECUTE_ASYNC_SCRIPT[i]); - } - - [[self viewController] jsEval:@"(%@)(function(){%@\n},%@,%@)", - [NSString stringWithCString:compiled.c_str() encoding:NSUTF8StringEncoding], - script, - [args JSONRepresentation], - [NSNumber numberWithDouble:timeout * 1000]]; - - NSDictionary* resultDict = [observer waitForData]; - - NSLog(@"Got result: %@", [resultDict JSONRepresentation]); - return [self verifyResult:resultDict]; -} - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+FindElement.h b/iphone/src/objc/HTTPVirtualDirectory+FindElement.h deleted file mode 100644 index aa828092c4a45..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+FindElement.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// HTTPVirtualDirectory+FindElement.h -// iWebDriver -// -// Copyright 2010 WebDriver committers -// Copyright 2010 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -// Allows |HTTPVirtualDirectory| instances to locate elements on the page. -@interface HTTPVirtualDirectory (FindElement) - -// Searches for the first DOM element on the current page to match the given -// search |query|. The |query| must be defined by two keys: -// - using: The locator strategy to use, and -// - value: The search target. -// -// If |elementId| is nil, the search will be conducted starting from the root of -// the DOM tree. Otherwise, the search will be restricted to those elements -// under the identified element's DOM subtree. This root element must be -// specified by a WebElement JSON dictionary, as defined in the WebDriver -// wire protocol: -// http://code.google.com/p/selenium/wiki/JsonWireProtocol#Basic_Concepts_And_Terms -// -// If |implicitWait| is greater than zero, the |query| will be reapplied until -// an element is found, or the |implicitWait| times out, which ever occurs -// first. -// -// Returns the located element in its WebElement JSON form. --(NSDictionary*) findElement:(NSDictionary*)query - root:(NSDictionary*)elementId - implicitlyWait:(NSTimeInterval)implicitWait; - -// Searches for all DOM elements on the current page that match the given search -// |query|. The |query| must be defined by two keys: -// - using: The locator strategy to use, and -// - value: The search target. -// -// If |elementId| is nil, the search will be conducted starting from the root of -// the DOM tree. Otherwise, the search will be restricted to those elements -// under the identified element's DOM subtree. This root element must be -// specified by a WebElement JSON dictionary, as defined in the WebDriver -// wire protocol: -// http://code.google.com/p/selenium/wiki/JsonWireProtocol#Basic_Concepts_And_Terms -// -// If |implicitWait| is greater than zero, the |query| will be reapplied until -// at least one element is found, or the |implicitWait| times out, which ever -// occurs first. -// -// Returns a list of located elements, in their WebElement JSON form. --(NSArray*) findElements:(NSDictionary*)query - root:(NSDictionary*)elementId - implicitlyWait:(NSTimeInterval)implicitWait; - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+FindElement.mm b/iphone/src/objc/HTTPVirtualDirectory+FindElement.mm deleted file mode 100644 index 6de31fdca5e08..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+FindElement.mm +++ /dev/null @@ -1,106 +0,0 @@ -// -// HTTPVirtualDirectory+FindElement.h -// iWebDriver -// -// Copyright 2010 WebDriver committers -// Copyright 2010 Google Inc. -// -// 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 "HTTPVirtualDirectory+FindElement.h" - -#import "HTTPVirtualDirectory+ExecuteScript.h" -#import "NSObject+SBJSON.h" -#import "NSException+WebDriver.h" -#include "atoms.h" -#include "errorcodes.h" - -@implementation HTTPVirtualDirectory (FindElement) - -// Converts an element |query| understood by the WebDriver wire protocol to a -// locator strategy supported by the browser automation atoms. --(NSDictionary*) buildLocator:(NSDictionary*)query { - NSString* wireStrategy = [query objectForKey:@"using"]; - NSString* value = [query objectForKey:@"value"]; - - const NSDictionary* const wireProtocolToAtomStrategy = - [NSDictionary dictionaryWithObjectsAndKeys: - @"className", @"class name", - @"css", @"css selector", - @"linkText", @"link text", - @"partialLinkText", @"partial link text", - @"tagName", @"tag name", - nil]; - - NSString* atomsStrategy = - [wireProtocolToAtomStrategy objectForKey:wireStrategy]; - if (atomsStrategy == nil) { - atomsStrategy = wireStrategy; - } - return [NSDictionary dictionaryWithObject:value forKey:atomsStrategy]; -} - --(NSDictionary*) findElement:(NSDictionary*)query - root:(NSDictionary*)elementId - implicitlyWait:(NSTimeInterval)implicitWait { - NSArray* args = [NSArray arrayWithObjects:[self buildLocator:query], - elementId, nil]; - - NSDate* startTime = [NSDate dateWithTimeIntervalSinceNow:0]; - while (true) { - id result = [self executeAtom:webdriver::atoms::FIND_ELEMENT withArgs:args]; - - if (![result isKindOfClass:[NSNull class]]) { - return result; - } - - NSDate* now = [NSDate dateWithTimeIntervalSinceNow:0]; - NSTimeInterval elapsedTime = [now timeIntervalSinceDate:startTime]; - if (elapsedTime > implicitWait) { - @throw([NSException - webDriverExceptionWithMessage:@"Unable to locate element" - andStatusCode:ENOSUCHELEMENT]); - } else { - [NSThread sleepForTimeInterval:0.25]; - } - } -} - --(NSArray*) findElements:(NSDictionary*)query - root:(NSDictionary*)elementId - implicitlyWait:(NSTimeInterval)implicitWait { - NSArray* args = [NSArray arrayWithObjects:[self buildLocator:query], - elementId, nil]; - - NSDate* startTime = [NSDate dateWithTimeIntervalSinceNow:0]; - - while (true) { - NSArray* result = - (NSArray*) [self executeAtom:webdriver::atoms::FIND_ELEMENTS - withArgs:args]; - if ([result count] > 0) { - return result; - } - - NSDate* now = [NSDate dateWithTimeIntervalSinceNow:0]; - NSTimeInterval elapsedTime = [now timeIntervalSinceDate:startTime]; - if (elapsedTime > implicitWait) { - return result; - } else { - [NSThread sleepForTimeInterval:0.25]; - } - } -} - - -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+Remove.h b/iphone/src/objc/HTTPVirtualDirectory+Remove.h deleted file mode 100644 index d35c069009096..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+Remove.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// HTTPVirtualDirectory+Remove.h -// iWebDriver -// -// Created by Yu Chen on 6/1/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// -#import -#import "HTTPVirtualDirectory.h" - -@class WebViewController; - -@interface HTTPVirtualDirectory (Remove) -- (void) removeChildren; -@end diff --git a/iphone/src/objc/HTTPVirtualDirectory+Remove.m b/iphone/src/objc/HTTPVirtualDirectory+Remove.m deleted file mode 100644 index 2dd7f21e29cf6..0000000000000 --- a/iphone/src/objc/HTTPVirtualDirectory+Remove.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// HTTPVirtualDirectory+Remove.m -// iWebDriver -// -// Created by Yu Chen on 6/1/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "HTTPVirtualDirectory+Remove.h" - -@implementation HTTPVirtualDirectory (Remove) -- (void) removeChildren { - // Remove NSMutableDictionary *contents - NSString* contentName; - for (contentName in [contents allKeys]) { - id content = [contents objectForKey:contentName]; - [contents removeObjectForKey:contentName]; - NSLog(@"Content '%@' retainCount: %d, before removeChildren", contentName, (int)[content retainCount]); - - if ([content isKindOfClass:[HTTPVirtualDirectory class]]) { - [(HTTPVirtualDirectory*)content removeChildren]; - } - NSLog(@"Content '%@' retainCount: %d, after removeChildren, before release", contentName, (int)[content retainCount]); - - [content release]; - - } - - //Remove id index - if ([index isKindOfClass:[HTTPVirtualDirectory class]]) { - [(HTTPVirtualDirectory*)index removeChildren]; - } - NSLog(@"Index retainCount: %d before release", (int)[index retainCount]); - [index release]; -} -@end diff --git a/iphone/src/objc/JSONRESTResource.h b/iphone/src/objc/JSONRESTResource.h deleted file mode 100644 index 78c617da0f417..0000000000000 --- a/iphone/src/objc/JSONRESTResource.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// RESTServiceHandler.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" -#import "HTTPResource.h" - -/* A JSONRestResource is a resource which calls a method when its accessed. - * The method's return value is then turned back into JSON and sent over the - * wire. - */ -@interface JSONRESTResource : NSObject { - @private - id target_; - SEL action_; -} - -@property (nonatomic, retain) id target; -@property (nonatomic, assign) SEL action; - -- (id)initWithTarget:(id)target action:(SEL)action; -+ (JSONRESTResource *)JSONResourceWithTarget:(id)theTarget - action:(SEL)theAction; - -@end - - -// This is an extension to VirtualDirectory to allow easy resource additions -@interface HTTPVirtualDirectory (JSONResource) - -// This is a helper method for subclasses. It sets a resource to a JSON handler -// implemented by the specified selector. The target is the virtualdirectory -// subclass. -// The selector should take 2 arguments: The JSON object sent in POST data and -// the HTTP method called as an NSString. It returns a (NSObject*) -- (void)setMyJSONHandler:(SEL)selector withName:(NSString *)name; - -@end diff --git a/iphone/src/objc/JSONRESTResource.m b/iphone/src/objc/JSONRESTResource.m deleted file mode 100644 index 6f116ef4ab771..0000000000000 --- a/iphone/src/objc/JSONRESTResource.m +++ /dev/null @@ -1,89 +0,0 @@ -// -// RESTServiceHandler.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "JSONRESTResource.h" -#import "HTTPJSONResponse.h" -#import "NSObject+SBJson.h" - -@implementation JSONRESTResource - -@synthesize target = target_, action = action_; - -- (id)initWithTarget:(id)theTarget action:(SEL)theAction { - if (![super init]) - return nil; - - [self setTarget:theTarget]; - [self setAction:theAction]; - - return self; -} - -- (void)dealloc { - [self setTarget:nil]; - - // TODO: do I need to do this? - [self setAction:nil]; - - [super dealloc]; -} - -+ (JSONRESTResource *)JSONResourceWithTarget:(id)theTarget - action:(SEL)theAction { - return [[[self alloc] initWithTarget:theTarget action:theAction] autorelease]; -} - -// Get the HTTP response to this request -- (id)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData { - id requestData = nil; - - if ([theData length] > 0) { - NSString *dataString = - [[NSString alloc] initWithData:theData - encoding:NSUTF8StringEncoding]; - - requestData = [dataString JSONValue]; - [dataString release]; - } - - id response = [target_ performSelector:action_ - withObject:requestData - withObject:method]; - - return response; -} - -// I will take things from here. -- (id)elementWithQuery:(NSString *)query { - return self; -} - -@end - -@implementation HTTPVirtualDirectory (JSONResource) - -// Helper method to set JSON resources -- (void)setMyJSONHandler:(SEL)selector withName:(NSString *)name { - [self setResource:[JSONRESTResource JSONResourceWithTarget:self - action:selector] - withName:name]; -} - -@end diff --git a/iphone/src/objc/NSData+Base64.h b/iphone/src/objc/NSData+Base64.h deleted file mode 100644 index eb1ff485a73a5..0000000000000 --- a/iphone/src/objc/NSData+Base64.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSData+Base64.h -// base64 -// -// Created by Matt Gallagher on 2009/06/03. -// Copyright 2009 Matt Gallagher. All rights reserved. -// -// Permission is given to use this source code file, free of charge, in any -// project, commercial or otherwise, entirely at your risk, with the condition -// that any redistribution (in part or whole) of source code must retain -// this copyright and permission notice. Attribution in compiled projects is -// appreciated but not required. -// - -#import - -void *NewBase64Decode( - const char *inputBuffer, - size_t length, - size_t *outputLength); - -char *NewBase64Encode( - const void *inputBuffer, - size_t length, - bool separateLines, - size_t *outputLength); - -@interface NSData (Base64) - -+ (NSData *)dataFromBase64String:(NSString *)aString; -- (NSString *)base64EncodedString; - -@end diff --git a/iphone/src/objc/NSData+Base64.m b/iphone/src/objc/NSData+Base64.m deleted file mode 100644 index 3f50580e42f7c..0000000000000 --- a/iphone/src/objc/NSData+Base64.m +++ /dev/null @@ -1,299 +0,0 @@ -// -// NSData+Base64.m -// base64 -// -// Created by Matt Gallagher on 2009/06/03. -// Copyright 2009 Matt Gallagher. All rights reserved. -// -// Permission is given to use this source code file, free of charge, in any -// project, commercial or otherwise, entirely at your risk, with the condition -// that any redistribution (in part or whole) of source code must retain -// this copyright and permission notice. Attribution in compiled projects is -// appreciated but not required. -// - -#import "NSData+Base64.h" - -// -// Mapping from 6 bit pattern to ASCII character. -// -static unsigned char base64EncodeLookup[65] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -// -// Definition for "masked-out" areas of the base64DecodeLookup mapping -// -#define xx 65 - -// -// Mapping from ASCII character to 6 bit pattern. -// -static unsigned char base64DecodeLookup[256] = -{ - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 62, xx, xx, xx, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, xx, xx, xx, xx, xx, xx, - xx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, xx, xx, xx, xx, xx, - xx, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, -}; - -// -// Fundamental sizes of the binary and base64 encode/decode units in bytes -// -#define BINARY_UNIT_SIZE 3 -#define BASE64_UNIT_SIZE 4 - -// -// NewBase64Decode -// -// Decodes the base64 ASCII string in the inputBuffer to a newly malloced -// output buffer. -// -// inputBuffer - the source ASCII string for the decode -// length - the length of the string or -1 (to specify strlen should be used) -// outputLength - if not-NULL, on output will contain the decoded length -// -// returns the decoded buffer. Must be free'd by caller. Length is given by -// outputLength. -// -void *NewBase64Decode( - const char *inputBuffer, - size_t length, - size_t *outputLength) -{ - if (length == -1) - { - length = strlen(inputBuffer); - } - - size_t outputBufferSize = - ((length+BASE64_UNIT_SIZE-1) / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE; - unsigned char *outputBuffer = (unsigned char *)malloc(outputBufferSize); - - size_t i = 0; - size_t j = 0; - while (i < length) - { - // - // Accumulate 4 valid characters (ignore everything else) - // - unsigned char accumulated[BASE64_UNIT_SIZE]; - size_t accumulateIndex = 0; - while (i < length) - { - unsigned char decode = base64DecodeLookup[inputBuffer[i++]]; - if (decode != xx) - { - accumulated[accumulateIndex] = decode; - accumulateIndex++; - - if (accumulateIndex == BASE64_UNIT_SIZE) - { - break; - } - } - } - - // - // Store the 6 bits from each of the 4 characters as 3 bytes - // - outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4); - outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2); - outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3]; - j += accumulateIndex - 1; - } - - if (outputLength) - { - *outputLength = j; - } - return outputBuffer; -} - -// -// NewBase64Decode -// -// Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced -// output buffer. -// -// inputBuffer - the source data for the encode -// length - the length of the input in bytes -// separateLines - if zero, no CR/LF characters will be added. Otherwise -// a CR/LF pair will be added every 64 encoded chars. -// outputLength - if not-NULL, on output will contain the encoded length -// (not including terminating 0 char) -// -// returns the encoded buffer. Must be free'd by caller. Length is given by -// outputLength. -// -char *NewBase64Encode( - const void *buffer, - size_t length, - bool separateLines, - size_t *outputLength) -{ - const unsigned char *inputBuffer = (const unsigned char *)buffer; - - #define MAX_NUM_PADDING_CHARS 2 - #define OUTPUT_LINE_LENGTH 64 - #define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE) - #define CR_LF_SIZE 2 - - // - // Byte accurate calculation of final buffer size - // - size_t outputBufferSize = - ((length / BINARY_UNIT_SIZE) - + ((length % BINARY_UNIT_SIZE) ? 1 : 0)) - * BASE64_UNIT_SIZE; - if (separateLines) - { - outputBufferSize += - (outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE; - } - - // - // Include space for a terminating zero - // - outputBufferSize += 1; - - // - // Allocate the output buffer - // - char *outputBuffer = (char *)malloc(outputBufferSize); - if (!outputBuffer) - { - return NULL; - } - - size_t i = 0; - size_t j = 0; - const size_t lineLength = separateLines ? INPUT_LINE_LENGTH : length; - size_t lineEnd = lineLength; - - while (true) - { - if (lineEnd > length) - { - lineEnd = length; - } - - for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE) - { - // - // Inner loop: turn 48 bytes into 64 base64 characters - // - outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) - | ((inputBuffer[i + 1] & 0xF0) >> 4)]; - outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2) - | ((inputBuffer[i + 2] & 0xC0) >> 6)]; - outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F]; - } - - if (lineEnd == length) - { - break; - } - - // - // Add the newline - // - outputBuffer[j++] = '\r'; - outputBuffer[j++] = '\n'; - lineEnd += lineLength; - } - - if (i + 1 < length) - { - // - // Handle the single '=' case - // - outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) - | ((inputBuffer[i + 1] & 0xF0) >> 4)]; - outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2]; - outputBuffer[j++] = '='; - } - else if (i < length) - { - // - // Handle the double '=' case - // - outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4]; - outputBuffer[j++] = '='; - outputBuffer[j++] = '='; - } - outputBuffer[j] = 0; - - // - // Set the output length and return the buffer - // - if (outputLength) - { - *outputLength = j; - } - return outputBuffer; -} - -@implementation NSData (Base64) - -// -// dataFromBase64String: -// -// Creates an NSData object containing the base64 decoded representation of -// the base64 string 'aString' -// -// Parameters: -// aString - the base64 string to decode -// -// returns the autoreleased NSData representation of the base64 string -// -+ (NSData *)dataFromBase64String:(NSString *)aString -{ - NSData *data = [aString dataUsingEncoding:NSASCIIStringEncoding]; - size_t outputLength; - void *outputBuffer = NewBase64Decode([data bytes], [data length], &outputLength); - NSData *result = [NSData dataWithBytes:outputBuffer length:outputLength]; - free(outputBuffer); - return result; -} - -// -// base64EncodedString -// -// Creates an NSString object that contains the base 64 encoding of the -// receiver's data. Lines are broken at 64 characters long. -// -// returns an autoreleased NSString being the base 64 representation of the -// receiver. -// -- (NSString *)base64EncodedString -{ - size_t outputLength; - char *outputBuffer = - NewBase64Encode([self bytes], [self length], true, &outputLength); - - NSString *result = - [[[NSString alloc] - initWithBytes:outputBuffer - length:outputLength - encoding:NSASCIIStringEncoding] - autorelease]; - free(outputBuffer); - return result; -} - -@end diff --git a/iphone/src/objc/NSException+WebDriver.h b/iphone/src/objc/NSException+WebDriver.h deleted file mode 100644 index 7d81ba5167593..0000000000000 --- a/iphone/src/objc/NSException+WebDriver.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// NSException+WebDriver.h -// iWebDriver -// -// Created by Joseph Gentle on 1/15/09. -// Copyright 2009 Google Inc. All rights reserved. -// - -#import - -// This category allows resource methods to throw exceptions which -// are sent over the wire to webdriver. -@interface NSException (WebDriver) - -+ (NSException *)webDriverExceptionWithMessage:(NSString *)message - andStatusCode:(int)statusCode; - -+ (NSString *)webdriverExceptionName; - -@end diff --git a/iphone/src/objc/NSException+WebDriver.m b/iphone/src/objc/NSException+WebDriver.m deleted file mode 100644 index 88cd83d8a605e..0000000000000 --- a/iphone/src/objc/NSException+WebDriver.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// NSException+WebDriver.m -// iWebDriver -// -// Created by Joseph Gentle on 1/15/09. -// Copyright 2009 Google Inc. All rights reserved. -// - -#import "NSException+WebDriver.h" - - -static NSString* const WEBDRIVER_EXCEPTION_NAME = @"kWebDriverException"; - - -@implementation NSException (WebDriver) - -+ (NSException *)webDriverExceptionWithMessage:(NSString *)message - andStatusCode:(int)statusCode { - // TODO: Work out how to send a proper stack trace - NSDictionary *value = [NSDictionary dictionaryWithObjectsAndKeys: - message, @"message", - [NSArray array], @"stackTrace", - nil]; - - NSDictionary *userDict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:statusCode], @"status", - value, @"value", - nil]; - - return [NSException exceptionWithName:WEBDRIVER_EXCEPTION_NAME - reason:message - userInfo:userDict]; -} - -+ (NSString *)webdriverExceptionName { - return WEBDRIVER_EXCEPTION_NAME; -} - -@end diff --git a/iphone/src/objc/NSURLRequest+IgnoreSSL.h b/iphone/src/objc/NSURLRequest+IgnoreSSL.h deleted file mode 100644 index 968fb1ad1c016..0000000000000 --- a/iphone/src/objc/NSURLRequest+IgnoreSSL.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// NSURLRequest+IgnoreSSL.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 - -// Monkey-patch NSURLRequest to ignore bad SSL certs -@interface NSURLRequest (IgnoreSSL) -+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *)host; -@end diff --git a/iphone/src/objc/NSURLRequest+IgnoreSSL.m b/iphone/src/objc/NSURLRequest+IgnoreSSL.m deleted file mode 100644 index e43ff156a4a2d..0000000000000 --- a/iphone/src/objc/NSURLRequest+IgnoreSSL.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// NSURLRequest+IgnoreSSL.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "NSURLRequest+IgnoreSSL.h" - - -@implementation NSURLRequest (IgnoreSSL) - -+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *)host { - return YES; -} - -@end diff --git a/iphone/src/objc/RESTServiceMapping.h b/iphone/src/objc/RESTServiceMapping.h deleted file mode 100644 index 2a646da684e29..0000000000000 --- a/iphone/src/objc/RESTServiceMapping.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// RESTServiceMapping.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import -#import "HTTPResponse.h" -#import "HTTPMessage.h" - -@class HTTPVirtualDirectory; - -// |RESTServiceMapping| stores the tree of virtual directories. When the HTTP -// server recieves an http request, the request is forwarded through -// |HTTPServerController| to |RESTServiceMapping| which in turn delegates it to -// the appropriate |HTTPResource|. -@interface RESTServiceMapping : NSObject { - // Stores the root directory of the HTTP server - HTTPVirtualDirectory *serverRoot_; -} - -@property (nonatomic, copy) HTTPVirtualDirectory *serverRoot; - -- (id) initWithIpAddress:(NSString *)ipAddress - port:(int)port; - -- (NSObject *)httpResponseForRequest:(HTTPMessage*)request; - -@end diff --git a/iphone/src/objc/RESTServiceMapping.m b/iphone/src/objc/RESTServiceMapping.m deleted file mode 100644 index e351e8b904a51..0000000000000 --- a/iphone/src/objc/RESTServiceMapping.m +++ /dev/null @@ -1,144 +0,0 @@ -// -// RESTServiceMapping.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "RESTServiceMapping.h" -#import "HTTPJSONResponse.h" -#import "HTTPVirtualDirectory.h" -#import "HTTPStaticResource.h" -#import "HTTPRedirectResponse.h" -#import "JSONRESTResource.h" -#import "Session.h" -#import "SessionRoot.h" -#import "Status.h" -#import "HTTPResponse+Utility.h" - -@implementation RESTServiceMapping - -@synthesize serverRoot = serverRoot_; - -- (id)initWithIpAddress:(NSString *)ipAddress - port:(int)port { - if (![super init]) - return nil; - - serverRoot_ = [[HTTPVirtualDirectory alloc] init]; - - // This makes up for a bug in the java http client (r733). We forward - // requests for /session to /hub/session. - [serverRoot_ setResource:[[HTTPRedirectResponse alloc]initWithPath:@"/hub/session/"] - withName:@"session"]; - - // The root of our REST service. - HTTPVirtualDirectory *restRoot = [[[HTTPVirtualDirectory alloc] init] autorelease]; - [serverRoot_ setResource:restRoot withName:@"hub"]; - - // Respond to /status - [restRoot setResource:[[[Status alloc] init] autorelease] withName:@"status"]; - - // Make the root also accessible from /wd/hub. This will allow clients hard - // coded for the java Selenium server to also work with us. - HTTPVirtualDirectory *wd = [[[HTTPVirtualDirectory alloc] init] autorelease]; - [wd setResource:restRoot withName:@"hub"]; - [serverRoot_ setResource:wd withName:@"wd"]; - - HTTPDataResponse *response = - [[HTTPDataResponse alloc] - initWithData:[@"

iWebDriver ready.

" - "" - dataUsingEncoding:NSASCIIStringEncoding]]; - - [restRoot setIndex:[HTTPStaticResource resourceWithResponse:response]]; - [response release]; - - [restRoot setResource:[[SessionRoot alloc] initWithAddress:ipAddress port:[NSString stringWithFormat:@"%d", port] ] - withName:@"session"]; - - return self; -} - -// Extract message properties from an http request and return them. -// Pass nil in the |query|, |method| or |data| arguments to ignore. -+ (void)propertiesOfHTTPMessage:(HTTPMessage*)request - toQuery:(NSString **)query - toUri:(NSURL **)uri - method:(NSString **)method - data:(NSData **)data { - // Extract method - if (method != nil) { - *method = [request method]; - } - - // Extract requested URI - if (query != nil) { - *uri = [request url]; - *query = [*uri path]; - } - - // Extract POST data - if (data != nil) { - *data = [request body]; - } -} - -// Send the request to the right HTTPResource and return its response. -- (NSObject *)httpResponseForRequest:(HTTPMessage*)request { - - NSString *query; - NSURL *uri; - NSString *method; - NSData *data; - - [RESTServiceMapping propertiesOfHTTPMessage:request - toQuery:&query - toUri:&uri - method:&method - data:&data]; - - NSLog(@"Responding to request: %@ %@", method, query); - if (data) { - NSLog(@"data: '%@'", [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] - autorelease]); - } - - // Do the actual work. - id response = - [serverRoot_ httpResponseForQuery:query - method:method - withData:data]; - - // Unfortunately, WebDriver only supports absolute redirects (r733). We need - // to expand all relative redirects to absolute redirects. - if ([response isKindOfClass:[HTTPRedirectResponse class]]) { - NSString * path = [[(HTTPRedirectResponse *)response httpHeaders] objectForKey:@"Location"]; - response = [[HTTPRedirectResponse alloc] initWithPath: - [[NSString alloc] initWithFormat:@"http://%@:%@/wd/hub/%@", - [uri host], [uri port], path ] - ]; - NSLog(@"redirecting to: http://%@:%@/wd/hub/%@", [uri host], [uri port], path); - } - - if (response == nil) { - NSLog(@"404 - could not create response for request at %@", query); - } - - return response; -} - -@end diff --git a/iphone/src/objc/Session+ExecuteScript.h b/iphone/src/objc/Session+ExecuteScript.h deleted file mode 100644 index 0308dd5fd53d1..0000000000000 --- a/iphone/src/objc/Session+ExecuteScript.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// Session+ExecuteScript.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "Session.h" - -// This category implements the :context/execute and :context/execute_async -// functions. -@interface Session (ExecuteScript) - -// Executes a user supplied snippet of JavaScript. This resource handler expects -// its |arguments| dictionary to contain two keys: -// - script: The script to execute. The script should be a NSString defining -// a function body. -// - args: An array of arguments to pass to the script. The arguments may be -// referenced from the |script| via the arguments object. -// -// Returns the script result. -- (id)executeScript:(NSDictionary *)arguments; - -// Executes a user supplied asynchronous JavaScript snippet. -- (id)executeAsyncScript:(NSDictionary *)arguments; - -@end diff --git a/iphone/src/objc/Session+ExecuteScript.m b/iphone/src/objc/Session+ExecuteScript.m deleted file mode 100644 index 42c472dbc12af..0000000000000 --- a/iphone/src/objc/Session+ExecuteScript.m +++ /dev/null @@ -1,37 +0,0 @@ -// -// Session+ExecuteScript.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 "Session+ExecuteScript.h" - -#import "HTTPVirtualDirectory+ExecuteScript.h" - -@implementation Session (ExecuteScript) - --(id) executeScript:(NSDictionary *)arguments { - return [self executeJsFunction:[NSString stringWithFormat:@"function(){%@}", - [arguments objectForKey:@"script"]] - withArgs:[arguments objectForKey:@"args"]]; -} - --(id) executeAsyncScript:(NSDictionary*) arguments { - return [self executeAsyncJsFunction:[arguments objectForKey:@"script"] - withArgs:[arguments objectForKey:@"args"] - withTimeout:[self scriptTimeout]]; -} - -@end diff --git a/iphone/src/objc/Session.h b/iphone/src/objc/Session.h deleted file mode 100644 index 1170b155f382a..0000000000000 --- a/iphone/src/objc/Session.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Session.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class ElementStore; -@class SessionRoot; - -// This |HTTPVirtualDirectory| matches the /:session directory which WebDriver -// expects. -@interface Session : HTTPVirtualDirectory { - SessionRoot* sessionRoot_; - NSString* sessionId_; - ElementStore* elementStore_; - NSTimeInterval implicitWait_; - NSTimeInterval scriptTimeout_; -} - -@property (nonatomic, readonly) ElementStore* elementStore; -@property (nonatomic, retain) NSString *sessionId; -@property (nonatomic) NSTimeInterval implicitWait; -@property (nonatomic) NSTimeInterval scriptTimeout; - -- (id) initWithSessionRootAndSessionId:(SessionRoot*)root - sessionId:(NSString *)sessionId; - -- (void)cleanSessionStatus; - -// Deletes all from shared cookie storage on iPhone. If cookies are not deleted -// in between sessions than sessions become nondeterministic. -- (void)deleteAllCookies; - -// Deletes a session. Recursively destroys all inherited subtree of -// elements, etc. -- (void)deleteSession; - -@end diff --git a/iphone/src/objc/Session.m b/iphone/src/objc/Session.m deleted file mode 100644 index d47e92c004e13..0000000000000 --- a/iphone/src/objc/Session.m +++ /dev/null @@ -1,247 +0,0 @@ -// -// Session.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "Session.h" -#import "Cookie.h" -#import "ElementStore.h" -#import "JSONRESTResource.h" -#import "HTTPJSONResponse.h" -#import "HTTPResponse+Utility.h" -#import "HTTPServerController.h" -#import "HTTPVirtualDirectory+AccessViewController.h" -#import "HTTPVirtualDirectory+Remove.h" -#import "Session+ExecuteScript.h" -#import "SessionRoot.h" -#import "Storage.h" -#import "Timeouts.h" -#import "WebDriverResource.h" -#import "WebDriverResponse.h" -#import "WebDriverUtilities.h" -#import "WebViewController.h" -#import "Database.h" - -static NSString* const LOCAL_STORAGE = @"localStorage"; -static NSString* const SESSION_STORAGE = @"sessionStorage"; - -@implementation Session - -@synthesize elementStore = elementStore_; -@synthesize sessionId = sessionId_; -@synthesize implicitWait = implicitWait_; -@synthesize scriptTimeout = scriptTimeout_; - -// The WebViewController has most of the actual functionality this vdir exposes. -// We'll just forward most messages there. -- (void)setResourceToViewMethodGET:(SEL)getMethod - POST:(SEL)postMethod - withName:(NSString *)name { - [self setResource:[WebDriverResource resourceWithTarget:[self viewController] - GETAction:getMethod - POSTAction:postMethod] - withName:name]; -} - -- (id) initWithSessionRootAndSessionId:(SessionRoot*)root - sessionId:(NSString*)sessionId { - self = [super init]; - if (!self) { - return nil; - } - sessionRoot_ = root; - sessionId_ = [[NSString alloc] initWithString:sessionId]; - - [self setIndex:[WebDriverResource - resourceWithTarget:self - GETAction:@selector(capabilities) - POSTAction:NULL - PUTAction:NULL - DELETEAction:@selector(deleteSession)]]; - - // Set the view to be visible. This is ignored. - [self setResourceToViewMethodGET:@selector(visible) - POST:@selector(setVisible:) - withName:@"visible"]; - - // Browse to given URL / get current URL. - [self setResourceToViewMethodGET:@selector(URL) - POST:@selector(setURL:) - withName:@"url"]; - - // The current title of the web pane. - [self setResourceToViewMethodGET:@selector(currentTitle) - POST:NULL - withName:@"title"]; - - // Go back. - [self setResourceToViewMethodGET:NULL - POST:@selector(back:) - withName:@"back"]; - - // Go forward. - [self setResourceToViewMethodGET:NULL - POST:@selector(forward:) - withName:@"forward"]; - - // Refresh the page. - [self setResourceToViewMethodGET:NULL - POST:@selector(refresh:) - withName:@"refresh"]; - - // Get the loaded HTML - [self setResourceToViewMethodGET:@selector(source) - POST:NULL - withName:@"source"]; - - // Get a screenshot - [self setResourceToViewMethodGET:@selector(screenshot) - POST:NULL - withName:@"screenshot"]; - - // Get a window handle - [self setResourceToViewMethodGET:@selector(windowHandle) - POST:NULL - withName:@"window_handle"]; - - // Get a window handles - [self setResourceToViewMethodGET:@selector(windowHandles) - POST:NULL - withName:@"window_handles"]; - - // Get current orientation - // note not implementing the POST because the simulator and iphone - // can not be programmatically rotated via the api (that i can see) - [self setResourceToViewMethodGET:@selector(currentOrientation) - POST:NULL - withName:@"orientation"]; - - // switch to window - [self setResourceToViewMethodGET:NULL - POST:@selector(window:) - withName:@"window"]; - - // HTML5 Local WebStorage - [self setResource:[Storage storageWithType:LOCAL_STORAGE] - withName:@"local_storage"]; - - // HTML5 Session WebStorage - [self setResource:[Storage storageWithType:SESSION_STORAGE] - withName:@"session_storage"]; - - // HTML5 Get and Set GeoLocation - [self setResourceToViewMethodGET:@selector(location) - POST:@selector(setLocation:) - withName:@"location"]; - - // HTML5 Database Storage - [self setResource:[[Database alloc] init] - withName:@"execute_sql"]; - - // Execute JS function with the given body. - [self setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(executeScript:)] - withName:@"execute"]; - - [self setResource:[WebDriverResource - resourceWithTarget:self - GETAction:NULL - POSTAction:@selector(executeAsyncScript:)] - withName:@"execute_async"]; - - // |ElementStore| handles the /element virtual directory and all of its - // children. It also installs itself on this session for handling the - // /elements directory, which is used to find multiple DOM elements on the - // page. - elementStore_ = [ElementStore elementStoreForSession:self]; - - [self setResource:[[Cookie alloc] init] - withName:@"cookie"]; - - [self setResource:[Timeouts timeoutsForSession:self] - withName:@"timeouts"]; - - // switch to frame - [self setResourceToViewMethodGET:NULL - POST:@selector(frame:) - withName:@"frame"]; - - [self cleanSessionStatus]; - - return self; -} - -- (void)cleanSessionStatus{ - [WebDriverUtilities cleanCookies]; - [WebDriverUtilities cleanCache]; - [WebDriverUtilities cleanDatabases]; -} - -- (id)capabilities { - NSMutableDictionary *caps = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [[[[UIDevice currentDevice] model] componentsSeparatedByString:@" "] objectAtIndex:0], @"browserName", - @"MAC", @"platform", - [NSNumber numberWithBool:YES], @"javascriptEnabled", - [NSNumber numberWithBool:YES], @"webStorageEnabled", - [NSNumber numberWithBool:YES], @"databaseEnabled", - [NSNumber numberWithBool:YES], @"locationContextEnabled", - [NSNumber numberWithBool:YES], @"takesScreenshot", - [[UIDevice currentDevice] systemVersion], @"version", - nil]; - return caps; -} - -- (void)deleteSession { - NSLog( @"Delete session: %@", sessionId_ ); - [contents removeAllObjects]; - // Tell the session root to remove this resource. - [sessionRoot_ deleteSessionWithId:sessionId_]; -} - -- (void)deleteAllCookies { - NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; - NSEnumerator *enumerator = [cookies objectEnumerator]; - NSHTTPCookie *cookie = nil; - while ((cookie = [enumerator nextObject])) { - [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; - } -} - -- (void)dealloc { - [super dealloc]; -} - -#pragma mark Webdriver Resource configuration - -- (void)configureResource:(id)resource { - if ([resource respondsToSelector:@selector(setSession:)]) { - [(id)resource setSession:sessionId_]; - } -} - -- (id)elementWithQuery:(NSString *)query { - // Make sure the web view has finished all pending loads before continuing. - [[self viewController] waitForLoad]; - - id resource = [super elementWithQuery:query]; - [self configureResource:resource]; - return resource; -} - -@end diff --git a/iphone/src/objc/SessionRoot.h b/iphone/src/objc/SessionRoot.h deleted file mode 100644 index bf070f46551ea..0000000000000 --- a/iphone/src/objc/SessionRoot.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// SessionRoot.h -// iWebDriver -// -// Copyright 2010 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -// This |HTTPVirtualDirectory| matches the /session directory that serves as the -// root of the WebDriver REST service. -@interface SessionRoot : HTTPVirtualDirectory { - int nextId_; - NSString *ipAddress_; - NSString *port_; -} - -- (id)initWithAddress:(NSString *)ipAddress - port:(NSString *)port; - -- (NSObject *)createSessionWithData:(id)desiredCapabilities - method:(NSString*)method; -- (void)deleteSessionWithId:(NSString *)sessionId; - -@end; diff --git a/iphone/src/objc/SessionRoot.m b/iphone/src/objc/SessionRoot.m deleted file mode 100644 index ce8fafee46203..0000000000000 --- a/iphone/src/objc/SessionRoot.m +++ /dev/null @@ -1,87 +0,0 @@ -// -// SessionRoot.m -// iWebDriver -// -// Copyright 2010 Google Inc. -// Copyright 2011 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 "SessionRoot.h" -#import "HTTPRedirectResponse.h" -#import "JSONRESTResource.h" -#import "Session.h" - -@implementation SessionRoot - - -- (id)initWithAddress:(NSString*)ipAddress - port:(NSString *)port { - if (![super init]) - return nil; - - // Sessions are created by POSTing to /hub/session with - // a set of |DesiredCapabilities|. - [self setIndex:[JSONRESTResource - JSONResourceWithTarget:self - action:@selector(createSessionWithData:method:)]]; - - // Session IDs start at 1001. - nextId_ = 1001; - ipAddress_ = [[NSString alloc] initWithString:ipAddress]; - port_ = [[NSString alloc] initWithString:port]; - - return self; -} - -// TODO (josephg): We really only support one session. Error (or ignore the -// request) if the session is already created. When the session exists, change -// the service we advertise using zeroconf. - -// Create a session. This method is bound to the index of /hub/session/ -- (NSObject *)createSessionWithData:(id)desiredCapabilities - method:(NSString *)method { - - if (![method isEqualToString:@"POST"] && ![method isEqualToString:@"GET"]) - return nil; - - NSString* sessionId = [NSString stringWithFormat:@"%@:%@:%d", ipAddress_, port_, nextId_++]; - - NSLog(@"session %@ created", sessionId); - - // Sessions don't really mean anything on the iphone. There's only one - // browser and only one session. - - // But we would like to give a clean status by cleaning up application data, - // in particular, cookies, cache and HTML5 client-side storage. - Session* session = [[[Session alloc] - initWithSessionRootAndSessionId:self - sessionId:sessionId] autorelease]; - - [self setResource:session withName:sessionId]; - - return [[HTTPRedirectResponse alloc] initWithPath: - [NSString stringWithFormat:@"session/%@/", sessionId]]; -} - -- (void) deleteSessionWithId:(NSString *)sessionId { - [self setResource:nil withName:sessionId]; - NSLog(@"session %@ deleted", sessionId); -} - -- (void)dealloc { - [super dealloc]; -} - -@end - diff --git a/iphone/src/objc/Status.h b/iphone/src/objc/Status.h deleted file mode 100644 index 0e0224eb096e0..0000000000000 --- a/iphone/src/objc/Status.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// Status.h -// iWebDriver -// -// Created by Luke Inman-Semerau on 11/17/11. -// Copyright (c) 2011 Free Software Conservancy. All rights reserved. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@interface Status : HTTPVirtualDirectory - -@end diff --git a/iphone/src/objc/Status.m b/iphone/src/objc/Status.m deleted file mode 100644 index 6277089beb12a..0000000000000 --- a/iphone/src/objc/Status.m +++ /dev/null @@ -1,70 +0,0 @@ -// -// Status.m -// iWebDriver -// -// Created by Luke Inman-Semerau on 11/17/11. -// Copyright (c) 2011 Free Software Conservancy. All rights reserved. -// -// 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 "JSONRESTResource.h" -#import "NSObject+SBJson.h" -#import "Status.h" -#import "HTTPDataResponse.h" - -@implementation Status - -- (id) init { - self = [super init]; - if (!self) { - return nil; - } - - return self; -} - -- (NSObject *) httpResponseForQuery: (NSString *)query - method:(NSString *)method - withData:(NSData *)theData { - - NSDictionary *osDict = [NSDictionary dictionaryWithObjectsAndKeys: - [[[[UIDevice currentDevice] model] componentsSeparatedByString:@" "] objectAtIndex:0], @"arch", - @"iOS", @"name", - [[UIDevice currentDevice] systemVersion], @"version", - nil]; - -// TODO have crazy-fun create a new .h file that will have this info in it -// -// NSDictionary *buildDict = [NSDictionary dictionaryWithObjectsAndKeys: -// @"SVN_REVISION", @"revision", -// @"BUILD_TIMESTAMP", @"time", -// @"RELEASE", @"version", nil]; - - NSDictionary *dataDict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSDictionary dictionaryWithObjectsAndKeys: - osDict, @"os", - //buildDict, @"build", - nil], - @"value", nil]; - - NSData *data = [[dataDict JSONRepresentation] dataUsingEncoding:NSUTF8StringEncoding]; - - return [[[HTTPDataResponse alloc] initWithData:data] autorelease]; -} - -- (id)elementWithQuery:(NSString *)query { - return self; -} - -@end diff --git a/iphone/src/objc/Storage.h b/iphone/src/objc/Storage.h deleted file mode 100644 index 313d89dbbe15b..0000000000000 --- a/iphone/src/objc/Storage.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - Copyright 2011 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 -#import "HTTPVirtualDirectory.h" - -@class WebDriverResource; - -// This |HTTPVirtualDirectory| matches the /hub/:session/local_storage -// | session_storage directory in the WebDriver REST service. -@interface Storage : HTTPVirtualDirectory { - NSString *storageType_; -} - -- (id)initWithType:(NSString *)type; - -+ (Storage *)storageWithType:(NSString *)type; - -- (NSString *)storageSize; -- (NSArray *)keySet; -- (void)setItem:(NSDictionary *)items; -- (void)clearStorage; - -@end - -// This |HTTPVirtualDirectory| matches the /hub/:session/local_storage/:key -// | session_storage/:key directory in the WebDriver REST service. -@interface KeyedStorage : HTTPVirtualDirectory { - NSString *storageType_; - NSString *key_; -} - -- (id)initWithType:(NSString *)type; - -- (NSString *)getItem; -- (NSString *)removeItem; - -@end - diff --git a/iphone/src/objc/Storage.m b/iphone/src/objc/Storage.m deleted file mode 100644 index 8eaef9ac492de..0000000000000 --- a/iphone/src/objc/Storage.m +++ /dev/null @@ -1,150 +0,0 @@ -/* - Copyright 2010 WebDriver committers - Copyright 2010 Google Inc. - - 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 "Storage.h" -#import "WebDriverResource.h" -#import "WebViewController.h" -#import "HTTPVirtualDirectory+AccessViewController.h" - -@implementation Storage - -- (id)initWithType:(NSString *)type { - self = [super init]; - if (!self) { - return nil; - } - storageType_ = type; - - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(keySet) - POSTAction:@selector(setItem:) - PUTAction:NULL - DELETEAction:@selector(clearStorage)]]; - - [self setResource:[WebDriverResource resourceWithTarget:self - GETAction:@selector(storageSize) - POSTAction:NULL] - withName:@"size"]; - - [self setResource:[[[KeyedStorage alloc] initWithType:type] autorelease] - withName:@"key"]; - - return self; -} - -+ (Storage *)storageWithType:(NSString *)type { - return [[[Storage alloc] initWithType:type] autorelease]; -} - - -- (NSNumber *)storageSize { - NSString *size = [[self viewController] jsEval:[NSString stringWithFormat: - @"%@.length", storageType_]]; - if ([size isEqualToString:@""]) { - size = @"0"; - } - NSNumberFormatter * f = [[NSNumberFormatter alloc] init]; - [f setNumberStyle:NSNumberFormatterDecimalStyle]; - NSNumber * sizeN = [f numberFromString:size]; - [f release]; - return sizeN; -} - -- (NSArray *)keySet { - NSString *result; - int length = [[self storageSize] intValue]; - NSMutableArray *keys = [NSMutableArray arrayWithCapacity:length]; - if (length > 0) { - for (int itemIndex = 0; itemIndex < length; itemIndex++) { - result = [[self viewController] jsEval:[NSString stringWithFormat: - @"%@.key(%d)", - storageType_, itemIndex]]; - [keys addObject:result]; - } - } - return keys; -} - -- (void)setItem:(NSDictionary *)items { - NSString *key = [items objectForKey:@"key"]; - NSString *value = [items objectForKey:@"value"]; - [[self viewController] jsEval:[NSString stringWithFormat: - @"%@.setItem('%@', '%@')", - storageType_, key, value]]; -} - -- (void)clearStorage { - [[self viewController] jsEval:[NSString stringWithFormat: - @"%@.clear()", storageType_]]; -} - -- (void)dealloc { - [storageType_ release]; - [super dealloc]; -} - -@end - -@implementation KeyedStorage - -- (id)initWithType:(NSString *)type { - if (![super init]) { - return nil; - } - key_ = nil; - storageType_ = type; - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getItem) - POSTAction:NULL - PUTAction:NULL - DELETEAction:@selector(removeItem)]]; - return self; -} - -- (NSString *)getItem { - NSString* item = [[self viewController] jsEval:[NSString stringWithFormat: - @"%@.getItem('%@')", - storageType_, key_]]; - key_ = nil; - return item; -} - -- (NSString *)removeItem { - NSString* item = [[self viewController] jsEval:[NSString stringWithFormat: - @"(function(key) {\n" - " var temp=%@.getItem(key);\n" - " %@.removeItem(key);\n" - " return temp;\n" - "})('%@')", - storageType_, storageType_, key_]]; - key_ = nil; - return item; -} - -- (id)elementWithQuery:(NSString*) key { - if ([key characterAtIndex:0] == '/') { - key_ = [key substringFromIndex:1]; - } else { - key_ = key; - } - return [super elementWithQuery:@""]; -} - -@end - diff --git a/iphone/src/objc/Timeouts.h b/iphone/src/objc/Timeouts.h deleted file mode 100644 index cf2d44091c958..0000000000000 --- a/iphone/src/objc/Timeouts.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// Timeouts.h -// iWebDriver -// -// Copyright 2010 Google Inc. -// -// 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 -#import "HTTPVirtualDirectory.h" - -@class Session; - -// This |HTTPVirtualDirectory| matches the /hub/:session/timeouts -// directory in the WebDriver REST service. -@interface Timeouts : HTTPVirtualDirectory { - Session* session_; -} - -- (id)initWithSession:(Session*)session; - -+ (Timeouts*)timeoutsForSession:(Session*)session; - -@end - -// This |HTTPVirtualDirectory| matches the /hub/:session/timeouts/implicit_wait -// directory in the WebDriver REST service. -@interface ImplicitWait : HTTPVirtualDirectory { - Session* session_; -} - -- (id)initWithSession:(Session*)session; - -+ (ImplicitWait*)implicitWaitForSession:(Session*)session; - -- (long)getImplicitWait; -- (void)setImplicitWait:(NSDictionary *)params; -- (void)clearImplicitWait; - -@end - -// This |HTTPVirtualDirectory| -@interface ScriptTimeout : HTTPVirtualDirectory { - Session* session_; -} - -- (id)initWithSession:(Session*)session; - -+ (ScriptTimeout*)scriptTimeoutForSession:(Session*)session; - -- (long)getScriptTimeout; -- (void)setScriptTimeout:(NSDictionary *)params; -- (void)clearScriptTimeout; - -@end \ No newline at end of file diff --git a/iphone/src/objc/Timeouts.m b/iphone/src/objc/Timeouts.m deleted file mode 100644 index 097ea77719af3..0000000000000 --- a/iphone/src/objc/Timeouts.m +++ /dev/null @@ -1,132 +0,0 @@ -// -// Timeouts.m -// iWebDriver -// -// Copyright 2010 Google Inc. -// -// 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 "Timeouts.h" -#import "Session.h" -#import "WebDriverResource.h" - -@implementation Timeouts - -- (id)initWithSession:(Session*)session { - self = [super init]; - if (!self) { - return nil; - } - [self setResource:[ScriptTimeout scriptTimeoutForSession:session] - withName:@"async_script"]; - [self setResource:[ImplicitWait implicitWaitForSession:session] - withName:@"implicit_wait"]; - return self; -} - -+ (Timeouts*) timeoutsForSession:(Session*)session { - return [[[Timeouts alloc] initWithSession:session] autorelease]; -} - -@end - -@implementation ImplicitWait - -- (id)initWithSession:(Session*)session { - self = [super init]; - if (!self) { - return nil; - } - session_ = session; - [session_ retain]; - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getImplicitWait) - POSTAction:@selector(setImplicitWait:) - PUTAction:NULL - DELETEAction:@selector(clearImplicitWait)]]; - return self; -} - -- (void) dealloc { - [session_ release]; - [super dealloc]; -} - - -+ (ImplicitWait*) implicitWaitForSession:(Session*)session { - return [[[ImplicitWait alloc] initWithSession:session] autorelease]; -} - -- (long) getImplicitWait { - return [session_ implicitWait]; -} - -- (void) setImplicitWait:(NSDictionary *)params { - NSNumber* number = (NSNumber*) [params objectForKey:@"ms"]; - NSLog(@"Setting implicit waits to %@ms", number); - NSTimeInterval wait = [number doubleValue] / 1000.0; - [session_ setImplicitWait:wait]; -} - -- (void) clearImplicitWait { - [session_ setImplicitWait:0]; -} - -@end - -@implementation ScriptTimeout - -- (id)initWithSession:(Session*)session { - self = [super init]; - if (!self) { - return nil; - } - session_ = session; - [session_ retain]; - [self setIndex: - [WebDriverResource resourceWithTarget:self - GETAction:@selector(getScriptTimeout) - POSTAction:@selector(setScriptTimeout:) - PUTAction:NULL - DELETEAction:@selector(clearScriptTimeout)]]; - return self; -} - -- (void) dealloc { - [session_ release]; - [super dealloc]; -} - - -+ (ScriptTimeout*) scriptTimeoutForSession:(Session*)session { - return [[[ScriptTimeout alloc] initWithSession:session] autorelease]; -} - -- (long) getScriptTimeout { - return [session_ scriptTimeout]; -} - -- (void) setScriptTimeout:(NSDictionary *)params { - NSNumber* number = (NSNumber*) [params objectForKey:@"ms"]; - NSLog(@"Setting script timeouts to %@ms", number); - NSTimeInterval wait = [number doubleValue] / 1000.0; - [session_ setScriptTimeout:wait]; -} - -- (void) clearScriptTimeout { - [session_ setScriptTimeout:0]; -} - -@end diff --git a/iphone/src/objc/UIResponder+SimulateTouch.h b/iphone/src/objc/UIResponder+SimulateTouch.h deleted file mode 100644 index a572791e22430..0000000000000 --- a/iphone/src/objc/UIResponder+SimulateTouch.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// UIResponder+SimulateTouch.h -// iWebDriver -// -// Created by Joseph Gentle on 1/22/09. -// Copyright 2009 Google Inc. All rights reserved. -// - -#import - -// This category contains a set of methods for simulating touch events on the -// view. It assumes no actual fingers are touching the view at the time the -// simulation occurs. -@interface UIResponder (SimulateTouch) - -// Simulate a single tap on a given pixel -- (void)simulateTapAt:(CGPoint)point; - -@end diff --git a/iphone/src/objc/UIResponder+SimulateTouch.m b/iphone/src/objc/UIResponder+SimulateTouch.m deleted file mode 100644 index 49e6c2740ff67..0000000000000 --- a/iphone/src/objc/UIResponder+SimulateTouch.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// UIResponder+SimulateTouch.m -// iWebDriver -// -// Created by Joseph Gentle on 1/22/09. -// Copyright 2009 Google Inc. All rights reserved. -// - -#import "UIResponder+SimulateTouch.h" - - -@implementation UIResponder (SimulateTouch) - -// TODO: Complete me. -- (void)simulateTapAt:(CGPoint)point { - -} - -@end diff --git a/iphone/src/objc/WebDriverHTTPConnection.h b/iphone/src/objc/WebDriverHTTPConnection.h deleted file mode 100644 index 6b695857645c7..0000000000000 --- a/iphone/src/objc/WebDriverHTTPConnection.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// WebDriverHTTPConnection.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "HTTPConnection.h" - -// |WebDriverHTTPConnection| overrides some of the HTTPConnection methods to -// change the default behaviour. -// We allow all HTTP methods. We forward requests to the |RESTServiceMapping| -// instead of looking for files on the file system and we implement a custom -// 404 response. -@interface WebDriverHTTPConnection : HTTPConnection { - -} - -@end diff --git a/iphone/src/objc/WebDriverHTTPConnection.m b/iphone/src/objc/WebDriverHTTPConnection.m deleted file mode 100644 index 6118356dbd383..0000000000000 --- a/iphone/src/objc/WebDriverHTTPConnection.m +++ /dev/null @@ -1,69 +0,0 @@ -// -// WebDriverHTTPConnection.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "WebDriverHTTPConnection.h" -#import "WebViewController.h" -#import "HTTPServerController.h" -#import "HTTPMessage.h" - -@implementation WebDriverHTTPConnection - -- (NSObject *)httpResponseForRequest:(HTTPMessage*)theRequest { - // Forward the message to our |RESTServiceMapping| instance. - return [[HTTPServerController sharedInstance] httpResponseForRequest:theRequest]; -} - -- (NSObject *)httpResponseForMethod:(NSString *)method - URI:(NSString *)path { - return [self httpResponseForRequest:request]; -} - -- (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path { - // It is up to the |HTTPResource| to determine if it supports a given method. - // If it doesn't, we'll throw a custom exception. - return YES; -} - -// Overriding this method since CocoaHTTPServer is just a pass and it doesn't -// do anything with the POST data otherwise. See HTTPConnection.m -- (void)processBodyData:(NSData *)postDataChunk{ - [request appendData:postDataChunk]; -} - -- (NSData *)preprocessErrorResponse:(HTTPMessage *)response { - // Return a token 404 message. - if([response statusCode] == 404) { - NSString *msg = @"Error 404 - Not Found"; - [response setBody:[msg dataUsingEncoding:NSUTF8StringEncoding]]; - -// NSString *contentLengthStr = -// [NSString stringWithFormat:@"%u", -// (unsigned)[msgData length]]; - - -// CFHTTPMessageSetHeaderFieldValue(response, -// CFSTR("Content-Length"), -// (CFStringRef)contentLengthStr); - } - - return [super preprocessErrorResponse:response]; -} - - -@end diff --git a/iphone/src/objc/WebDriverPreferences.h b/iphone/src/objc/WebDriverPreferences.h deleted file mode 100644 index cee1f1f4ae7c7..0000000000000 --- a/iphone/src/objc/WebDriverPreferences.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// WebDriverPreferences.h -// iWebDriver -// -// Created by Yu Chen on 5/11/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import - -@interface WebDriverPreferences : NSObject { - // Can be "Client" or "Server". - NSString* mode_; - - NSUInteger diskCacheCapacity_; - NSUInteger memoryCacheCapacity_; - NSURLRequestCachePolicy cachePolicy_; - - NSString* gridUrl_; - // Preferences used when iWebDriver is running in server mode. - UInt16 serverPortNumber_; - - // Preferences used when iWebDriver is running in client mode. - NSString* connectorAddr_; - NSString* connectorPathPrefix_; - NSString* requesterId_; -} - -@property (readonly, nonatomic, copy) NSString *mode; - -@property (readonly, nonatomic) NSUInteger diskCacheCapacity; -@property (readonly, nonatomic) NSUInteger memoryCacheCapacity; -@property (readonly, nonatomic) NSURLRequestCachePolicy cache_policy; - -@property (readonly, nonatomic) UInt16 serverPortNumber; -@property (readonly, nonatomic) NSString *gridLocation; -@property (readonly, nonatomic) NSString *gridPort; -@property (readonly, nonatomic, copy) NSString *connectorAddr; -@property (readonly, nonatomic, copy) NSString *requesterId; - -// Singleton -+ (WebDriverPreferences *)sharedInstance; -@end diff --git a/iphone/src/objc/WebDriverPreferences.m b/iphone/src/objc/WebDriverPreferences.m deleted file mode 100644 index 018ca6531aa97..0000000000000 --- a/iphone/src/objc/WebDriverPreferences.m +++ /dev/null @@ -1,166 +0,0 @@ -// -// WebDriverPreferences.m -// iWebDriver -// -// Created by Yu Chen on 5/11/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "WebDriverPreferences.h" - -static NSString * const PREF_MODE = @"preference_mode"; - -static NSString * const PREF_DISK_CACHE_CAPACITY = @"preference_disk_cache_capacity"; -static NSString * const PREF_MEMORY_CACHE_CAPACITY = @"preference_memory_cache_capacity"; -static NSString * const PREF_CACHE_POLICY = @"preference_cache_policy"; - -static NSString * const PREF_SERVER_MODE_PORT_NUMBER = @"preference_server_mode_port_number"; -static NSString * const PREF_GRID_HOST = @"preference_grid_mode_host"; -static NSString * const PREF_GRID_PORT = @"preference_grid_mode_port"; -static NSString * const PREF_CLIENT_MODE_CONNECTOR_ADDRESS = @"preference_client_mode_connector_address"; -static NSString * const PREF_CLIENT_MODE_REQUESTER_ID = @"preference_client_mode_requester_id"; - -@implementation WebDriverPreferences - -@synthesize mode = mode_; -@synthesize diskCacheCapacity = diskCacheCapacity_; -@synthesize memoryCacheCapacity = memoryCacheCapacity_; -@synthesize cache_policy = cachePolicy_; -@synthesize serverPortNumber = serverPortNumber_; -@synthesize gridLocation = gridLocation_; -@synthesize gridPort = gridPort_; -@synthesize connectorAddr = connectorAddr_; -@synthesize requesterId = requesterId_; - -static WebDriverPreferences *singleton = nil; -+ (WebDriverPreferences*) sharedInstance { - if (singleton == nil) { - singleton = [[WebDriverPreferences alloc] init]; - } - return singleton; -} - -+ (void) validateConnectorAddr:(NSString*) connAddr{ - // e.g., http://the.addr.of.connector:8801/ll - if (connAddr == nil || - [connAddr isEqualToString:@""] || - [NSURL URLWithString: connAddr] == nil){ - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"Invalide Connector Address." - userInfo:nil]; - } -} - -+ (void) validateRequesterId:(NSString*) reqId { - // e.g., 171.23.11.11, mytestID - if (reqId == nil ||[reqId isEqualToString:@""]) { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"Invalide Requester Id." - userInfo:nil]; - } -} - -+ (void) initPreferences { - NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; - id mode = [userDefaults objectForKey:PREF_MODE]; - id port = [userDefaults objectForKey:PREF_SERVER_MODE_PORT_NUMBER]; - - if (mode == nil || port == nil) { - NSLog(@"Initializing app settings to default values."); - - NSString* bundlePath = [[NSBundle mainBundle] bundlePath]; - NSString* settingsPath = [bundlePath stringByAppendingPathComponent: - @"Settings.bundle"]; - NSString* rootPlist = [settingsPath stringByAppendingPathComponent: - @"Root.plist"]; - - NSDictionary* settings = [NSDictionary dictionaryWithContentsOfFile: - rootPlist]; - NSArray* preferences = [settings objectForKey:@"PreferenceSpecifiers"]; - - NSMutableDictionary* defaultPrefs = - [NSMutableDictionary dictionaryWithCapacity:[preferences count]]; - for (NSDictionary* item in preferences) { - id key = [item objectForKey:@"Key"]; - if (key != nil) { - [defaultPrefs setObject:[item objectForKey:@"DefaultValue"] - forKey:key]; - } - } - - [[NSUserDefaults standardUserDefaults] registerDefaults:defaultPrefs]; - [[NSUserDefaults standardUserDefaults] synchronize]; - } else { - NSLog(@"App settings already initialized. Mode is %@", mode); - } -} - - -- (id)init { - [WebDriverPreferences initPreferences]; - - // Fetching paramters from [NSUserDefaults standardUserDefaults]. - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - // mode can be "Server" or "Client" - mode_ = [defaults stringForKey:PREF_MODE]; - if (!mode_) { - mode_ = @"Server"; - [defaults setObject:mode_ forKey:PREF_MODE]; - } - - diskCacheCapacity_ = [defaults integerForKey:PREF_DISK_CACHE_CAPACITY]; - if (!diskCacheCapacity_) { - diskCacheCapacity_ = 0; - [defaults setObject:@"0" forKey:PREF_DISK_CACHE_CAPACITY]; - } - memoryCacheCapacity_ = [defaults integerForKey:PREF_MEMORY_CACHE_CAPACITY]; - if (!memoryCacheCapacity_) { - memoryCacheCapacity_ = 0; - [defaults setObject:@"0" forKey:PREF_MEMORY_CACHE_CAPACITY]; - } - cachePolicy_ = [defaults integerForKey:PREF_CACHE_POLICY]; - - - if ([mode_ isEqualToString:@"Client"]) { - connectorAddr_ = [defaults stringForKey:PREF_CLIENT_MODE_CONNECTOR_ADDRESS]; - if (!connectorAddr_) { - connectorAddr_ = @"www.connector.addr"; - [defaults setObject:connectorAddr_ forKey:PREF_CLIENT_MODE_CONNECTOR_ADDRESS]; - } - [WebDriverPreferences validateConnectorAddr:connectorAddr_]; - - requesterId_ = [defaults stringForKey:PREF_CLIENT_MODE_REQUESTER_ID]; - if (!requesterId_) { - requesterId_ = @"requesterId"; - [defaults setObject:requesterId_ forKey:PREF_CLIENT_MODE_REQUESTER_ID]; - } - [WebDriverPreferences validateRequesterId:requesterId_]; - } else if ([mode_ isEqualToString:@"Server"]) { - serverPortNumber_ = - (UInt16) [defaults integerForKey:PREF_SERVER_MODE_PORT_NUMBER]; - } else { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"Invalid mode." - userInfo:nil]; - } - - NSString *gridHost = [defaults stringForKey:PREF_GRID_HOST]; - gridPort_ = [defaults stringForKey:PREF_GRID_PORT]; - if ([gridHost length] > 0 && [gridPort_ length] > 0) { - gridLocation_ = [NSString stringWithFormat: @"%@", gridHost]; - } - - - [defaults synchronize]; - return self; -} - -- (void)dealloc { - [mode_ release]; - [connectorAddr_ release]; - [requesterId_ release]; - [super dealloc]; -} - -@end diff --git a/iphone/src/objc/WebDriverRequestFetcher.h b/iphone/src/objc/WebDriverRequestFetcher.h deleted file mode 100644 index 96b43099a9836..0000000000000 --- a/iphone/src/objc/WebDriverRequestFetcher.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// WebDriverRequestFetcher.h -// iWebDriver -// -// Created by Yu Chen on 4/16/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// -#import -#import "HTTPResponse.h" -@class RESTServiceMapping; -@class WebViewController; - -// This class fetches webdriver requests from a server (connector) that connects -// webdriver requesters and iWebdrivers; the targeted requester is identified by -// requesterId. -@interface WebDriverRequestFetcher : NSObject { - NSString* connectorAddr; - NSString* requesterId; - - WebViewController *viewController_; - RESTServiceMapping *serviceMapping_; - - NSString *status_; -} - -@property (retain, nonatomic) WebViewController *viewController; -@property (retain, nonatomic) RESTServiceMapping* serviceMapping; -@property (readonly, nonatomic, copy) NSString *status; - -// Singleton -+ (WebDriverRequestFetcher *)sharedInstance; -@end diff --git a/iphone/src/objc/WebDriverRequestFetcher.m b/iphone/src/objc/WebDriverRequestFetcher.m deleted file mode 100644 index ed75bc2b7afc4..0000000000000 --- a/iphone/src/objc/WebDriverRequestFetcher.m +++ /dev/null @@ -1,392 +0,0 @@ -// -// WebDriverRequestFetcher.m -// iWebDriver -// -// Created by Yu Chen on 4/16/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// -#import "WebDriverRequestFetcher.h" - -#import "HTTPJSONResponse.h" -#import "HTTPRedirectResponse.h" -#import "HTTPResponse+Utility.h" -#import "NSObject+SBJSON.h" -#import "RESTServiceMapping.h" -#import "WebDriverPreferences.h" - -// Initial sleeping time interval used by exponential backoff in -// fetching webdriver requests. -static float INIT_SLEEPING_TIME_INTERVAL = 0.05f; -static float MAX_SLEEPING_TIME_INTERVAL = 300; - -@implementation WebDriverRequestFetcher - -@synthesize serviceMapping = serviceMapping_; -@synthesize viewController = viewController_; -@synthesize status = status_; - -static WebDriverRequestFetcher *singleton = nil; -+ (WebDriverRequestFetcher*) sharedInstance { - if (singleton == nil) { - singleton = [[WebDriverRequestFetcher alloc] init]; - } - return singleton; -} - -- (id) init { - if (![super init]) { - return nil; - } - - WebDriverPreferences *preferences = [WebDriverPreferences sharedInstance]; - connectorAddr = [preferences connectorAddr]; - requesterId = [preferences requesterId]; - - serviceMapping_ = [[RESTServiceMapping alloc] initWithIpAddress:connectorAddr port:3001 ]; - status_ = [[NSString alloc] initWithFormat:@"Driven by requests from %@ routed by %@", - requesterId, connectorAddr]; - - // Forks fetching thread. - [NSThread detachNewThreadSelector:@selector(fetchAndProcessRequests) - toTarget:self - withObject:nil]; - return self; -} - -// The following methods are for fetching/processing/responding webdriver requests. - -/* - * Part I: Utility methods. - */ - -// Convertion between JSON data and a dictionary/array. -+ (NSDictionary*) convertJsonDataToDictionary:(NSData*) jsonData { - NSString *jsonString = [[[NSString alloc] initWithData:jsonData - encoding:NSUTF8StringEncoding] autorelease]; - id jsonDict = [jsonString JSONValue]; - if (jsonDict == nil || ![jsonDict isKindOfClass:[NSDictionary class]]) { - NSLog(@"Invalid data - Expecting a dictionary but given '%@'", jsonString); - return nil; - } - return (NSDictionary*) jsonDict; -} - -+ (NSData*) convertDictionaryToData:(NSDictionary*) dictionary{ - return [[[NSData alloc] initWithData: - [[dictionary JSONRepresentation] dataUsingEncoding:NSUTF8StringEncoding]] - autorelease]; -} - -+ (NSData*) convertJsonArrayToData:(NSArray*) array{ - return [[[NSData alloc] initWithData: - [[array JSONRepresentation] dataUsingEncoding:NSUTF8StringEncoding]] - autorelease]; -} - -// Return whether a query is to find an element in the form of -// /hub/session/%session_id/element -+ (BOOL) isFindElementQuery:(NSString*) query { - NSArray* pathItems = [query componentsSeparatedByString:@"/"]; - NSString* api = [pathItems lastObject]; - return ([api isEqualToString:@"element"]) && ([pathItems count] == 6); -} - -// Send a request to the connector, which always responses with a webdriver request in json -// representation. -+ (NSDictionary*) sendRequest:(NSURLRequest*) request { - NSHTTPURLResponse *response; - NSData* fetchedData = [NSURLConnection sendSynchronousRequest:request - returningResponse:&response - error:nil]; - if ([response statusCode] != 200) { - return nil; - } - return [WebDriverRequestFetcher convertJsonDataToDictionary:fetchedData]; -} - -// Get response data from a response. -+ (NSData*) getResponseData:(id) response { - UInt64 contentLength = response ? [response contentLength] : 0; - return [response readDataOfLength:contentLength]; -} - -// Generate a response body string from a given response data and with the additional information. -+ (NSString*) generateResponseBodyString:(NSData*) data - withReqArriveTime:(NSDate*) reqArriveTime - withRespSendingSTime:(NSDate*) respSendingSTime { - // Get the response data in string. - NSString *cmdRespBodyStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - - // Add additional information. - id respBody = [cmdRespBodyStr JSONValue]; - if (respBody != nil && [respBody isKindOfClass:[NSDictionary class]]) { - NSMutableDictionary* respDict = (NSMutableDictionary *) respBody; - // Add timing information - [respDict setValue:[NSString stringWithFormat:@"%f", [reqArriveTime timeIntervalSince1970]] - forKey:@"requestArriveTime"]; - [respDict setValue:[NSString stringWithFormat:@"%f", [respSendingSTime timeIntervalSince1970]] - forKey:@"responseSendingStartTime"]; - - // Add cache status. - NSURLCache* sharedCache = [NSURLCache sharedURLCache]; - [respDict setValue:[NSString stringWithFormat:@"%luB", [sharedCache currentDiskUsage]] - forKey:@"currentCacheDiskUsage"]; - [respDict setValue:[NSString stringWithFormat:@"%luB", [sharedCache currentMemoryUsage]] - forKey:@"currentCacheMemoryUsage"]; - - return [respDict JSONRepresentation]; - } else { - return cmdRespBodyStr; - } -} - -/* - * Part II: Methods called in each step in processing webdriver requests. - */ - -// Parse a webdriver request. --(void)parseWebDriverRequest:(NSDictionary*)wdRequest - queryRef:(NSString **)queryRef - methodRef:(NSString **)methodRef - dataRef:(NSData **)dataRef - actionsRef:(NSArray **)actionsRef{ - // 1. Get method - *methodRef = [[wdRequest objectForKey:@"Method"] objectAtIndex:0]; - - // 2. Get query, which should be the path relative to connectorAddr. - NSString *urlStr = [[wdRequest objectForKey:@"URL"] objectAtIndex:0]; - NSString *path = [[[[NSURL alloc] initWithString:urlStr] autorelease] path]; - NSString *connPath = [[[[NSURL alloc] initWithString:connectorAddr] autorelease] path]; - NSRange range = [path rangeOfString:connPath]; - *queryRef = [path substringFromIndex:(range.location + range.length)]; - - // 3. Get data - // 3.1 Get dataString and actionsRef (nil) for regular queries. - NSString* dataString = [[wdRequest objectForKey:@"Body"] objectAtIndex:0]; - *actionsRef = nil; - - // 3.2. Get dataString and actions for query findElement, which should be in the form of - // [by, value, actions]. An example is ["name", "signIn", [["click", ""]] - if ([WebDriverRequestFetcher isFindElementQuery:(*queryRef)]) { - id dataItems = [dataString JSONValue]; - if ([dataItems isKindOfClass:[NSArray class]] && [(NSArray*) dataItems count] >= 3) { - // Get the data for query findElement. - NSMutableArray* findElementDataArray = [NSMutableArray arrayWithCapacity:2]; - [findElementDataArray addObject:[dataItems objectAtIndex:0]]; - [findElementDataArray addObject:[dataItems objectAtIndex:1]]; - dataString = [findElementDataArray JSONRepresentation]; - - // Get actions that will be performed on the found element. - if ([[dataItems objectAtIndex:2] isKindOfClass:[NSArray class]]) { - *actionsRef = [NSArray arrayWithArray:(NSArray*) [dataItems objectAtIndex:2]]; - } - } - } - - // 3.3 Generate data - *dataRef = [[[NSData alloc] - initWithData:[dataString dataUsingEncoding:NSUTF8StringEncoding]] autorelease]; -} - -// Process the webdriver request. --(id)httpResponseForQuery:(NSString *)query - method:(NSString *)method - data:(NSData *)data { - // Create an CFHTTPMessageRef with method, url and bodyData - CFURLRef baseURL = CFURLCreateWithString(kCFAllocatorDefault, (CFStringRef)connectorAddr, nil); - CFURLRef cfURL = CFURLCreateWithString(kCFAllocatorDefault, (CFStringRef)query, baseURL); - - CFHTTPMessageRef message = CFHTTPMessageCreateRequest( - kCFAllocatorDefault, (CFStringRef)method, cfURL, kCFHTTPVersion1_1); - CFHTTPMessageSetBody(message, (CFDataRef)data); - - id response = [serviceMapping_ httpResponseForRequest:message]; - - // Release data - CFRelease(baseURL); - CFRelease(cfURL); - CFRelease(message); - - return response; -} - -// Perform actions packed with findElement query. --(id) httpResponseForActions:(NSArray*) actions - onElement:(NSData*) findElementResp{ - NSDictionary* elemResp = [WebDriverRequestFetcher convertJsonDataToDictionary:findElementResp]; - - // Return nil if no element if found. - if ([[elemResp objectForKey:@"error"] boolValue]) { - return nil; - } - - // Get element information elemInfo (e.g. "element/6") and elemId (e.g., "6"), and the prefix of - // the queries of actions, which is in the form of /hub/session/1002/foo/element/6 - NSString *elemInfo = [[elemResp objectForKey:@"value"] objectAtIndex:0]; - NSString *elemId = [[elemInfo componentsSeparatedByString:@"/"] objectAtIndex:1]; - NSString *queryPrefix = [NSString stringWithFormat:@"/hub/session/%@/%@/", - [elemResp objectForKey:@"sessionId"], - elemInfo]; - - // Perform actions on the found element. - id response; - NSEnumerator *enumerator = [actions objectEnumerator]; - NSArray* action; - while (action = (NSArray*)[enumerator nextObject]) { - // Get action query. - NSString *query = [queryPrefix stringByAppendingString: [action objectAtIndex:0]]; - - // Get action data and fill in element id; e.g., '[{"id": "3", "value": ["test1"]}]' - // The data is an array of one element, which is a dictionary. - NSMutableArray* actionDataItems = [NSMutableArray arrayWithCapacity:1]; - NSString* actionDataString = [action objectAtIndex:1]; - if ([actionDataString isKindOfClass:[NSArray class]]) { - [actionDataItems addObject:[(NSArray*) actionDataString objectAtIndex:0]]; - } else { - [actionDataItems addObject:[NSMutableDictionary dictionaryWithCapacity:1]]; - } - [[actionDataItems objectAtIndex:0] setValue:elemId forKey:@"id"]; - - NSData *data = [WebDriverRequestFetcher convertJsonArrayToData:actionDataItems]; - - // Perform action and get response. Note all actions have method "POST". - response = [self httpResponseForQuery:query method:@"POST" data:data]; - } - return response; -} - -// Post the response of the processed webdriver request to the connector. -+(NSDictionary*) sendResponse:(id) response - withResponseBody:(NSString*) cmdRespBodyStr - to:(NSURL*) urlSendResponse{ - // 1. Set webdriver response status and headers in cmdRespStatus and cmdRespHeaders. - NSString *cmdRespStatus = @"200"; - NSMutableDictionary *cmdRespHeaders = [NSMutableDictionary dictionary]; - [cmdRespHeaders setValue:@"application/json" forKey:@"Content-Type"]; - - if (response == nil) { - cmdRespStatus = @"404"; - [cmdRespHeaders setValue:@"text/plain" forKey:@"Content-Type"]; - } else if ([response isKindOfClass:[HTTPRedirectResponse class]]) { - // Note header location should be the part relative to connectorAddr. Here we return path. - cmdRespStatus = @"302"; - [cmdRespHeaders setValue:@"text/plain" forKey:@"Content-Type"]; - NSString* redirectedDest = [(HTTPRedirectResponse* )response destination]; - redirectedDest = [[NSURL URLWithString:redirectedDest] path]; - [cmdRespHeaders setValue:redirectedDest forKey:@"location"]; - } - - // 2. Create a JSON string representation (responseData) of the webdriver response. - NSMutableDictionary *responseBodyDict = [NSMutableDictionary dictionary]; - [responseBodyDict setValue:cmdRespStatus forKey:@"Status"]; - [responseBodyDict setValue:cmdRespHeaders forKey:@"Headers"]; - [responseBodyDict setValue:cmdRespBodyStr forKey:@"Body"]; - NSData *responseData = [WebDriverRequestFetcher convertDictionaryToData:responseBodyDict]; - - // 3. Create the request to post response - NSMutableURLRequest *requestPostResp = [[[NSMutableURLRequest alloc] initWithURL:urlSendResponse] - autorelease]; - [requestPostResp setHTTPMethod:@"POST"]; - [requestPostResp setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - [requestPostResp setHTTPBody:responseData]; - - // 4. Send response and fetch the next request. - return [WebDriverRequestFetcher sendRequest:requestPostResp]; -} - -/* - * Part III: Main methods. - */ - -// Method that fetches/processes/responses a webdriver request using the above three methods. -// It returns true if there is a webdriver request to be executed, and False otherwise. -- (BOOL) fetchRequestFrom:(NSURL*) urlFetchRequest sendResponseTo:(NSURL*) urlSendResponse{ - NSURLRequest *fetchRequest = [NSURLRequest requestWithURL:urlFetchRequest]; - NSDictionary* wdRequest = [WebDriverRequestFetcher sendRequest:fetchRequest]; - - BOOL succ = FALSE; - while (wdRequest != nil) { - NSDate* reqArriveTime = [NSDate date]; - - NSString *query = nil; - NSString *method = nil; - NSData *data = nil; - NSArray *actions = nil; //This is for the actions packed with query "element" (findElement) - [self parseWebDriverRequest:wdRequest - queryRef:&query - methodRef:&method - dataRef:&data - actionsRef:&actions]; - - id response = [self httpResponseForQuery:query method:method data:data]; - NSData *responseData = [WebDriverRequestFetcher getResponseData:response]; - - if ([WebDriverRequestFetcher isFindElementQuery:query] && actions != nil && response != nil) { - id actionResponse = - [self httpResponseForActions:actions onElement:responseData]; - if (actionResponse !=nil) { - response = actionResponse; - responseData = [WebDriverRequestFetcher getResponseData:actionResponse]; - } - } - - // Pack some useful information into the response body. - NSString *respStr = [WebDriverRequestFetcher generateResponseBodyString:responseData - withReqArriveTime:reqArriveTime - withRespSendingSTime:[NSDate date]]; - - wdRequest = [WebDriverRequestFetcher sendResponse:response - withResponseBody:respStr - to:urlSendResponse]; - succ = TRUE; - } - return succ; -} - -// Main method for fetching and processing requests. -// We use exponential backoff if no wedriver request is available. -- (void) fetchAndProcessRequests{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - // Initialize sleeping time interval between fetching webdriver requests. - float sleepingTimeInterval = 0; - - // Set up urls for fetching webdriver requests and sending webdriver responses. - NSString* urlStringToServer = [connectorAddr stringByAppendingPathComponent:@"server"]; - NSString* urlString = [urlStringToServer stringByAppendingPathComponent: - [NSString stringWithFormat:@"fetch_request?requesterId=%@", requesterId]]; - NSURL* urlFetchRequest = [[[NSURL alloc] initWithString:urlString] autorelease]; - urlString = [urlStringToServer stringByAppendingPathComponent: - [NSString stringWithFormat:@"send_response?requesterId=%@", requesterId]]; - NSURL* urlSendResponse = [[[NSURL alloc] initWithString:urlString] autorelease]; - - while(TRUE) { - BOOL succ = [self fetchRequestFrom:urlFetchRequest sendResponseTo:urlSendResponse]; - if (succ) { - sleepingTimeInterval = 0; - } else { - if (sleepingTimeInterval < INIT_SLEEPING_TIME_INTERVAL*0.5f) { - sleepingTimeInterval = INIT_SLEEPING_TIME_INTERVAL; - } else { - sleepingTimeInterval = 1.2 * sleepingTimeInterval; - if (sleepingTimeInterval > MAX_SLEEPING_TIME_INTERVAL) { - sleepingTimeInterval = MAX_SLEEPING_TIME_INTERVAL; - } - } - } - [NSThread sleepForTimeInterval:sleepingTimeInterval]; - } - - [pool release]; -} - -- (void)dealloc { - NSLog(@"dealloc of WebdriverRequestFetcher"); - [viewController_ release]; - [serviceMapping_ release]; - [status_ release]; - [super dealloc]; -} - -@end diff --git a/iphone/src/objc/WebDriverResource.h b/iphone/src/objc/WebDriverResource.h deleted file mode 100644 index e3aea03925cd7..0000000000000 --- a/iphone/src/objc/WebDriverResource.h +++ /dev/null @@ -1,121 +0,0 @@ -// -// WebDriverResource.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import "JSONRESTResource.h" - -// This class wraps a standard obj-c method into a method which webdriver can -// call. Method arguments are passed in through PUT/POST data. The data is -// a JSON object of named parameters. The return value from the method is passed -// back through a |WebDriverResponse| object. -// -// For example, the client (WebDriver) might POST to /session/1001/element -// with data {"using":"name","value":"form2"}. The |Element| virtual directory -// maps /element to a |WebDriverResource| using the method: -// -(NSArray *)findElementBy:(NSString)method withQuery:(NSString *)query; -// |WebDriverResource| calls the method as: -// [target findElement:data]; -// where |data| is the parsed JSON data. The method returns a dictionary with -// the mapped GUID. |WebDriverResource| (with help from |WebDriverResponse| and -// |JSONRESTResource|) converts that return value back into JSON and wraps it -// in a |WebDriverResponse|: -// { -// value:{"ELEMENT":1}, -// sessionId:"1001", -// status:0, -// } -// This is then sent back to the client in response. -// -// Methods can throw exceptions to signal errors. These exceptions are sent back -// to WebDriver. If the method throws an exception, the value property in the -// response is the exception object (or details of the exception object) and -// status: is set to the code indicated by the exception (or set to -// |EUNHANDLEDERROR| if the exception userInfo does not specify a status code. -// -// For more details of the protocol see: -// http://code.google.com/p/webdriver/wiki/JsonWireProtocol -@interface WebDriverResource : NSObject { - id target_; - NSDictionary *methodActions_; - - // These two fields are needed for when we make |WebDriverResponse|s. - // Due to the architecture of |VirtualDirectory|, we have to cache the - // session like this. - NSString *session_; - - BOOL allowOptionalArguments_; -} - -@property (nonatomic, copy) NSString *session; - -// Allow some of the method's arguments to be optional. If optional arguments -// are not specified, nil is passed in in their place. -// Defaults to NO. -@property (nonatomic, assign) BOOL allowOptionalArguments; - -// Designated initialiser. The dictionary should map the strings 'GET', 'PUT', -// 'POST', 'DELETE' to selectors to be called on the target. Do not set -// dictionary entries for methods you do not want to handle. -- (id)initWithTarget:(id)target - actions:(NSDictionary *)actionTable; - -// Create a resource which will call these selectors on the target when the -// appropriate method is called. -// -// Send NULL for any method you don't intend to handle. -- (id)initWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction; - -// A helper method to create and autorelease |WebDriverResource|. See -// |initWithTarget:GETAction:POSTAction:PUTAction:DELETEAction:|. -+ (WebDriverResource *)resourceWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction; - -// A helper method to create and autorelease |WebDriverResource| objects with -// no PUT or DELETE actions. See -// |initWithTarget:GETAction:POSTAction:PUTAction:DELETEAction:|. -+ (WebDriverResource *)resourceWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction; -@end - -// This is an extension to VirtualDirectory to allow easy resource additions -@interface HTTPVirtualDirectory (WebDriverResource) - -// This helper method for |HTTPVirtualDirectory| sets a selector of the current -// object to be a WebDriver method. See |WebDriverResource|'s -// |initWithTarget:GETAction:POSTAction:PUTAction:DELETEAction:|. -// The target is self. -- (void)setMyWebDriverHandlerWithGETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction - withName:(NSString *)name; - -// Same as above, but without handlers for PUT and DELETE. -- (void)setMyWebDriverHandlerWithGETAction:(SEL)getAction - POSTAction:(SEL)postAction - withName:(NSString *)name; - -@end diff --git a/iphone/src/objc/WebDriverResource.m b/iphone/src/objc/WebDriverResource.m deleted file mode 100644 index 79a272ebe1d0d..0000000000000 --- a/iphone/src/objc/WebDriverResource.m +++ /dev/null @@ -1,239 +0,0 @@ -// -// WebDriverResource.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "WebDriverResource.h" -#import "WebDriverResponse.h" -#import "MainViewController.h" -#import "NSObject+SBJson.h" -#import "errorcodes.h" - -@implementation WebDriverResource - -@synthesize session = session_, - allowOptionalArguments = allowOptionalArguments_; - -- (id)initWithTarget:(id)target - actions:(NSDictionary *)actionTable -{ - if (![super init]) - return nil; - - target_ = [target retain]; - methodActions_ = [actionTable retain]; - allowOptionalArguments_ = NO; - - return self; -} - -- (id)initWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction -{ - NSMutableDictionary *actions = [NSMutableDictionary dictionary]; - - if (getAction != NULL) - [actions setValue:[NSValue valueWithPointer:getAction] forKey:@"GET"]; - if (postAction != NULL) - [actions setValue:[NSValue valueWithPointer:postAction] forKey:@"POST"]; - if (putAction != NULL) - [actions setValue:[NSValue valueWithPointer:putAction] forKey:@"PUT"]; - if (deleteAction != NULL) - [actions setValue:[NSValue valueWithPointer:deleteAction] forKey:@"DELETE"]; - - return [self initWithTarget:target actions:actions]; -} - -+ (WebDriverResource *)resourceWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction { - return [[[self alloc] initWithTarget:target - GETAction:getAction - POSTAction:postAction - PUTAction:putAction - DELETEAction:deleteAction] autorelease]; -} - -// Helper method for people who don't care about put and delete -+ (WebDriverResource *)resourceWithTarget:(id)target - GETAction:(SEL)getAction - POSTAction:(SEL)postAction { - return [self resourceWithTarget:target - GETAction:getAction - POSTAction:postAction - PUTAction:NULL - DELETEAction:NULL]; -} - -- (void)dealloc -{ - [target_ release]; - [methodActions_ release]; - [self setSession:nil]; - - [super dealloc]; -} - - -#pragma mark Creating a response - -// Set the response's session -- (void)configureWebDriverResponse:(WebDriverResponse *)response { - [response setSessionId:session_]; -} - -// Make an dictionary of objects containing the method arguments. Return nil on -// error. -- (NSDictionary *)getArgumentDictionaryFromData:(NSData *)data { - id requestData = nil; - - if ([data length] > 0) { - NSString *dataString = - [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - - requestData = [dataString JSONValue]; - [dataString release]; - } - - // The request data should contain an array of arguments. - if (requestData != nil - && ![requestData isKindOfClass:[NSDictionary class]]) { - NSLog(@"Invalid argument list - Expecting a dictionary but given %@", - requestData); - return nil; - } - - return (NSDictionary *)requestData; -} - -// Create a WebDriver response from a given selector. -- (WebDriverResponse *)createResponseFromSelector:(SEL)selector - signature:(NSMethodSignature *)method - arguments:(NSDictionary *)arguments { - WebDriverResponse *response; - id result; - - @try { - if (arguments != nil) { - // The first two arguments in the method are the target and selector. - // NSInvocation will fill them in for us. The 3rd argument should be - // a dictionary of additional command parameters, initialized from the - // request JSON data. - if ([method numberOfArguments] > 2) { - result = objc_msgSend(target_, selector, arguments); - } - } else { - result = objc_msgSend(target_, selector); - } - - if ([method methodReturnLength] == 0) { - response = [WebDriverResponse responseWithValue:nil]; - } else { - response = [WebDriverResponse responseWithValue:result]; - } - } - @catch (NSException * e) { - NSLog(@"Method invocation error: %@", e); - response = [WebDriverResponse responseWithError:e]; - - // For easy debugging with Xcode, rethrow the exception here. - } - - return response; -} - -// Get the HTTP response to this request. This method is part of the -// |HTTPResource| protocol. It is the local entrypoint for creating a response. -- (id)httpResponseForQuery:(NSString *)query - method:(NSString *)method - withData:(NSData *)theData { - SEL selector = [[methodActions_ objectForKey:method] pointerValue]; - NSMethodSignature *methodSignature = [target_ methodSignatureForSelector:selector]; - WebDriverResponse *response = nil; - - if (methodSignature == nil) { - // Return a "405 Method Not Allowed" message. We should be setting an - // "Allowed" header whose value is the list of methods supported by this - // resource, but the CocoaHTTPServer framework we're using doesn't seem to - // support it. - // TODO: patch the server for headers - response = [WebDriverResponse responseWithError: - [NSString stringWithFormat: - @"Invalid method for resource: %@ %@", method, query]]; - [response setStatus:405]; - [self configureWebDriverResponse:response]; - return response; - } - - NSDictionary *arguments = [self getArgumentDictionaryFromData:theData]; - if (arguments != nil) { - [arguments setValue:session_ forKey:@"sessionId"]; - } - - [[MainViewController sharedInstance] - describeLastAction:NSStringFromSelector(selector)]; - - // Create response - response = [self createResponseFromSelector:selector - signature:methodSignature - arguments:arguments]; - [self configureWebDriverResponse:response]; - return response; -} - -// This is part of the |HTTPResource| protocol. -- (id)elementWithQuery:(NSString *)query { - return self; -} - -@end - - -@implementation HTTPVirtualDirectory (WebDriverResource) - -// Helper method to set JSON resources. -- (void)setMyWebDriverHandlerWithGETAction:(SEL)getAction - POSTAction:(SEL)postAction - PUTAction:(SEL)putAction - DELETEAction:(SEL)deleteAction - withName:(NSString *)name { - [self setResource:[WebDriverResource resourceWithTarget:self - GETAction:getAction - POSTAction:postAction - PUTAction:putAction - DELETEAction:deleteAction] - withName:name]; -} - -// Calls above, but without put and delete. -- (void)setMyWebDriverHandlerWithGETAction:(SEL)getAction - POSTAction:(SEL)postAction - withName:(NSString *)name { - [self setMyWebDriverHandlerWithGETAction:getAction - POSTAction:postAction - PUTAction:NULL - DELETEAction:NULL - withName:name]; -} - -@end diff --git a/iphone/src/objc/WebDriverResponse.h b/iphone/src/objc/WebDriverResponse.h deleted file mode 100644 index 87abbdff2dd18..0000000000000 --- a/iphone/src/objc/WebDriverResponse.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// WebDriverResponse.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import "HTTPDataResponse.h" - -@class HTTPJSONResponse; - -// |WebDriverResponse| encapsulates the information for a response to a -// WebDriver RPC method, as defined by the WebDriver wire protocol. -// -// This is implemented as a proxy around an HTTPResponse. When the standard -// HTTPResponse methods are called, the data in WebDriverResponse's fields are -// baked into an HTTPJSONResponse and the data fields (status, value, sessionId) -// become immutable. -// -// Don't confuse HTTPResponse (a response to an HTTP message) and a -// WebDriver |Response| (an HTTPResponse containing the return value of a -// method). -@interface WebDriverResponse : NSObject { - // These fields mirror their equivalents in WebDriver. - - // The status code for this response. A non-zero value indicates some error - // occurred. - int status_; - - // The value the method returned or the exception generated - id value_; - - // The active session - NSString *sessionId_; - - // We're a proxy around this response. - HTTPDataResponse *response_; -} - -@property (nonatomic) BOOL isError; -@property (nonatomic) int status; -@property (nonatomic, retain) id value; -@property (nonatomic, copy) NSString *sessionId; - -- (id)initWithValue:(id)value; -- (id)initWithError:(id)error; - -+ (WebDriverResponse *)responseWithValue:(id)value; -+ (WebDriverResponse *)responseWithError:(id)error; - -- (HTTPDataResponse *)response; - -@end - -// This is needed so the world knows that WebDriverResponse indirectly -// implements the |HTTPResponse| protocol. WebDriverResponse implements this -// through forwarding. Doing it this way supresses compiler warnings. -@interface WebDriverResponse (ForwardedHTTPResponse) - -@end diff --git a/iphone/src/objc/WebDriverResponse.m b/iphone/src/objc/WebDriverResponse.m deleted file mode 100644 index 730c6da51046b..0000000000000 --- a/iphone/src/objc/WebDriverResponse.m +++ /dev/null @@ -1,208 +0,0 @@ -// -// WebDriverResponse.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 "WebDriverResponse.h" -#import "HTTPResponse.h" -#import "HTTPJSONResponse.h" -#import "HTTPPNGResponse.h" -#import "NSData+Base64.h" -#import "NSException+WebDriver.h" -#import "errorcodes.h" - -@implementation WebDriverResponse - -// These need to be dynamic so we can make sure to clear the cached response -// if it exists when these are changed. -@dynamic status, value, sessionId; - -- (id)initWithValue:(id)theValue { - if (![super init]) - return nil; - - [self setValue:theValue]; - - // The sessionId is set automatically by |Session|. - [self setSessionId:@"unknown"]; - - return self; -} - -- (id)initWithError:(id)error { - NSLog(@"Creating WebDriverResponse with:\n%@", [error description]); - if (![error isKindOfClass:[NSException class]]) { - if (![self initWithValue:error]) { - return nil; - } - } else { - NSDictionary* errorData = [error userInfo]; - if ([error name] == [NSException webdriverExceptionName]) { - if (![self initWithValue:[errorData objectForKey:@"value"]]) { - return nil; - } - status_ = [[errorData objectForKey:@"status"] intValue]; - } else if (![self initWithValue:errorData]) { - return nil; - } - } - - // If we didn't set a status above, go ahead and use a generic now. - if (status_ == WD_SUCCESS) { - status_ = EUNHANDLEDERROR; - } - - return self; -} - -+ (WebDriverResponse *)responseWithValue:(id)value { - return [[[self alloc] initWithValue:value] autorelease]; -} - -+ (WebDriverResponse *)responseWithError:(id)error { - return [[[self alloc] initWithError:error] autorelease]; -} - -- (void)dealloc { - // Calls the release methods instead of calling setValue:nil because - // setValue tries to change the response_ object (which it can't) and throws - // an exception. - [value_ release]; - [sessionId_ release]; - [response_ release]; - [super dealloc]; -} - -- (NSDictionary *)convertToDictionary { - NSMutableDictionary *dict = [NSMutableDictionary dictionary]; - [dict setValue:value_ forKey:@"value"]; - [dict setValue:sessionId_ forKey:@"sessionId"]; - [dict setValue:[NSNumber numberWithInt:status_] forKey:@"status"]; - return dict; -} - -// Create the response_ object from the current property set. -- (void)createResponse { - [response_ release]; - - if ([value_ isKindOfClass:[UIImage class]]) { - value_ = [UIImagePNGRepresentation(value_) base64EncodedString]; - } - NSDictionary *dict = [self convertToDictionary]; - response_ = [[HTTPJSONResponse alloc] initWithObject:(id)dict]; -} - -// Return the response_ object (create it if necessary). -- (HTTPDataResponse *)response { - if (response_ == nil) - [self createResponse]; - - return response_; -} - -// Invalidate the stored response. This usually happens when any of the -// properties change. This will throw an exception if called after its sent -// over the network. -- (void)setResponseDirty { - if (response_ != nil && [response_ offset] != 0) { - @throw [NSException exceptionWithName:@"kResponseInUse" - reason:@"Reading has already started on the response. You can't change it now." - userInfo:nil]; - } - - [response_ release]; - response_ = nil; -} - -- (void)forwardInvocation:(NSInvocation *)anInvocation { - [anInvocation setTarget:[self response]]; - [anInvocation invoke]; -} - -- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { - NSMethodSignature *sig = [super methodSignatureForSelector:aSelector]; - if (sig != nil) { - return sig; - } else { - return [[self response] methodSignatureForSelector:aSelector]; - } -} - -- (BOOL)respondsToSelector:(SEL)aSelector { - if ([super respondsToSelector:aSelector]) - return YES; - - return [[self response] respondsToSelector:aSelector]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"{ status: %d, value:%@ }", - status_, value_]; -} - -- (int)errorStatusCode { - if (status_ == WD_SUCCESS) { - return 200; - } else if (status_ > 399 && status_ < 500) { - return status_; - } else { - return 500; - } -} - -#pragma mark Properties - -- (BOOL)isError { - return status_ != WD_SUCCESS; -} - -- (void)setIsError:(BOOL)newIsError { - [self setStatus:(newIsError ? EUNHANDLEDERROR : WD_SUCCESS)]; -} - -- (int)status { - return [self errorStatusCode]; -} - -- (void)setStatus:(int)newStatus { - status_ = newStatus; - [self setResponseDirty]; -} - -- (id)value { - return [[value_ retain] autorelease]; -} - -- (void)setValue:(id)newValue { - [newValue retain]; - [value_ release]; - value_ = newValue; - if (value_ != nil) - [self setResponseDirty]; -} - -- (NSString *)sessionId { - return sessionId_; -} - -- (void)setSessionId:(NSString *)newSessionId { - [sessionId_ release]; - sessionId_ = [newSessionId copy]; - [self setResponseDirty]; -} - -@end diff --git a/iphone/src/objc/WebDriverUtilities.h b/iphone/src/objc/WebDriverUtilities.h deleted file mode 100644 index ab3d3b9b626de..0000000000000 --- a/iphone/src/objc/WebDriverUtilities.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// WebDriverUtilities.h -// iWebDriver -// -// Created by Yu Chen on 5/27/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import - -// This class provides a set of class methods. -@interface WebDriverUtilities : NSObject { -} -+ (void)cleanCookies; -+ (void)cleanCache; -+ (void)cleanDatabases; -@end diff --git a/iphone/src/objc/WebDriverUtilities.m b/iphone/src/objc/WebDriverUtilities.m deleted file mode 100644 index 18cedbb6b52ab..0000000000000 --- a/iphone/src/objc/WebDriverUtilities.m +++ /dev/null @@ -1,105 +0,0 @@ -// -// WebDriverUtilities.m -// iWebDriver -// -// Created by Yu Chen on 5/27/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import -#import "WebDriverUtilities.h" - -@implementation WebDriverUtilities - -+ (void)cleanCookies{ - NSLog(@"Cleaning up cookies ......"); - NSHTTPCookieStorage* cookieStorage = - [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSArray* theCookies = [cookieStorage cookies]; - for (NSHTTPCookie *cookie in theCookies) { - NSLog(@"Delete cookie: %@", [cookie description]); - [cookieStorage deleteCookie: cookie]; - } - NSLog(@"Finish cleaning up cookies."); -} - -+ (void)cleanCache{ - // We use the default sharedCache. - NSURLCache *sharedCache = [NSURLCache sharedURLCache]; - NSLog(@"Current caching status:"); - NSLog(@"currentDiskUsage: %u Bytes", [sharedCache currentDiskUsage]); - NSLog(@"currentMemoryUsage: %u Bytes", [sharedCache currentMemoryUsage]); - NSLog(@"diskCapacity: %u Bytes", [sharedCache diskCapacity]); - NSLog(@"memoryCapacity: %u Bytes", [sharedCache memoryCapacity]); - - [sharedCache removeAllCachedResponses]; - - NSLog(@"Caching status after clean up:"); - NSLog(@"currentDiskUsage: %u Bytes", [sharedCache currentDiskUsage]); - NSLog(@"currentMemoryUsage: %u Bytes", [sharedCache currentMemoryUsage]); - NSLog(@"diskCapacity: %u Bytes", [sharedCache diskCapacity]); - NSLog(@"memoryCapacity: %u Bytes", [sharedCache memoryCapacity]); -} - -+ (void)cleanDatabases{ - // We refer to the logic in webkit/trunk/WebKit/Storage/* Revison 41563 - // (e.g., WebDatabaseManager.mm) and webkit/trunk/WebCore/Storage/* Revision - // 41578 (e.g., DatabaseTracker.cpp). - // - // Webkit uses sqlite database for the HTML 5 databases. A database - // 'Databases' with tables 'Origins' and 'Databases' is used to store the - // information of applications' databases. Here we clean databases by deleting - // data in these two tables and delete the files of databases created by - // applications. - - // Get the path to the database, which is - // "/Library/WebKit/Databases" by default, if not - // specified in NSUserDefaults with key "WebDatabaseDirectory". - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSString *dbDir = [defaults objectForKey:@"WebDatabaseDirectory"]; - if (!dbDir || ![dbDir isKindOfClass:[NSString class]]) { - dbDir = [NSHomeDirectory() - stringByAppendingPathComponent:@"/Library/WebKit/Databases"]; - } - - NSFileManager *fm = [NSFileManager defaultManager]; - if (!dbDir || ![dbDir isKindOfClass:[NSString class]] || - ![fm fileExistsAtPath:dbDir]) { - return; - } - - // Clean up database. - sqlite3 *db; - NSString *dbFileOfDatabases = [dbDir stringByAppendingPathComponent:@"Databases.db"]; - if ([fm fileExistsAtPath:dbFileOfDatabases]) { - BOOL succ = FALSE; - if(sqlite3_open([dbFileOfDatabases UTF8String], &db) == SQLITE_OK) { - int retOrigins = sqlite3_exec(db, [@"DELETE FROM Origins" UTF8String], nil, nil, nil); - int retDatabases = sqlite3_exec(db, [@"DELETE FROM Databases" UTF8String], nil, nil, nil); - if (retOrigins == SQLITE_OK && retDatabases == SQLITE_OK) { - succ = TRUE; - } - NSLog(@"Delete tables 'Origins' and 'Databases' (ret: %d, %d).", - retOrigins, retDatabases); - sqlite3_close(db); - } - - if (!succ) { - NSLog(@"Unable to open databse 'Databases'. Delete the database file '%@'", - dbFileOfDatabases); - [fm removeItemAtPath:dbFileOfDatabases error:nil]; - } - } - - NSArray *subPaths = [fm subpathsOfDirectoryAtPath: dbDir error:nil]; - for (int i = 0; i < [subPaths count]; i++) { - NSString *path = [dbDir stringByAppendingPathComponent: [subPaths objectAtIndex:i]]; - if ([path isEqualToString:dbFileOfDatabases]) { - continue; - } - NSLog(@"Delete database file %@", path); - [fm removeItemAtPath:path error:nil]; - } -} - -@end diff --git a/iphone/src/objc/WebViewController.h b/iphone/src/objc/WebViewController.h deleted file mode 100644 index 3d4f54f2df16d..0000000000000 --- a/iphone/src/objc/WebViewController.h +++ /dev/null @@ -1,100 +0,0 @@ -// -// WebViewController.h -// iWebDriver -// -// Copyright 2009 Google Inc. -// -// 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 -#import - -// The WebViewController manages the iWebDriver's WebView. -@interface WebViewController : UIViewController -{ -@private - // Used to track the number of page loads. The view is considered loaded - // when there are no pending page loads. - int numPendingPageLoads_; - - NSString *lastJSResult_; - - // Get a screenshot of the page we've loaded - UIImage *screenshot_; - - NSURLRequestCachePolicy cachePolicy_; - - // This is nil if the last operation succeeded. - NSError *lastError_; - -} - -@property (retain, readonly) UIWebView *webView; - -- (void)waitForLoad; - -- (CGRect)viewableArea; -- (BOOL)pointIsViewable:(CGPoint)point; - -// Some webdriver stuff. -- (id)visible; -- (void)setVisible:(NSNumber *)target; - -// Get the current page title -- (NSString *)currentTitle; - -// Get the URL of the page we're looking at -- (NSString *)URL; - -// Navigate to a URL. -// The URL should be specified by the |url| key in the |urlMap|. -- (void)setURL:(NSDictionary *)urlMap; - -- (void)forward:(NSDictionary*)ignored; -- (void)back:(NSDictionary*)ignored; -- (void)refresh:(NSDictionary*)ignored; - -- (void)frame:(NSDictionary*)frameTarget; - -// Evaluate a javascript string and return the result. -// Arguments can be passed in in NSFormatter (printf) style. -// -// Variables declared with var are kept between script calls. However, they are -// lost when the page reloads. Check before using any variables which were -// defined during previous events. -- (NSString *)jsEval:(NSString *)format, ...; - -// Get the HTML source of the page we've loaded -- (NSString *)source; - -// Get a screenshot of the page we've loaded -- (UIImage *)screenshot; - -- (void)clickOnPageElementAt:(CGPoint)point; - -// Calls the same on the main view controller. -- (void)describeLastAction:(NSString *)status; - -// Get geolocation -- (id)location; - -// Set geolocation -- (void)setLocation:(NSDictionary *)dict; - -// get ss -- (void)getFullPageScreenShot; - -// Check if browser connection is alive -- (NSNumber *)isBrowserOnline; - -@end diff --git a/iphone/src/objc/WebViewController.m b/iphone/src/objc/WebViewController.m deleted file mode 100644 index 08c77a79200a3..0000000000000 --- a/iphone/src/objc/WebViewController.m +++ /dev/null @@ -1,579 +0,0 @@ -// -// WebViewController.m -// iWebDriver -// -// Copyright 2009 Google Inc. -// Copyright 2011 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 -#import -#import - -#import "errorcodes.h" -#import "FrameContext.h" -#import "GeoLocation.h" -#import "HTTPServerController.h" -#import "MainViewController.h" -#import "NSObject+SBJson.h" -#import "NSException+WebDriver.h" -#import "NSURLRequest+IgnoreSSL.h" -#import "UIResponder+SimulateTouch.h" -#import "WebDriverResponse.h" -#import "WebDriverPreferences.h" -#import "WebDriverRequestFetcher.h" -#import "WebDriverUtilities.h" -#import "WebViewController.h" - -static const NSString* kGeoLocationKey = @"location"; -static const NSString* kGeoLongitudeKey = @"longitude"; -static const NSString* kGeoLatitudeKey = @"latitude"; -static const NSString* kGeoAltitudeKey = @"altitude"; - -@implementation WebViewController - -- (id)init { - [super init]; - - lastJSResult_ = nil; - screenshot_ = nil; - - WebDriverPreferences *preferences = [WebDriverPreferences sharedInstance]; - - cachePolicy_ = [preferences cache_policy]; - NSURLCache *sharedCache = [NSURLCache sharedURLCache]; - [sharedCache setDiskCapacity:[preferences diskCacheCapacity]]; - [sharedCache setMemoryCapacity:[preferences memoryCacheCapacity]]; - - if ([[preferences mode] isEqualToString: @"Server"]) { - HTTPServerController* serverController = [HTTPServerController sharedInstance]; - [serverController setViewController:self]; - [self describeLastAction:[serverController status]]; - } else { - WebDriverRequestFetcher* fetcher = [WebDriverRequestFetcher sharedInstance]; - [fetcher setViewController:self]; - [self describeLastAction:[fetcher status]]; - } - - return self; -} - -- (void)didReceiveMemoryWarning { - NSLog(@"Memory warning recieved."); - // TODO(josephg): How can we send this warning to the user? Maybe set the - // displayed text; though that could be overwritten basically straight away. - [super didReceiveMemoryWarning]; -} - -- (void)dealloc { - [lastJSResult_ release]; - [screenshot_ release]; - [super dealloc]; -} - -- (UIWebView *)webView { - return [[MainViewController sharedInstance] webView]; -} - -- (BOOL)webView:(UIWebView *)webView - shouldStartLoadWithRequest:(NSURLRequest *)request - navigationType:(UIWebViewNavigationType)navigationType { - - NSURL* url = [request URL]; - if ([[url scheme] isEqualToString:@"webdriver"]) { - NSLog(@"Received webdriver data from the current page: %@", - [url absoluteString]); - - NSString* action = [url host]; - if (action == nil) { - NSLog(@"No action specified; ignoring webdriver:// URL: %@", - [url absoluteString]); - return NO; - } - - NSString* jsonData = @"{}"; - if ([url query] != nil) { - jsonData = [[url query] - stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - } - - // TODO: catch malformed query data and broadcast an appropriate error. - NSDictionary* data = (NSDictionary*) [jsonData JSONValue]; - [[NSNotificationCenter defaultCenter] - postNotificationName:[NSString stringWithFormat:@"webdriver:%@", action] - object:self - userInfo:data]; - return NO; - } - - NSLog(@"shouldStartLoadWithRequest"); - return YES; -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - NSLog(@"webViewDidStartLoad"); - [[NSNotificationCenter defaultCenter] - postNotificationName:@"webdriver:pageLoad" - object:self]; - @synchronized(self) { - numPendingPageLoads_ += 1; - } -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - NSLog(@"finished loading"); - @synchronized(self) { - numPendingPageLoads_ -= 1; - } -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - // This is a very troubled method. It can be called multiple times (for each - // frame of webpage). It is sometimes called even when the page seems to have - // loaded correctly. - - // Page loading errors are ignored because that's what WebDriver expects. - NSLog(@"*** WebView failed to load URL with error %@", error); - if ([error code] == 101) { - NSString *failingURLString = [[error userInfo] objectForKey: - @"NSErrorFailingURLStringKey"]; - // This is an issue only with simulator due to lack of support for tel: url. - if ([[failingURLString substringToIndex:4] isEqualToString:@"tel:"]) { - @throw [NSException webDriverExceptionWithMessage: - [NSString stringWithFormat: - @"tel: url isn't supported in simulator"] - andStatusCode:EUNHANDLEDERROR]; - } - } - - @synchronized(self) { - numPendingPageLoads_ -= 1; - } -} - -#pragma mark Web view controls - -- (void)performSelectorOnWebView:(SEL)selector withObject:(id)obj { - [[self webView] performSelector:selector withObject:obj]; -} - -- (void)waitForLoad { - // TODO(josephg): Test sleep intervals on the device. - // This delay should be long enough that the webview has isLoading - // set correctly (but as short as possible - these delays slow down testing.) - - // - The problem with [view isLoading] is that it gets set in a separate - // worker thread. So, right after asking the webpage to load a URL we need to - // wait an unspecified amount of time before isLoading will correctly tell us - // whether the page is loading content. - - [NSThread sleepForTimeInterval:0.2f]; - - while ([[self webView] isLoading]) { - // Yield. - [NSThread sleepForTimeInterval:0.01f]; - } - - // The main view may be loaded, but there may be frames that are still - // loading. - while (true) { - @synchronized(self) { - if (numPendingPageLoads_ == 0) { - break; - } - } - } -} - -// All method calls on the view need to be done from the main thread to avoid -// synchronization errors. This method calls a given selector in this class -// optionally with an argument. -// -// If called with waitUntilLoad:YES, we wait for a web page to be loaded in the -// view before returning. -- (void)performSelectorOnView:(SEL)selector - withObject:(id)value - waitUntilLoad:(BOOL)wait { - - /* The problem with this method is that the UIWebView never gives us any clear - * indication of whether or not it's loading and if so, when its done. Asking - * it to load causes it to begin loading sometime later (isLoading returns NO - * for awhile.) Even the |webViewDidFinishLoad:| method isn't a sure sign of - * anything - it will be called multiple times, once for each frame of the - * loaded page. - * - * The result: The only effective method I can think of is nasty polling. - */ - - while ([[self webView] isLoading]) - [NSThread sleepForTimeInterval:0.01f]; - - [[self webView] performSelectorOnMainThread:selector - withObject:value - waitUntilDone:YES]; - - NSLog(@"loading %d", [[self webView] isLoading]); - - if (wait) - [self waitForLoad]; -} - -// Get the specified URL and block until it's finished loading. -- (void)setURL:(NSDictionary *)urlMap { - NSString *urlString = (NSString*) [urlMap objectForKey:@"url"]; - NSURLRequest *url = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] - cachePolicy:cachePolicy_ - timeoutInterval:60]; - - [self performSelectorOnView:@selector(loadRequest:) - withObject:url - waitUntilLoad:YES]; - // setting the URL happens on the main container, all - // switch_to's are reset. - [[FrameContext sharedInstance] removeAllObjects]; -} - -- (void)back:(NSDictionary*)ignored { - [self describeLastAction:@"back"]; - [self performSelectorOnView:@selector(goBack) - withObject:nil - waitUntilLoad:YES]; -} - -- (void)forward:(NSDictionary*)ignored { - [self describeLastAction:@"forward"]; - [self performSelectorOnView:@selector(goForward) - withObject:nil - waitUntilLoad:YES]; -} - -- (void)refresh:(NSDictionary*)ignored { - [self describeLastAction:@"refresh"]; - [self performSelectorOnView:@selector(reload) - withObject:nil - waitUntilLoad:YES]; -} - -// Currently only one window handle is supported -// These are just here to support WebDriverBackedSelenium --(NSString*)windowHandle { - return @"1"; -} - --(NSArray*)windowHandles { - return [[NSArray alloc] initWithObjects:@"1", nil]; -} - -// Return the device's current orientation as a string --(NSString*)currentOrientation { - - if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) || - ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)) { - - return @"LANDSCAPE"; - } - if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait) || - ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)) { - - return @"PORTRAIT"; - } - // I'm not sure why but the initial state of the app seems to set the current orientation - // to unknown (0). Will hopefully look into this in the near future ;) TODO (lukeis) - return @"UNKNOWN"; -} - --(void)window:(NSDictionary*)ignored { - // window switching isn't supported - return; -} - -- (void)frame:(NSDictionary*)frameTarget { - NSObject* ID = [frameTarget objectForKey:@"id"]; - NSString* frameIndex = nil; - if ([ID isKindOfClass:[NSNull class]]) { - // Switch to default content - [self describeLastAction:@"switch frame to top"]; - [[FrameContext sharedInstance] removeAllObjects]; - return; - } else if ([ID isKindOfClass:[NSDictionary class]]) { - // A WebElement was passed in - [self describeLastAction:@"switching frame to provided web element"]; - - // need to make a separate call to 'execute_script' - // in order to get the benefits of mapping the webelement to an actual - // dom element. Seemingly the easiest way is to spoof another external - // call and process the result - WebDriverResponse* response = (WebDriverResponse*) - [[HTTPServerController sharedInstance] - httpResponseForQuery:[[NSString alloc] initWithFormat:@"/wd/hub/session/%@/execute", [frameTarget objectForKey:@"sessionId"]] - method:@"POST" - // example of what the data needs to look like - // {"sessionId": "%@", "args": [{"ELEMENT": "%@"}], "script": "return arguments[0]"} - withData:[[[NSDictionary dictionaryWithObjectsAndKeys: - [[NSArray alloc] initWithObjects:ID, nil], @"args", - @"return (function(vs,v){for(var i=0;i %@", script, lastJSResult_); -} - -// Evaluate the given JS format string & arguments. Argument list is the same -// as [NSString stringWithFormat:...]. -- (NSString *)jsEval:(NSString *)format, ... { - if (format == nil) { - [NSException raise:@"invalidArguments" format:@"Invalid arguments for jsEval"]; - } - - va_list argList; - va_start(argList, format); - NSString *script = [[[NSString alloc] initWithFormat:format - arguments:argList] - autorelease]; - va_end(argList); - - if ([[FrameContext sharedInstance] count] > 0) { - // check first is the frames still exist, if any of them are gone - // automatically reset to default content - [self performSelectorOnMainThread:@selector(jsEvalInternal:) - withObject:[NSString stringWithFormat:@"(function(){var w=window;var frameIndexes=%@;for(var i=0;i %@", - NSStringFromCGPoint(point), - NSStringFromCGPoint(transformedPoint)); - - return transformedPoint; -} - -- (void)clickOnPageElementAt:(CGPoint)point { - if (![self pointIsViewable:point]) { - [self scrollIntoView:point]; - } - - CGPoint pointInViewSpace = [self translatePageCoordinateToView:point]; - - NSLog(@"simulating a click at %@", NSStringFromCGPoint(pointInViewSpace)); - [[self webView] simulateTapAt:pointInViewSpace]; -} - -// Gets the location -- (NSDictionary *)location { - GeoLocation *locStorage = [GeoLocation sharedManager]; - CLLocationCoordinate2D coordinate = [locStorage getCoordinate]; - CLLocationDistance altitude = [locStorage getAltitude]; - - return [NSDictionary dictionaryWithObjectsAndKeys: - [NSDecimalNumber numberWithDouble:coordinate.longitude], kGeoLongitudeKey, - [NSDecimalNumber numberWithDouble:coordinate.latitude], kGeoLatitudeKey, - [NSDecimalNumber numberWithFloat:altitude], kGeoAltitudeKey, nil]; -} - -// Sets the location -- (void)setLocation:(NSDictionary *)dict { - NSDictionary *values = [dict objectForKey:kGeoLocationKey]; - NSDecimalNumber *altitude = [values objectForKey:kGeoAltitudeKey]; - NSDecimalNumber *longitude = [values objectForKey:kGeoLongitudeKey]; - NSDecimalNumber *latitude = [values objectForKey:kGeoLatitudeKey]; - - GeoLocation *locStorage = [GeoLocation sharedManager]; - [locStorage setCoordinate:[longitude doubleValue] - latitude:[latitude doubleValue]]; - [locStorage setAltitude:[altitude doubleValue]]; -} - -// get the full page screenshot. -- (void)getFullPageScreenShot { - // stop the webview - [self.webView setDelegate:nil]; - [self.webView stopLoading]; - - // keep the original window size. - CGRect oriFrame = self.webView.frame; - CGRect oriBounds = self.webView.bounds; - - // get the page render actual size - CGRect tmpFrame = self.webView.frame; - tmpFrame.size.height = 1; - self.webView.frame = tmpFrame; - CGSize fittingSize = [self.webView sizeThatFits:CGSizeZero]; - tmpFrame.size = fittingSize; - self.webView.frame = tmpFrame; - - // render the page and take the screenshot - UIGraphicsBeginImageContext(fittingSize); - CGContextRef resizedContext = UIGraphicsGetCurrentContext(); - [[self webView].layer renderInContext:resizedContext]; - UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - //reset webview back to original size. - self.webView.bounds = oriBounds; - self.webView.frame = oriFrame; - - // retain the screenshot for webdriver - [screenshot_ release]; - screenshot_ = [viewImage retain]; -} - -// Finds out if browser connection is alive -- (NSNumber *)isBrowserOnline { - BOOL onlineState = [[self jsEval:@"navigator.onLine"] isEqualToString:@"true"]; - return [NSNumber numberWithBool:onlineState]; -} - -@end diff --git a/iphone/src/objc/iWebDriver_Prefix.pch b/iphone/src/objc/iWebDriver_Prefix.pch deleted file mode 100644 index 192b050c570b5..0000000000000 --- a/iphone/src/objc/iWebDriver_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'iWebDriver' target in the 'iWebDriver' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/iphone/src/objc/main.m b/iphone/src/objc/main.m deleted file mode 100644 index 3ba28f8697831..0000000000000 --- a/iphone/src/objc/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// iWebDriver -// -// Created by Luke Inman-Semerau -// This file is unedited project template code. -// - -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/iphone/src/objc/selenium-icon.png b/iphone/src/objc/selenium-icon.png deleted file mode 100644 index 550e6687f41b641aae6f2e78c9cc2a28464ee696..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5118 zcmWky2Q*u47*0?^&7!qhqyE~eq^+$~kdmm?QoAVm(b#)LwA8MsQCq6itlFz)t)^B} zBW6)GVsB#n_rK?S_n!Nmd+zss@B2RE-l)e&Z6*dD1`r6u1lQ3t1g;PM9}rsLT#Ry` z0WLJ28gOF>a0Ef@-vIaYZaQY3AP|`M{{fCWL@ol8++HwKFC+8|FJD^^2avC?uQckV zv!|V{n}amk!!ct+nFj=74}@!~8~bH0W(0bfjAZqwExB9wAztc0`uZ;mKGG2o;B>wz z$+@0x=Kbxd)CjZqg!{yoeOM{WkU<1i4nGh}Sb69&V(99PTInr)|0R~W1DEndP*cwZ zLZ6U<5&TS1JSMbpcx9rdx^u4rFdXHZ!dI*;MNEze>lWZ<&d!#6}D;Y7f<%saU zWqL-Fzb#B%zCHEGP=K}mMLYHqv6~$IXEGI$`~+$OWl62rR{yR^~B?fq25Vewe) z;B4Dk9z0Vd)wUFl3HqJYrh>V)Wp;e&n#I<&9%A^#lM64SFd0~**J!C(zx}_M>2f#4 z_@UF|-NKbd)oW=7eKH87rU3^?7_O1xFudqNAJVEu`t|EqjnDeTIUX-0!gfW#f>Pt$ zx@E0&L5U>tXP5}l*}u!C$@BginB4y7HAXetrOE9P)!%`vz$^jCEGJDKNha11R5uwX zkSRbUX|<5og7C71rt6on7y*b5?v-eCZ)GfDv4gxX9@5&{gvZa{Pf$HszAY{xu|GOG z+RcBq(=+(1wCuKfa>H7!25-R4^Y9jQq(+{#W0H&@7=b`6>EQOLiO|-m@o^{U{rfQ{ zCMNGvQy2CF?jYES&^wIOoieiJB997Ccya*JvV?_{3p3Eq5);`p z^4_i-QW7{hI8HqlBnGDqzrN6Fvz+T|!!x1wYD2u%di2jet)!U0gvYYm=;^dgHF%~n zV7CGc3=-YW_QweQ{rv|jW+`H#qHT*Fq?=A)4=d^<>8cP%b{lY=hlxp4&q7*36k!p_ zD}GpXves43%5NR!KC#N9JThbP;1;k3M@G6dr91CoWUV4Z#^V&z;JGwPkKHnS_%OWr zc^5I!0_(t1xD0l# zia>zEGvbS3biu7kL+-x~$ed>W(qNph6w1lT4Sdh9Q)WlnKk1)#dS(77(irkeChd@r zK%$P@nber)#%vIHh422{9+#hi{2Vc^Sr!x8`g!4l3V+$$w@Sy@LdGjDRMO2`8acLH zRsT9WZ~H0NPro!@*N3%f3d=9OtX*|vw?n=5{KM2)(N3LjDAwXmzAqozmAVD>qjxr- zp{6lcr3@{cA^Xqg2{EZT-@;q$&ng@_msE&;`x8;AuGKsmufesy79bM zjYce9+b(lOAfJsvVDY(5a6CHBaK_;K;nUC@V{w?|RoyuDx9JZq_v&KG$@jqQ;H)=k zL5q#$AIOca`k;-*P3gvnL*j{z^T5d_H0Y{=Z^)*!bp46$uWa+k@`ReAf5j~yT52Y9 z4PXE8uJ)4Ow)SlsF4{hOoD=k4HXGD~33ZH=0u5Khow-lW={}DPOP9)q2Yq})&tr1r zc2Bv3_T!xu$fqkolz8+9azMl++2UX$a9Q=QwPM1_t|Pv{C?A@fpPs*N%A07PHeL=n zpFQ?lX~+T4Q)C>iDWneN8R^!x_Qni;q4vKkzo^pmBk3{(0i@H(BJ>#p;+ zQ-dEEJ37D zYpb`4ACVaEPg@Oj7qXcWHRnj{q|?H5FgX7ntA9$%12kmF535; znQ=WI1qjl@1{$KQ5DD=J6e|LDd^R`xVHs}7?<`#Rsd=mOny8rAm-c5yqfi88LWa?> z=oef&M1x8)2EE>#Da+le8b}t8#!rh8p$!Y08^SyK2IpHF=oNF0=fd|o){3=GRn_pK zf^Vp9-MVwPo9>K1mz!rbSIa{;+A(LQ_g9gTt4ZBNjmOe=Iqofg`U=y2?KVwWHn3X< zv%E?(-9|8GB%!>3{FT`h63DWdSDc?-i7$fSF}NqoH>UI_hK99>-_9-P==9ItMn^Mn z!1}oS>1>+#+;DD&eI?-0^h|wY69;?yS31HPLWu%d$OWIK?SQW|RN(Iff~!#Jlmeig zLIhdoix8>9DPNW|e!hZSQh(xHXRL69*uhmf*6RqJkG$GH|`jmvw{Zn-T%07sY1u-0tknie{~-@|Oen>guYj){Met zm0c|I^KLAp*O3|!bXQkb3$J0=R0w6g*W<6<$jAst(yBSlPkCSx-P#|2UFm54TI(Ca z;`cYJik7aags!9nl|J9iW9De3=)=-4es+rG?8hvxYf4%MW4YyYJ{oe*IMr$?(A~BM zEmhOIA;FeoC}-z|0i{i0F2?N2_KpsX6lu#xGF*T5$E*uKe(dsbm#XpJxaVN@ciWq{ zo)YMr=uy&ZB-~++D{Wa498g%|!}Zw@bc^ebfIUKT?ttUHIn-Il>(Km9E!<(uM_!5u zQI6++erfOJ91RT(aqgjW9j_UgnJdw=s;gwO+&y`mupk_VzzD-jt#`R*&4X{VNp*im zm)ZMty6`r$*L(7qwMi*h?hoo>YFZxQUKJNZux)r)jO=Rj@!t%W=|;}h*#yF((A5}0 zf^6Ni53jekx6fCCbW`m5WSx|$t$IYfH|97|2s#y$bKxUX+-3^5~UeYtkk{~ zqd|{-%l<|6CY2-;fXaoQ1Ucu?(pXBACbrDHuF|F*%c#Vb&_k+szsaJq#~O{Va2&kh zvoRG_PJY#COBMDY0xbZy3k(C8SoucX*FgZ6w6wHal(Sj~-w@+3&)*$Wi6Hys?Wjtn zK1vc|V`JThVb>g{#-RNn?~~jUdL9DoSn{My11B6E6I1l*Q*J>4tvuV4I>_?orX!HH zhzQ!hgE{&@8%Ed;jg4vR>$7aOUZ~d8)Eu3KP=ZOjDwDcr#s!!Hl%^1yl60EuHgy;X z@R4iNO{qBC6~K79B0d4Ht*+)sB{=wgYsh>SQBhbJIWh6u*OVG$cEgyyZo`*1oIS@cYEtYY0vfP{9!jm2r- zS%)>zK6{3nR<|4@wT7ytT8Aj4T6jb;X%V3(Cnt|hlGD?97%pEHlaTmO zQ%a{&s0TU&=r?ApK!poQ z_D0B&?IT^?^)l~!Zsds~*Q8{=(5EIQfWxAuruI|5aYCW^Uz{E4Pw2p4mvmDk=fdc2 z{O%LU`P0pd&Iew6etyn4xU)R`Vakh$;2vx_SuN3fFZ&wEAhulq0Aw>Tac~CM&ho}p z@qoZUxs-2f&IE+2B~!0p8-v7kc{dEu9S8)|pxT9UlkaA>akzA9%<=A0)yru`K!t!P z@`)%dEv>Zs=o=0W4nETWx&i0BhO+a|1q}W0utC$zd{+!y_=D^k{*eGaf z$~dDOR)t=K%x}wQWo3ydibeY=XJ?95vo{m9<*)aB0S_FVEia4mha3q4P@)M}2OiW{ zJA)RW46Uv8b#*U${{4|xUoVedP|ZmIN`>psxKAx|z?f29T|M;kr)*JtN^&v)8Gv=U z$t~q%?wle0ryh`ApIaQTypocbBBMe>3ky9nGj1RY0N$!l#9KB$Xf1-ayE1)e{5d!| z9jfbW+NrDp*YDD(=K|kQ)k;oqpyEKZ2Unc;0mfeTeN`8&-{#jtzXOuvdgry#rk%wiV}?}1 z>z;)#>PoFVj)9SmdYG{pnXnVDAokJTV~zJiL1p@Yj%#LcTQ zKs10L_kqsfTKvdL22*!XVOWNuw|Ii`4kS4_`2ZegDyb!TwG)acZ#nt5K<_qOY>g!F$i8ZDD(yH$Un*D5sbS0Jvq7 z&m9?=wrZ3JbHqTlN`_-ja7tdDAfR+B>+6eCo`Z|P4}tEbU59G#wedSv{)?QaA!=9w zx6>ncpUs(m|D`Ot*euZ3!yogEL#ha%!F`6K~|j}DTfOLt;&a#q1aZCz|@CU6sl z6=+72KoVZwTffzxnVYYytz}jRc>DNNdMrK)2ndiJ;AFr)5Kn$SQf#ufw>Q535B&Mb z-U<{7wa2i$)+jZvi^t>fnZrKORW43W5Or3sy2-Q1zP-B(`OCnUGe0{`o(WF)TISKW zk7UIg36TKvcyuz|9~v5Z0Eg4x7#vUh1ps?<}mHh$H!(7v>5n|>=AKTgN4d?TT3hm`eWqXI9w+!#Mb?ppV`87-7vK$>Nz4r_b$ zU^g*QM|k{;U1T}=B#Cmc-gHq-&m}Uapw9Xvtw2nnUCBB#D~Dm(9vp;|B|`lVr+tar ze$7ugx-JDCZp7(FU@{#l>g$h~iO{AnuLJnj8Vg(Dvk2rqg(z-hl3ZJRPwr~WN`$S2 zoEhNl#v42x4RQG;7-@A@y``9)FxBh1q#ZaxkN5|uoXc#BO7Q8?_8VKSvCyNrNd9a_ zw_3fU&@cx=3jF%@>%Jf|Xi%Qp{O5)V3+{B}KCoR&9& zXm9hOoLmC*Xe5&E6!6#iMMYww(erUwfgf@RPr=87juc-dBaSZBP8lESK&H+kZ*A?K zKlr=;f2z;rXzZAi%E_-CPdfC)Rda6FcrFe6DIA$Wv2R@;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u diff --git a/iphone/src/resources/Default.png b/iphone/src/resources/Default.png deleted file mode 100644 index 4c8ca6f693f96d511e9113c0eb59eec552354e42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6540 zcmeAS@N?(olHy`uVBq!ia0y~yU~~ZD2OMlbkt;o0To@QwR5G2N13aCb6#|O#(=u~X z85k@CTSM>X-wqM6>&y>YB4)1;;ojbLbbV-W^iFB1wa3^zCog^LCAReC4K0-?R_2{6 zrP*)4+_uWUy3w5N52M3PW_}MFMP9a~>YLvVZ1D_k*IMQ2QT^fwzoOb(*3gH$%aYWC zkHmcab=va2<#X%jakpJ;<1@F;k__#bwtC&%^D0v(FBh9K&$sK+<}2RJS609D)17$w ztdQP8(eLM8Ka}m_IQ@3wyMKP)l=oM4-?`YS_*P?4V_ORLPxsj&7Ju#kH;>6^Kp?T7~ zl+q?{UOOqV==?+d{=)5s|M~T1mwtH@+Z^$G&eEO9JNP^AX@3jZ*J*!!>lc|1-W%fA z@AOQpXZ_Lt>rxFXrGp*zLPiW@uo_c7C{As>j zWeX)wi+LTp_)@KYZCX{j;H?|1yXT4DnlS(Fr8gyP5|uaX_gLvaW0ScZdnG7o+u{T6 zFI-%d{ls*WuCDa5UJ@|RXv&ejZe}*BMkiWY51&pnRPw(hlykSzvj6e%mYz-GdvzBD zF10?szF_~!jS=?2HyQuPCvARXAe}C}WP|yQ*>5~~=*Nxq8+HHW1~FMDRCP^TcacKuk$ z(U#REVv)D!PhJ*ecH-ELFUrfyV&*)Z)>UCOuS?yd^L@Afk>ihynYPc{^CRwu+JHX+#$@YsC4c|l0tGigsn@jy) zXD($Ouk>H+V(Mr6NQT0S9BFM~V6nkj;1OBOz`zY;a|<&v%$g$sEJPk;hD4M^`1)8S z=jZArrsOB3>Q&?x097+E*i={nnYpPYi3%0DIeEoa6}C!X6;?ntNLXJ<0j#7X+g2&U zH$cHTzbI9~RL@Y)NXd>%K|#T$C?(A*$i)q+9mum)$|xx*u+rBrFE7_CH`dE9O4m2E zw6xSWFw!?N(gmu}Ew0QfNvzP#D^`XW0yD=YwK%ybv!En1KTiQ3|)OBHVcpi zp&D%TL4k-AsNfg_g$9~9p}$+4Ynr|VULLgiakg&)DD)EWO!OHC@snXr}UI${nVUP zpr1>Mf#G6^ng~;pt%^&NvQm>vU@-wn)!_JWN=(;B61LIDR86%A1?G9U(@`={MPdPF zbOKdd`R1o&rd7HmmZaJl85kPr8kp-EnTHsfS{ayIfdU*&4N@e5WSomq6HD@oLh|!- z?7;Dr3*ssm=^5w&a}>G?yzvAH17L|`#|6|0E4}QvA~xC{V_*wu2^AHZU}H9f($4F$btFf{}TLQXUhF5fht1@YV$^ z9BUdFV+73^nIsvRXRM40U}6b7z_6}kHbY}i1LK(xT@6Mi?F5GKBfbp|ZU-3BR*6kv zXcRSQ(0-)mprD+wTr)o_4I;(%zOu)+jEgNB)_SXCVoSa}|F?cfwR!69+L=W3IX z!UiU`0@ph%94Rb33Cpq^IY*r_8XBW%V>G9XmK&p`=xCiXTEmXEH%41uqixaAmicH0 zVYIt6!aI*K%s=kP-v##6IXGZ2Cama>{@)81;C?K-P&M2k<0!GL}5+H~XTq*@SQi|Ft z2*0X`$`8S!qO#)xBeJRkf?;t189=ZB6Imw-h=`q;FP(2UpWZvmJ@=k-@45M(dtb7r zyVEiaLk$=Vw#>zu;st}j6Jf9=m1+nXCFe!$1PrEZ%5Ze_ba8YX_9-*rJujiLuQmJo&2v+Cxes}ec zU|qeux&7*yz#W=X_|wGQskL7*OHNjwFs@sEC+64Hb$Z(#H21Gh$Pe2WzOubdr6fzg z{l{!k%OD?N5Z7j33SoK?YdV6Scm>})U+MIQLNRgIvkZQEc^mP9XBPg%y|S$~Br|;N zk?-!-(Qqh_mQ|6WINQ{hHAjBRV#O#!FkAJ+oxy`L#f8V45*VvWMJFBB5m zG6vOLtDvgoDjHlSq-*h5xM56O>Jjau2f2IxKItIb@coX4XTyf$^{LZG&lI|D95wN1 z!fo0)q>WV7-V;q|A?HR!*bgozJw%j98-~gwBKVV0;=hZIF>7oJSr2YjOWO*rSxz#& z;KXnDrJVZp;Yduiy1-H%s$ZFz6Q=x@$V_B@Tqwl?>6e;EHt|MiK<(#hXQMuj@Jseeh&eN{FxsQ$iw>D1aX1HMMlUbh?Z zmhY4eHffn5&LUbL_}o8|$JYz&$WFiLWmEg0ZPX+;W>@CxQz-%{E5+P7dH9&ey_y$R z@Zzje>2B%z!i!7Brqi{t5Y)~5>vpqRs~2aXD8DVE8vKl=`k(`duI1-k@?!pJ^HA6S zS;3WpuhjQHyoC>X>Xf8gze%_8^#+^RTV>V9&YPAWMjd~%xpSg?ON?kK^X*Pb(o8jR zz;DmaOWMMr6=M~K?MFx4_xDkARTxLJ@W@ohAx z5RD0jGgk?QL@H`VubD2k4}?VtB8@g`%hHBA$2pJ(gK5g1HMNysXEF_BNu-p!&+Qa8_APgopHWnRgg=TZZF*sXWTMQPD z!Q(Au5|+F;7M~`tWbsU98~NA{h0Y7%GB|t&n}w9OOABU4^X*V5xuN;rY(M#ouuqm) zyt!e?28fY!FgP?8GvBsMl_aM^UUVKiGFsleFN?t^<46kO#pF-cX0;sIOb(aM z)^jQgX^Z6pKA9mC@N)_aiHj9HxD2|?A@Y9B_h}(*v3%ek8CXc1Qy^jFPF&zrMa1OZ zSVaF{&ZY|(|H0XE&X>-XQz1`=fF2n@VKC_|h3jlKVM&-jmyMavllcYr`6LVtfq2ou zd+8zkkCB+2)rxq0Lkq_&Ad@g(O8;pAm96>tu79?81T@Z<;gm^3ZtPG-SR94Mr<3tm z9NrR3u*4I5aMlo(09g@8m_;%Rf+XiSa_KZao9n}7N0JrsV#;5Ucr+F*TTzQ8{%f3O zeIUy?WDS|-$LvMc@Z7320)tr}bfIka5hx9H;8H|%our=C+Do0CSFRWue14o5#r8v2 zw=|&r4*eMX%lgCV(ka?*j%H^UuP4LmBC(ON`)&7>NF-|PDRU{-7o`CU0HNbd&c~))@yl9IKu_ zXA+A-!khpP_yx=f#qt2_0ptmgBf4gF!{Y)MW6R$cC1d7@$Yb?+_j zYwfE^5_e`vhT zX=u3r>4$fsxP&apbm@Rcbyuc2T=giqZiMo9@9=oua6#YH0hO-1ak9^rJTPMM qY4Yr5Cu^v99p{E9VdroUHKlRW;M8#BJ^AOQE?e9wSHJo8(7yq;BYKSh diff --git a/iphone/src/resources/Storyboard_iPad.storyboard b/iphone/src/resources/Storyboard_iPad.storyboard deleted file mode 100644 index 39a4f25828059..0000000000000 --- a/iphone/src/resources/Storyboard_iPad.storyboard +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/iphone/test/objc/Example.m b/iphone/test/objc/Example.m deleted file mode 100644 index fca8358c704d8..0000000000000 --- a/iphone/test/objc/Example.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// Example.m -// iWebDriver -// -// Created by Joseph Gentle on 12/3/08. -// Copyright 2008 Google Inc. All rights reserved. -// - -#import "GTMSenTestCase.h" - - -@interface Example : SenTestCase { - -} - -@end - - -@implementation Example - --(void) testExample { - STAssertTrue(YES, @"foo!"); -} - --(void) testExample2 { -// STAssertTrue(NO, @"foo!"); -} -@end diff --git a/iphone/test/objc/GTMDefines.h b/iphone/test/objc/GTMDefines.h deleted file mode 100644 index 3a669d2b714f2..0000000000000 --- a/iphone/test/objc/GTMDefines.h +++ /dev/null @@ -1,388 +0,0 @@ -// -// GTMDefines.h -// -// Copyright 2008 Google Inc. -// -// 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. -// - -// ============================================================================ - -#include -#include - -#if TARGET_OS_IPHONE -#include -#endif // TARGET_OS_IPHONE - -// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs -#ifndef MAC_OS_X_VERSION_10_5 - #define MAC_OS_X_VERSION_10_5 1050 -#endif -#ifndef MAC_OS_X_VERSION_10_6 - #define MAC_OS_X_VERSION_10_6 1060 -#endif - -// Not all __IPHONE_X macros defined in past SDKs -#ifndef __IPHONE_2_1 - #define __IPHONE_2_1 20100 -#endif -#ifndef __IPHONE_2_2 - #define __IPHONE_2_2 20200 -#endif -#ifndef __IPHONE_3_0 - #define __IPHONE_3_0 30000 -#endif -#ifndef __IPHONE_3_1 - #define __IPHONE_3_1 30100 -#endif -#ifndef __IPHONE_3_2 - #define __IPHONE_3_2 30200 -#endif -#ifndef __IPHONE_4_0 - #define __IPHONE_4_0 40000 -#endif - -// ---------------------------------------------------------------------------- -// CPP symbols that can be overridden in a prefix to control how the toolbox -// is compiled. -// ---------------------------------------------------------------------------- - - -// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and -// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens -// when a validation fails. If you implement your own validators, you may want -// to control their internals using the same macros for consistency. -#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT - #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 -#endif - -// Give ourselves a consistent way to do inlines. Apple's macros even use -// a few different actual definitions, so we're based off of the foundation -// one. -#if !defined(GTM_INLINE) - #if defined (__GNUC__) && (__GNUC__ == 4) - #define GTM_INLINE static __inline__ __attribute__((always_inline)) - #else - #define GTM_INLINE static __inline__ - #endif -#endif - -// Give ourselves a consistent way of doing externs that links up nicely -// when mixing objc and objc++ -#if !defined (GTM_EXTERN) - #if defined __cplusplus - #define GTM_EXTERN extern "C" - #define GTM_EXTERN_C_BEGIN extern "C" { - #define GTM_EXTERN_C_END } - #else - #define GTM_EXTERN extern - #define GTM_EXTERN_C_BEGIN - #define GTM_EXTERN_C_END - #endif -#endif - -// Give ourselves a consistent way of exporting things if we have visibility -// set to hidden. -#if !defined (GTM_EXPORT) - #define GTM_EXPORT __attribute__((visibility("default"))) -#endif - -// Give ourselves a consistent way of declaring something as unused. This -// doesn't use __unused because that is only supported in gcc 4.2 and greater. -#if !defined (GTM_UNUSED) -#define GTM_UNUSED(x) ((void)(x)) -#endif - -// _GTMDevLog & _GTMDevAssert -// -// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for -// developer level errors. This implementation simply macros to NSLog/NSAssert. -// It is not intended to be a general logging/reporting system. -// -// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert -// for a little more background on the usage of these macros. -// -// _GTMDevLog log some error/problem in debug builds -// _GTMDevAssert assert if conditon isn't met w/in a method/function -// in all builds. -// -// To replace this system, just provide different macro definitions in your -// prefix header. Remember, any implementation you provide *must* be thread -// safe since this could be called by anything in what ever situtation it has -// been placed in. -// - -// We only define the simple macros if nothing else has defined this. -#ifndef _GTMDevLog - -#ifdef DEBUG - #define _GTMDevLog(...) NSLog(__VA_ARGS__) -#else - #define _GTMDevLog(...) do { } while (0) -#endif - -#endif // _GTMDevLog - -#ifndef _GTMDevAssert -// we directly invoke the NSAssert handler so we can pass on the varargs -// (NSAssert doesn't have a macro we can use that takes varargs) -#if !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) \ - do { \ - if (!(condition)) { \ - [[NSAssertionHandler currentHandler] \ - handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ - file:[NSString stringWithUTF8String:__FILE__] \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } while(0) -#else // !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) do { } while (0) -#endif // !defined(NS_BLOCK_ASSERTIONS) - -#endif // _GTMDevAssert - -// _GTMCompileAssert -// _GTMCompileAssert is an assert that is meant to fire at compile time if you -// want to check things at compile instead of runtime. For example if you -// want to check that a wchar is 4 bytes instead of 2 you would use -// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) -// Note that the second "arg" is not in quotes, and must be a valid processor -// symbol in it's own right (no spaces, punctuation etc). - -// Wrapping this in an #ifndef allows external groups to define their own -// compile time assert scheme. -#ifndef _GTMCompileAssert - // We got this technique from here: - // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html - - #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg - #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) - #define _GTMCompileAssert(test, msg) \ - typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] -#endif // _GTMCompileAssert - -// ---------------------------------------------------------------------------- -// CPP symbols defined based on the project settings so the GTM code has -// simple things to test against w/o scattering the knowledge of project -// setting through all the code. -// ---------------------------------------------------------------------------- - -// Provide a single constant CPP symbol that all of GTM uses for ifdefing -// iPhone code. -#if TARGET_OS_IPHONE // iPhone SDK - // For iPhone specific stuff - #define GTM_IPHONE_SDK 1 - #if TARGET_IPHONE_SIMULATOR - #define GTM_IPHONE_SIMULATOR 1 - #else - #define GTM_IPHONE_DEVICE 1 - #endif // TARGET_IPHONE_SIMULATOR -#else - // For MacOS specific stuff - #define GTM_MACOS_SDK 1 -#endif - -// Some of our own availability macros -#if GTM_MACOS_SDK -#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE -#define GTM_AVAILABLE_ONLY_ON_MACOS -#else -#define GTM_AVAILABLE_ONLY_ON_IPHONE -#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE -#endif - -// Provide a symbol to include/exclude extra code for GC support. (This mainly -// just controls the inclusion of finalize methods). -#ifndef GTM_SUPPORT_GC - #if GTM_IPHONE_SDK - // iPhone never needs GC - #define GTM_SUPPORT_GC 0 - #else - // We can't find a symbol to tell if GC is supported/required, so best we - // do on Mac targets is include it if we're on 10.5 or later. - #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - #define GTM_SUPPORT_GC 0 - #else - #define GTM_SUPPORT_GC 1 - #endif - #endif -#endif - -// To simplify support for 64bit (and Leopard in general), we provide the type -// defines for non Leopard SDKs -#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - // NSInteger/NSUInteger and Max/Mins - #ifndef NSINTEGER_DEFINED - #if __LP64__ || NS_BUILD_32_LIKE_64 - typedef long NSInteger; - typedef unsigned long NSUInteger; - #else - typedef int NSInteger; - typedef unsigned int NSUInteger; - #endif - #define NSIntegerMax LONG_MAX - #define NSIntegerMin LONG_MIN - #define NSUIntegerMax ULONG_MAX - #define NSINTEGER_DEFINED 1 - #endif // NSINTEGER_DEFINED - // CGFloat - #ifndef CGFLOAT_DEFINED - #if defined(__LP64__) && __LP64__ - // This really is an untested path (64bit on Tiger?) - typedef double CGFloat; - #define CGFLOAT_MIN DBL_MIN - #define CGFLOAT_MAX DBL_MAX - #define CGFLOAT_IS_DOUBLE 1 - #else /* !defined(__LP64__) || !__LP64__ */ - typedef float CGFloat; - #define CGFLOAT_MIN FLT_MIN - #define CGFLOAT_MAX FLT_MAX - #define CGFLOAT_IS_DOUBLE 0 - #endif /* !defined(__LP64__) || !__LP64__ */ - #define CGFLOAT_DEFINED 1 - #endif // CGFLOAT_DEFINED -#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - -// Some support for advanced clang static analysis functionality -// See http://clang-analyzer.llvm.org/annotations.html -#ifndef __has_feature // Optional. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#ifndef NS_RETURNS_RETAINED - #if __has_feature(attribute_ns_returns_retained) - #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) - #else - #define NS_RETURNS_RETAINED - #endif -#endif - -#ifndef NS_RETURNS_NOT_RETAINED - #if __has_feature(attribute_ns_returns_not_retained) - #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) - #else - #define NS_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_RETAINED - #if __has_feature(attribute_cf_returns_retained) - #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) - #else - #define CF_RETURNS_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_NOT_RETAINED - #if __has_feature(attribute_cf_returns_not_retained) - #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) - #else - #define CF_RETURNS_NOT_RETAINED - #endif -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_ARGUMENT - #define NS_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_FUNCTION - #define NS_FORMAT_FUNCTION(F,A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_ARGUMENT - #define CF_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_FUNCTION - #define CF_FORMAT_FUNCTION(F,A) -#endif - -#ifndef GTM_NONNULL - #define GTM_NONNULL(x) __attribute__((nonnull(x))) -#endif - -#ifdef __OBJC__ - -// Declared here so that it can easily be used for logging tracking if -// necessary. See GTMUnitTestDevLog.h for details. -@class NSString; -GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...); - -// Macro to allow you to create NSStrings out of other macros. -// #define FOO foo -// NSString *fooString = GTM_NSSTRINGIFY(FOO); -#if !defined (GTM_NSSTRINGIFY) - #define GTM_NSSTRINGIFY_INNER(x) @#x - #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) -#endif - -// Macro to allow fast enumeration when building for 10.5 or later, and -// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration -// does keys, so pick the right thing, nothing is done on the FastEnumeration -// side to be sure you're getting what you wanted. -#ifndef GTM_FOREACH_OBJECT - #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (element in enumeration) - #define GTM_FOREACH_OBJECT(element, collection) \ - for (element in collection) - #define GTM_FOREACH_KEY(element, collection) \ - for (element in collection) - #else - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (NSEnumerator *_ ## element ## _enum = enumeration; \ - (element = [_ ## element ## _enum nextObject]) != nil; ) - #define GTM_FOREACH_OBJECT(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator]) - #define GTM_FOREACH_KEY(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator]) - #endif -#endif - -// ============================================================================ - -// To simplify support for both Leopard and Snow Leopard we declare -// the Snow Leopard protocols that we need here. -#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) -#define GTM_10_6_PROTOCOLS_DEFINED 1 -@protocol NSConnectionDelegate -@end -@protocol NSAnimationDelegate -@end -@protocol NSImageDelegate -@end -@protocol NSTabViewDelegate -@end -#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) - -// GTM_SEL_STRING is for specifying selector (usually property) names to KVC -// or KVO methods. -// In debug it will generate warnings for undeclared selectors if -// -Wunknown-selector is turned on. -// In release it will have no runtime overhead. -#ifndef GTM_SEL_STRING - #ifdef DEBUG - #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName)) - #else - #define GTM_SEL_STRING(selName) @#selName - #endif // DEBUG -#endif // GTM_SEL_STRING - -#endif // __OBJC__ diff --git a/iphone/test/objc/GTMIPhoneUnitTestDelegate.h b/iphone/test/objc/GTMIPhoneUnitTestDelegate.h deleted file mode 100644 index 5a361b388f61a..0000000000000 --- a/iphone/test/objc/GTMIPhoneUnitTestDelegate.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// GTMIPhoneUnitTestDelegate.h -// -// Copyright 2008 Google Inc. -// -// 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 - -// Application delegate that runs all test methods in registered classes -// extending SenTestCase. The application is terminated afterwards. -// You can also run the tests directly from your application by invoking -// runTests and clean up, restore data, etc. before the application -// terminates. -@interface GTMIPhoneUnitTestDelegate : NSObject { - @private - NSUInteger totalFailures_; - NSUInteger totalSuccesses_; - BOOL applicationDidFinishLaunchingCalled_; - GTMIPhoneUnitTestDelegate *retainer_; -} - -// Runs through all the registered classes and runs test methods on any -// that are subclasses of SenTestCase. Prints results and run time to -// the default output. -- (void)runTests; -// Fetch the number of successes or failures from the last runTests. -- (NSUInteger)totalSuccesses; -- (NSUInteger)totalFailures; -@end diff --git a/iphone/test/objc/GTMIPhoneUnitTestDelegate.m b/iphone/test/objc/GTMIPhoneUnitTestDelegate.m deleted file mode 100644 index 6d56602eeca4c..0000000000000 --- a/iphone/test/objc/GTMIPhoneUnitTestDelegate.m +++ /dev/null @@ -1,216 +0,0 @@ -// -// GTMIPhoneUnitTestDelegate.m -// -// Copyright 2008 Google Inc. -// -// 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 "GTMIPhoneUnitTestDelegate.h" - -#import "GTMDefines.h" -#if !GTM_IPHONE_SDK -#error GTMIPhoneUnitTestDelegate for iPhone only -#endif -#import -#import -#import -#import "GTMSenTestCase.h" - -@interface UIApplication (GTMIPhoneUnitTestDelegate) - -// SPI that we need to exit cleanly with a value. -- (void)_terminateWithStatus:(int)status; - -@end - -@interface GTMIPhoneUnitTestDelegate () -// We have cases where we are created in UIApplicationMain, but then the -// user accidentally/intentionally replaces us as a delegate in their xib file -// which means that we never get the applicationDidFinishLaunching: message. -// We can register for the notification, but when the applications delegate -// is reset, it releases us, and we get dealloced. Therefore we have retainer -// which is responsible for retaining us until we get the notification. -// We do it through this slightly roundabout route (instead of just an extra -// retain in the init) so that clang doesn't complain about a leak. -// We also check to make sure we aren't called twice with the -// applicationDidFinishLaunchingCalled flag. -@property (readwrite, retain, nonatomic) GTMIPhoneUnitTestDelegate *retainer; -@end - -@implementation GTMIPhoneUnitTestDelegate - -@synthesize retainer = retainer_; - -- (id)init { - if ((self = [super init])) { - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:self - selector:@selector(applicationDidFinishLaunching:) - name:UIApplicationDidFinishLaunchingNotification - object:[UIApplication sharedApplication]]; - [self setRetainer:self]; - } - return self; -} - -// Run through all the registered classes and run test methods on any -// that are subclasses of SenTestCase. Terminate the application upon -// test completion. -- (void)applicationDidFinishLaunching:(UIApplication *)application { - - // We could get called twice once from our notification registration, and - // once if we actually still are the delegate of the application after - // it has finished launching. So we'll just return if we've been called once. - if (applicationDidFinishLaunchingCalled_) return; - applicationDidFinishLaunchingCalled_ = YES; - - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc removeObserver:self - name:UIApplicationDidFinishLaunchingNotification - object:[UIApplication sharedApplication]]; - - [self runTests]; - - if (!getenv("GTM_DISABLE_TERMINATION")) { - // To help using xcodebuild, make the exit status 0/1 to signal the tests - // success/failure. - int exitStatus = (([self totalFailures] == 0U) ? 0 : 1); - // Alternative to exit(status); so it cleanly terminates the UIApplication - // and classes that depend on this signal to exit cleanly. - if ([application respondsToSelector:@selector(_terminateWithStatus:)]) { - [application performSelector:@selector(_terminateWithStatus:) - withObject:(id)exitStatus]; - } else { - exit(exitStatus); - } - } - - // Release ourself now that we're done. If we really are the application - // delegate, it will have retained us, so we'll stick around if necessary. - [self setRetainer:nil]; -} - -// Run through all the registered classes and run test methods on any -// that are subclasses of SenTestCase. Print results and run time to -// the default output. -- (void)runTests { - int count = objc_getClassList(NULL, 0); - NSMutableData *classData - = [NSMutableData dataWithLength:sizeof(Class) * count]; - Class *classes = (Class*)[classData mutableBytes]; - _GTMDevAssert(classes, @"Couldn't allocate class list"); - objc_getClassList(classes, count); - totalFailures_ = 0; - totalSuccesses_ = 0; - NSString *suiteName = [[NSBundle mainBundle] bundlePath]; - NSDate *suiteStartDate = [NSDate date]; - NSString *suiteStartString - = [NSString stringWithFormat:@"Test Suite '%@' started at %@\n", - suiteName, suiteStartDate]; - fputs([suiteStartString UTF8String], stderr); - fflush(stderr); - for (int i = 0; i < count; ++i) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - Class currClass = classes[i]; - if (class_respondsToSelector(currClass, @selector(conformsToProtocol:)) && - [currClass conformsToProtocol:@protocol(SenTestCase)]) { - NSDate *fixtureStartDate = [NSDate date]; - NSString *fixtureName = NSStringFromClass(currClass); - NSString *fixtureStartString - = [NSString stringWithFormat:@"Test Suite '%@' started at %@\n", - fixtureName, fixtureStartDate]; - int fixtureSuccesses = 0; - int fixtureFailures = 0; - fputs([fixtureStartString UTF8String], stderr); - fflush(stderr); - NSArray *invocations = [currClass testInvocations]; - if ([invocations count]) { - NSInvocation *invocation; - GTM_FOREACH_OBJECT(invocation, invocations) { - GTMTestCase *testCase - = [[currClass alloc] initWithInvocation:invocation]; - BOOL failed = NO; - NSDate *caseStartDate = [NSDate date]; - NSString *selectorName = NSStringFromSelector([invocation selector]); - NSString *caseStartString - = [NSString stringWithFormat:@"Test Case '-[%@ %@]' started.\n", - fixtureName, selectorName]; - fputs([caseStartString UTF8String], stderr); - fflush(stderr); - @try { - [testCase performTest]; - } @catch (NSException *exception) { - failed = YES; - } - if (failed) { - fixtureFailures += 1; - } else { - fixtureSuccesses += 1; - } - NSTimeInterval caseEndTime - = [[NSDate date] timeIntervalSinceDate:caseStartDate]; - NSString *caseEndString - = [NSString stringWithFormat:@"Test Case '-[%@ %@]' %@ (%0.3f " - @"seconds).\n", - fixtureName, selectorName, - failed ? @"failed" : @"passed", - caseEndTime]; - fputs([caseEndString UTF8String], stderr); - fflush(stderr); - [testCase release]; - } - } - NSDate *fixtureEndDate = [NSDate date]; - NSTimeInterval fixtureEndTime - = [fixtureEndDate timeIntervalSinceDate:fixtureStartDate]; - NSString *fixtureEndString - = [NSString stringWithFormat:@"Test Suite '%@' finished at %@.\n" - @"Executed %d tests, with %d failures (%d " - @"unexpected) in %0.3f (%0.3f) seconds\n\n", - fixtureName, fixtureEndDate, - fixtureSuccesses + fixtureFailures, - fixtureFailures, fixtureFailures, - fixtureEndTime, fixtureEndTime]; - - fputs([fixtureEndString UTF8String], stderr); - fflush(stderr); - totalSuccesses_ += fixtureSuccesses; - totalFailures_ += fixtureFailures; - } - [pool release]; - } - NSDate *suiteEndDate = [NSDate date]; - NSTimeInterval suiteEndTime - = [suiteEndDate timeIntervalSinceDate:suiteStartDate]; - NSString *suiteEndString - = [NSString stringWithFormat:@"Test Suite '%@' finished at %@.\n" - @"Executed %d tests, with %d failures (%d " - @"unexpected) in %0.3f (%0.3f) seconds\n\n", - suiteName, suiteEndDate, - totalSuccesses_ + totalFailures_, - totalFailures_, totalFailures_, - suiteEndTime, suiteEndTime]; - fputs([suiteEndString UTF8String], stderr); - fflush(stderr); -} - -- (NSUInteger)totalSuccesses { - return totalSuccesses_; -} - -- (NSUInteger)totalFailures { - return totalFailures_; -} - -@end diff --git a/iphone/test/objc/GTMIPhoneUnitTestMain.m b/iphone/test/objc/GTMIPhoneUnitTestMain.m deleted file mode 100644 index 2a0a70d27f50d..0000000000000 --- a/iphone/test/objc/GTMIPhoneUnitTestMain.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// GTMIPhoneUnitTestMain.m -// -// Copyright 2008 Google Inc. -// -// 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 "GTMDefines.h" -#if !GTM_IPHONE_SDK - #error GTMIPhoneUnitTestMain for iPhone only -#endif -#import - -// Creates an application that runs all tests from classes extending -// SenTestCase, outputs results and test run time, and terminates right -// afterwards. -int main(int argc, char *argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"GTMIPhoneUnitTestDelegate"); - [pool release]; - return retVal; -} diff --git a/iphone/test/objc/GTMObjC2Runtime.h b/iphone/test/objc/GTMObjC2Runtime.h deleted file mode 100644 index 1bb75fac3b9ff..0000000000000 --- a/iphone/test/objc/GTMObjC2Runtime.h +++ /dev/null @@ -1,94 +0,0 @@ -// -// GTMObjC2Runtime.h -// -// Copyright 2007-2008 Google Inc. -// -// 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 -#import -#import "GTMDefines.h" - -// These functions exist for code that we want to compile on both the < 10.5 -// sdks and on the >= 10.5 sdks without warnings. It basically reimplements -// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not -// a complete implementation as I've only implemented the routines I know we -// use. Feel free to add more as necessary. -// These functions are not documented because they conform to the documentation -// for the ObjC2 Runtime. - -#if OBJC_API_VERSION >= 2 // Only have optional and req'd keywords in ObjC2. -#define AT_OPTIONAL @optional -#define AT_REQUIRED @required -#else -#define AT_OPTIONAL -#define AT_REQUIRED -#endif - -// The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h -// was just a wrapper around runtime.h. For the iPhone SDK, this objc-runtime.h -// is removed in the iPhoneOS2.0 SDK. -// -// The |Object| class was removed in the iPhone2.0 SDK too. -#if GTM_IPHONE_SDK -#import -#import -#else -#import -#import -#endif - -#import - -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 -#import "objc/Protocol.h" - -OBJC_EXPORT Class object_getClass(id obj); -OBJC_EXPORT const char *class_getName(Class cls); -OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol); -OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel); -OBJC_EXPORT Class class_getSuperclass(Class cls); -OBJC_EXPORT Method *class_copyMethodList(Class cls, unsigned int *outCount); -OBJC_EXPORT SEL method_getName(Method m); -OBJC_EXPORT void method_exchangeImplementations(Method m1, Method m2); -OBJC_EXPORT IMP method_getImplementation(Method method); -OBJC_EXPORT IMP method_setImplementation(Method method, IMP imp); -OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protocol *p, - SEL aSel, - BOOL isRequiredMethod, - BOOL isInstanceMethod); - -// If building for 10.4 but using the 10.5 SDK, don't include these. -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -// atomics -// On Leopard these are GC aware -// Intentionally did not include the non-barrier versions, because I couldn't -// come up with a case personally where you wouldn't want to use the -// barrier versions. -GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate, - void *replacement, - void * volatile *theValue) { -#if defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap64Barrier((int64_t)predicate, - (int64_t)replacement, - (int64_t *)theValue); -#else // defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap32Barrier((int32_t)predicate, - (int32_t)replacement, - (int32_t *)theValue); -#endif // defined(__LP64__) && __LP64__ -} - -#endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 diff --git a/iphone/test/objc/GTMSenTestCase.h b/iphone/test/objc/GTMSenTestCase.h deleted file mode 100644 index 5f7b03c55b8a5..0000000000000 --- a/iphone/test/objc/GTMSenTestCase.h +++ /dev/null @@ -1,1034 +0,0 @@ -// -// GTMSenTestCase.h -// -// Copyright 2007-2008 Google Inc. -// -// 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. -// - -// Portions of this file fall under the following license, marked with -// SENTE_BEGIN - SENTE_END -// -// Copyright (c) 1997-2005, Sen:te (Sente SA). All rights reserved. -// -// Use of this source code is governed by the following license: -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// (1) Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// (2) Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL Sente SA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Note: this license is equivalent to the FreeBSD license. -// -// This notice may not be removed from this file. - -// Some extra test case macros that would have been convenient for SenTestingKit -// to provide. I didn't stick GTM in front of the Macro names, so that they would -// be easy to remember. - -#import "GTMDefines.h" - -#if (!GTM_IPHONE_SDK) -#import -#else -#import -#ifdef __cplusplus -extern "C" { -#endif -NSString *STComposeString(NSString *, ...); -#ifdef __cplusplus -} -#endif - -#endif // !GTM_IPHONE_SDK - -// Generates a failure when a1 != noErr -// Args: -// a1: should be either an OSErr or an OSStatus -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNoErr(a1, description, ...) \ -do { \ - @try { \ - OSStatus a1value = (a1); \ - if (a1value != noErr) { \ - NSString *_expression = [NSString stringWithFormat:@"Expected noErr, got %ld for (%s)", a1value, #a1]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == noErr fails", #a1] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when a1 != a2 -// Args: -// a1: received value. Should be either an OSErr or an OSStatus -// a2: expected value. Should be either an OSErr or an OSStatus -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertErr(a1, a2, description, ...) \ -do { \ - @try { \ - OSStatus a1value = (a1); \ - OSStatus a2value = (a2); \ - if (a1value != a2value) { \ - NSString *_expression = [NSString stringWithFormat:@"Expected %s(%ld) but got %ld for (%s)", #a2, a2value, a1value, #a1]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s) fails", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - - -// Generates a failure when a1 is NULL -// Args: -// a1: should be a pointer (use STAssertNotNil for an object) -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNotNULL(a1, description, ...) \ -do { \ - @try { \ - const void* a1value = (a1); \ - if (a1value == NULL) { \ - NSString *_expression = [NSString stringWithFormat:@"((%s) != NULL)", #a1]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != NULL fails", #a1] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when a1 is not NULL -// Args: -// a1: should be a pointer (use STAssertNil for an object) -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNULL(a1, description, ...) \ -do { \ - @try { \ - const void* a1value = (a1); \ - if (a1value != NULL) { \ - NSString *_expression = [NSString stringWithFormat:@"((%s) == NULL)", #a1]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == NULL fails", #a1] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when a1 is equal to a2. This test is for C scalars, -// structs and unions. -// Args: -// a1: argument 1 -// a2: argument 2 -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNotEquals(a1, a2, description, ...) \ -do { \ - @try { \ - if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \ - [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \ - } else { \ - __typeof__(a1) a1value = (a1); \ - __typeof__(a2) a2value = (a2); \ - NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \ - NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \ - if ([a1encoded isEqualToValue:a2encoded]) { \ - NSString *_expression = [NSString stringWithFormat:@"((%s) != (%s))", #a1, #a2]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - }\ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when a1 is equal to a2. This test is for objects. -// Args: -// a1: argument 1. object. -// a2: argument 2. object. -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNotEqualObjects(a1, a2, description, ...) \ -do { \ - @try {\ - id a1value = (a1); \ - id a2value = (a2); \ - if ( (strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \ - (strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \ - (![(id)a1value isEqual:(id)a2value]) ) continue; \ - [self failWithException:([NSException failureInEqualityBetweenObject:a1value \ - andObject:a2value \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - }\ - @catch (id anException) {\ - [self failWithException:([NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - }\ -} while(0) - -// Generates a failure when a1 is not 'op' to a2. This test is for C scalars. -// Args: -// a1: argument 1 -// a2: argument 2 -// op: operation -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertOperation(a1, a2, op, description, ...) \ -do { \ - @try { \ - if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \ - [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \ - } else { \ - __typeof__(a1) a1value = (a1); \ - __typeof__(a2) a2value = (a2); \ - if (!(a1value op a2value)) { \ - double a1DoubleValue = a1value; \ - double a2DoubleValue = a2value; \ - NSString *_expression = [NSString stringWithFormat:@"(%s (%lg) %s %s (%lg))", #a1, a1DoubleValue, #op, #a2, a2DoubleValue]; \ - [self failWithException:([NSException failureInCondition:_expression \ - isTrue:NO \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \ - } \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException \ - failureInRaise:[NSString stringWithFormat:@"(%s) %s (%s)", #a1, #op, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when a1 is not > a2. This test is for C scalars. -// Args: -// a1: argument 1 -// a2: argument 2 -// op: operation -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertGreaterThan(a1, a2, description, ...) \ - STAssertOperation(a1, a2, >, description, ##__VA_ARGS__) - -// Generates a failure when a1 is not >= a2. This test is for C scalars. -// Args: -// a1: argument 1 -// a2: argument 2 -// op: operation -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertGreaterThanOrEqual(a1, a2, description, ...) \ - STAssertOperation(a1, a2, >=, description, ##__VA_ARGS__) - -// Generates a failure when a1 is not < a2. This test is for C scalars. -// Args: -// a1: argument 1 -// a2: argument 2 -// op: operation -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertLessThan(a1, a2, description, ...) \ - STAssertOperation(a1, a2, <, description, ##__VA_ARGS__) - -// Generates a failure when a1 is not <= a2. This test is for C scalars. -// Args: -// a1: argument 1 -// a2: argument 2 -// op: operation -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertLessThanOrEqual(a1, a2, description, ...) \ - STAssertOperation(a1, a2, <=, description, ##__VA_ARGS__) - -// Generates a failure when string a1 is not equal to string a2. This call -// differs from STAssertEqualObjects in that strings that are different in -// composition (precomposed vs decomposed) will compare equal if their final -// representation is equal. -// ex O + umlaut decomposed is the same as O + umlaut composed. -// Args: -// a1: string 1 -// a2: string 2 -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertEqualStrings(a1, a2, description, ...) \ -do { \ - @try { \ - id a1value = (a1); \ - id a2value = (a2); \ - if (a1value == a2value) continue; \ - if ([a1value isKindOfClass:[NSString class]] && \ - [a2value isKindOfClass:[NSString class]] && \ - [a1value compare:a2value options:0] == NSOrderedSame) continue; \ - [self failWithException:[NSException failureInEqualityBetweenObject: a1value \ - andObject: a2value \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when string a1 is equal to string a2. This call -// differs from STAssertEqualObjects in that strings that are different in -// composition (precomposed vs decomposed) will compare equal if their final -// representation is equal. -// ex O + umlaut decomposed is the same as O + umlaut composed. -// Args: -// a1: string 1 -// a2: string 2 -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNotEqualStrings(a1, a2, description, ...) \ -do { \ - @try { \ - id a1value = (a1); \ - id a2value = (a2); \ - if ([a1value isKindOfClass:[NSString class]] && \ - [a2value isKindOfClass:[NSString class]] && \ - [a1value compare:a2value options:0] != NSOrderedSame) continue; \ - [self failWithException:[NSException failureInEqualityBetweenObject: a1value \ - andObject: a2value \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when c-string a1 is not equal to c-string a2. -// Args: -// a1: string 1 -// a2: string 2 -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertEqualCStrings(a1, a2, description, ...) \ -do { \ - @try { \ - const char* a1value = (a1); \ - const char* a2value = (a2); \ - if (a1value == a2value) continue; \ - if (strcmp(a1value, a2value) == 0) continue; \ - [self failWithException:[NSException failureInEqualityBetweenObject: [NSString stringWithUTF8String:a1value] \ - andObject: [NSString stringWithUTF8String:a2value] \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -// Generates a failure when c-string a1 is equal to c-string a2. -// Args: -// a1: string 1 -// a2: string 2 -// description: A format string as in the printf() function. Can be nil or -// an empty string but must be present. -// ...: A variable number of arguments to the format string. Can be absent. -#define STAssertNotEqualCStrings(a1, a2, description, ...) \ -do { \ - @try { \ - const char* a1value = (a1); \ - const char* a2value = (a2); \ - if (strcmp(a1value, a2value) != 0) continue; \ - [self failWithException:[NSException failureInEqualityBetweenObject: [NSString stringWithUTF8String:a1value] \ - andObject: [NSString stringWithUTF8String:a2value] \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -#if GTM_IPHONE_SDK - -// SENTE_BEGIN -/*" Generates a failure when !{ [a1 isEqualTo:a2] } is false - (or one is nil and the other is not). - _{a1 The object on the left.} - _{a2 The object on the right.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertEqualObjects(a1, a2, description, ...) \ -do { \ - @try { \ - id a1value = (a1); \ - id a2value = (a2); \ - if (a1value == a2value) continue; \ - if ((strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \ - (strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \ - [(id)a1value isEqual: (id)a2value]) continue; \ - [self failWithException:[NSException failureInEqualityBetweenObject: a1value \ - andObject: a2value \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - - -/*" Generates a failure when a1 is not equal to a2. This test is for - C scalars, structs and unions. - _{a1 The argument on the left.} - _{a2 The argument on the right.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertEquals(a1, a2, description, ...) \ -do { \ - @try { \ - if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \ - [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \ - } else { \ - __typeof__(a1) a1value = (a1); \ - __typeof__(a2) a2value = (a2); \ - NSValue *a1encoded = [NSValue value:&a1value withObjCType: @encode(__typeof__(a1))]; \ - NSValue *a2encoded = [NSValue value:&a2value withObjCType: @encode(__typeof__(a2))]; \ - if (![a1encoded isEqualToValue:a2encoded]) { \ - [self failWithException:[NSException failureInEqualityBetweenValue: a1encoded \ - andValue: a2encoded \ - withAccuracy: nil \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - -#define STAbsoluteDifference(left,right) (MAX(left,right)-MIN(left,right)) - - -/*" Generates a failure when a1 is not equal to a2 within + or - accuracy is false. - This test is for scalars such as floats and doubles where small differences - could make these items not exactly equal, but also works for all scalars. - _{a1 The scalar on the left.} - _{a2 The scalar on the right.} - _{accuracy The maximum difference between a1 and a2 for these values to be - considered equal.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ - -#define STAssertEqualsWithAccuracy(a1, a2, accuracy, description, ...) \ -do { \ - @try { \ - if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \ - [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \ - } else { \ - __typeof__(a1) a1value = (a1); \ - __typeof__(a2) a2value = (a2); \ - __typeof__(accuracy) accuracyvalue = (accuracy); \ - if (STAbsoluteDifference(a1value, a2value) > accuracyvalue) { \ - NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \ - NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \ - NSValue *accuracyencoded = [NSValue value:&accuracyvalue withObjCType:@encode(__typeof__(accuracy))]; \ - [self failWithException:[NSException failureInEqualityBetweenValue: a1encoded \ - andValue: a2encoded \ - withAccuracy: accuracyencoded \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - - - -/*" Generates a failure unconditionally. - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STFail(description, ...) \ -[self failWithException:[NSException failureInFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]] - - - -/*" Generates a failure when a1 is not nil. - _{a1 An object.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertNil(a1, description, ...) \ -do { \ - @try { \ - id a1value = (a1); \ - if (a1value != nil) { \ - NSString *_a1 = [NSString stringWithUTF8String: #a1]; \ - NSString *_expression = [NSString stringWithFormat:@"((%@) == nil)", _a1]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: NO \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) == nil fails", #a1] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - - -/*" Generates a failure when a1 is nil. - _{a1 An object.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertNotNil(a1, description, ...) \ -do { \ - @try { \ - id a1value = (a1); \ - if (a1value == nil) { \ - NSString *_a1 = [NSString stringWithUTF8String: #a1]; \ - NSString *_expression = [NSString stringWithFormat:@"((%@) != nil)", _a1]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: NO \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) != nil fails", #a1] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while(0) - - -/*" Generates a failure when expression evaluates to false. - _{expr The expression that is tested.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertTrue(expr, description, ...) \ -do { \ - BOOL _evaluatedExpression = (expr); \ - if (!_evaluatedExpression) { \ - NSString *_expression = [NSString stringWithUTF8String: #expr]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: NO \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while (0) - - -/*" Generates a failure when expression evaluates to false and in addition will - generate error messages if an exception is encountered. - _{expr The expression that is tested.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertTrueNoThrow(expr, description, ...) \ -do { \ - @try { \ - BOOL _evaluatedExpression = (expr); \ - if (!_evaluatedExpression) { \ - NSString *_expression = [NSString stringWithUTF8String: #expr]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: NO \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) ", #expr] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while (0) - - -/*" Generates a failure when the expression evaluates to true. - _{expr The expression that is tested.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertFalse(expr, description, ...) \ -do { \ - BOOL _evaluatedExpression = (expr); \ - if (_evaluatedExpression) { \ - NSString *_expression = [NSString stringWithUTF8String: #expr]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: YES \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while (0) - - -/*" Generates a failure when the expression evaluates to true and in addition - will generate error messages if an exception is encountered. - _{expr The expression that is tested.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertFalseNoThrow(expr, description, ...) \ -do { \ - @try { \ - BOOL _evaluatedExpression = (expr); \ - if (_evaluatedExpression) { \ - NSString *_expression = [NSString stringWithUTF8String: #expr]; \ - [self failWithException:[NSException failureInCondition: _expression \ - isTrue: YES \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"!(%s) ", #expr] \ - exception:anException \ - inFile:[NSString stringWithUTF8String:__FILE__] \ - atLine:__LINE__ \ - withDescription:STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while (0) - - -/*" Generates a failure when expression does not throw an exception. - _{expression The expression that is evaluated.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent. -"*/ -#define STAssertThrows(expr, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (id anException) { \ - continue; \ - } \ - [self failWithException:[NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: nil \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ -} while (0) - - -/*" Generates a failure when expression does not throw an exception of a - specific class. - _{expression The expression that is evaluated.} - _{specificException The specified class of the exception.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertThrowsSpecific(expr, specificException, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (specificException *anException) { \ - continue; \ - } \ - @catch (id anException) { \ - NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \ - [self failWithException:[NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ - continue; \ - } \ - NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \ - [self failWithException:[NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: nil \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ -} while (0) - - -/*" Generates a failure when expression does not throw an exception of a - specific class with a specific name. Useful for those frameworks like - AppKit or Foundation that throw generic NSException w/specific names - (NSInvalidArgumentException, etc). - _{expression The expression that is evaluated.} - _{specificException The specified class of the exception.} - _{aName The name of the specified exception.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} - -"*/ -#define STAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (specificException *anException) { \ - if ([aName isEqualToString: [anException name]]) continue; \ - NSString *_descrip = STComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description); \ - [self failWithException: \ - [NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ - continue; \ - } \ - @catch (id anException) { \ - NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \ - [self failWithException: \ - [NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ - continue; \ - } \ - NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \ - [self failWithException: \ - [NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: nil \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ -} while (0) - - -/*" Generates a failure when expression does throw an exception. - _{expression The expression that is evaluated.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertNoThrow(expr, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (id anException) { \ - [self failWithException:[NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ -} while (0) - - -/*" Generates a failure when expression does throw an exception of the specitied - class. Any other exception is okay (i.e. does not generate a failure). - _{expression The expression that is evaluated.} - _{specificException The specified class of the exception.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} -"*/ -#define STAssertNoThrowSpecific(expr, specificException, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (specificException *anException) { \ - [self failWithException:[NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(description, ##__VA_ARGS__)]]; \ - } \ - @catch (id anythingElse) { \ - ; \ - } \ -} while (0) - - -/*" Generates a failure when expression does throw an exception of a - specific class with a specific name. Useful for those frameworks like - AppKit or Foundation that throw generic NSException w/specific names - (NSInvalidArgumentException, etc). - _{expression The expression that is evaluated.} - _{specificException The specified class of the exception.} - _{aName The name of the specified exception.} - _{description A format string as in the printf() function. Can be nil or - an empty string but must be present.} - _{... A variable number of arguments to the format string. Can be absent.} - -"*/ -#define STAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) \ -do { \ - @try { \ - (expr); \ - } \ - @catch (specificException *anException) { \ - if ([aName isEqualToString: [anException name]]) { \ - NSString *_descrip = STComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description); \ - [self failWithException: \ - [NSException failureInRaise: [NSString stringWithUTF8String:#expr] \ - exception: anException \ - inFile: [NSString stringWithUTF8String:__FILE__] \ - atLine: __LINE__ \ - withDescription: STComposeString(_descrip, ##__VA_ARGS__)]]; \ - } \ - continue; \ - } \ - @catch (id anythingElse) { \ - ; \ - } \ -} while (0) - - - -@interface NSException (GTMSenTestAdditions) -+ (NSException *)failureInFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ...; -+ (NSException *)failureInCondition:(NSString *)condition - isTrue:(BOOL)isTrue - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ...; -+ (NSException *)failureInEqualityBetweenObject:(id)left - andObject:(id)right - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ...; -+ (NSException *)failureInEqualityBetweenValue:(NSValue *)left - andValue:(NSValue *)right - withAccuracy:(NSValue *)accuracy - inFile:(NSString *)filename - atLine:(int) ineNumber - withDescription:(NSString *)formatString, ...; -+ (NSException *)failureInRaise:(NSString *)expression - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ...; -+ (NSException *)failureInRaise:(NSString *)expression - exception:(NSException *)exception - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ...; -@end - -// SENTE_END - -@protocol SenTestCase -+ (id)testCaseWithInvocation:(NSInvocation *)anInvocation; -- (id)initWithInvocation:(NSInvocation *)anInvocation; -- (void)setUp; -- (void)invokeTest; -- (void)tearDown; -- (void)performTest; -- (void)failWithException:(NSException*)exception; -- (NSInvocation *)invocation; -- (SEL)selector; -+ (NSArray *)testInvocations; -@end - -@interface SenTestCase : NSObject { - @private - NSInvocation *invocation_; -} -@end - -GTM_EXTERN NSString *const SenTestFailureException; - -GTM_EXTERN NSString *const SenTestFilenameKey; -GTM_EXTERN NSString *const SenTestLineNumberKey; - -#endif // GTM_IPHONE_SDK - -// All unittest cases in GTM should inherit from GTMTestCase. It makes sure -// to set up our logging system correctly to verify logging calls. -// See GTMUnitTestDevLog.h for details -@interface GTMTestCase : SenTestCase - -// Returns YES if this is an abstract testCase class as opposed to a concrete -// testCase class that you want tests run against. SenTestCase is not designed -// out of the box to handle an abstract class hierarchy descending from it with -// some concrete subclasses. In some cases we want all the "concrete" -// subclasses of an abstract subclass of SenTestCase to run a test, but we don't -// want that test to be run against an instance of an abstract subclass itself. -// By returning "YES" here, the tests defined by this class won't be run against -// an instance of this class. As an example class hierarchy: -// -// FooExtensionTestCase -// GTMTestCase <- ExtensionAbstractTestCase < -// BarExtensionTestCase -// -// So FooExtensionTestCase and BarExtensionTestCase inherit from -// ExtensionAbstractTestCase (and probably FooExtension and BarExtension inherit -// from a class named Extension). We want the tests in ExtensionAbstractTestCase -// to be run as part of FooExtensionTestCase and BarExtensionTestCase, but we -// don't want them run against ExtensionAbstractTestCase. The default -// implementation checks to see if the name of the class contains the word -// "AbstractTest" (case sensitive). -+ (BOOL)isAbstractTestCase; - -@end diff --git a/iphone/test/objc/GTMSenTestCase.m b/iphone/test/objc/GTMSenTestCase.m deleted file mode 100644 index 2b0a8f7328041..0000000000000 --- a/iphone/test/objc/GTMSenTestCase.m +++ /dev/null @@ -1,498 +0,0 @@ -// -// GTMSenTestCase.m -// -// Copyright 2007-2008 Google Inc. -// -// 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 "GTMSenTestCase.h" - -#import -#if GTM_IPHONE_SIMULATOR -#import -#endif - -#import "GTMObjC2Runtime.h" -#import "GTMUnitTestDevLog.h" - -#if !GTM_IPHONE_SDK -#import "GTMGarbageCollection.h" -#endif // !GTM_IPHONE_SDK - -#if GTM_IPHONE_SDK -#import - -@interface NSException (GTMSenTestPrivateAdditions) -+ (NSException *)failureInFile:(NSString *)filename - atLine:(int)lineNumber - reason:(NSString *)reason; -@end - -@implementation NSException (GTMSenTestPrivateAdditions) -+ (NSException *)failureInFile:(NSString *)filename - atLine:(int)lineNumber - reason:(NSString *)reason { - NSDictionary *userInfo = - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInteger:lineNumber], SenTestLineNumberKey, - filename, SenTestFilenameKey, - nil]; - - return [self exceptionWithName:SenTestFailureException - reason:reason - userInfo:userInfo]; -} -@end - -@implementation NSException (GTMSenTestAdditions) - -+ (NSException *)failureInFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason = testDescription; - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -+ (NSException *)failureInCondition:(NSString *)condition - isTrue:(BOOL)isTrue - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason = [NSString stringWithFormat:@"'%@' should be %s. %@", - condition, isTrue ? "false" : "true", testDescription]; - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -+ (NSException *)failureInEqualityBetweenObject:(id)left - andObject:(id)right - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason = - [NSString stringWithFormat:@"'%@' should be equal to '%@'. %@", - [left description], [right description], testDescription]; - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -+ (NSException *)failureInEqualityBetweenValue:(NSValue *)left - andValue:(NSValue *)right - withAccuracy:(NSValue *)accuracy - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason; - if (accuracy) { - reason = - [NSString stringWithFormat:@"'%@' should be equal to '%@'. %@", - left, right, testDescription]; - } else { - reason = - [NSString stringWithFormat:@"'%@' should be equal to '%@' +/-'%@'. %@", - left, right, accuracy, testDescription]; - } - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -+ (NSException *)failureInRaise:(NSString *)expression - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason = [NSString stringWithFormat:@"'%@' should raise. %@", - expression, testDescription]; - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -+ (NSException *)failureInRaise:(NSString *)expression - exception:(NSException *)exception - inFile:(NSString *)filename - atLine:(int)lineNumber - withDescription:(NSString *)formatString, ... { - - NSString *testDescription = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - testDescription = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - - NSString *reason; - if ([[exception name] isEqualToString:SenTestFailureException]) { - // it's our exception, assume it has the right description on it. - reason = [exception reason]; - } else { - // not one of our exception, use the exceptions reason and our description - reason = [NSString stringWithFormat:@"'%@' raised '%@'. %@", - expression, [exception reason], testDescription]; - } - - return [self failureInFile:filename atLine:lineNumber reason:reason]; -} - -@end - -NSString *STComposeString(NSString *formatString, ...) { - NSString *reason = @""; - if (formatString) { - va_list vl; - va_start(vl, formatString); - reason = - [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease]; - va_end(vl); - } - return reason; -} - -NSString *const SenTestFailureException = @"SenTestFailureException"; -NSString *const SenTestFilenameKey = @"SenTestFilenameKey"; -NSString *const SenTestLineNumberKey = @"SenTestLineNumberKey"; - -@interface SenTestCase (SenTestCasePrivate) -// our method of logging errors -+ (void)printException:(NSException *)exception fromTestName:(NSString *)name; -@end - -@implementation SenTestCase -+ (id)testCaseWithInvocation:(NSInvocation *)anInvocation { - return [[[[self class] alloc] initWithInvocation:anInvocation] autorelease]; -} - -- (id)initWithInvocation:(NSInvocation *)anInvocation { - if ((self = [super init])) { - invocation_ = [anInvocation retain]; - } - return self; -} - -- (void)dealloc { - [invocation_ release]; - [super dealloc]; -} - -- (void)failWithException:(NSException*)exception { - [exception raise]; -} - -- (void)setUp { -} - -- (void)performTest { - @try { - [self invokeTest]; - } @catch (NSException *exception) { - [[self class] printException:exception - fromTestName:NSStringFromSelector([self selector])]; - [exception raise]; - } -} - -- (NSInvocation *)invocation { - return invocation_; -} - -- (SEL)selector { - return [invocation_ selector]; -} - -+ (void)printException:(NSException *)exception fromTestName:(NSString *)name { - NSDictionary *userInfo = [exception userInfo]; - NSString *filename = [userInfo objectForKey:SenTestFilenameKey]; - NSNumber *lineNumber = [userInfo objectForKey:SenTestLineNumberKey]; - NSString *className = NSStringFromClass([self class]); - if ([filename length] == 0) { - filename = @"Unknown.m"; - } - fprintf(stderr, "%s:%ld: error: -[%s %s] : %s\n", - [filename UTF8String], - (long)[lineNumber integerValue], - [className UTF8String], - [name UTF8String], - [[exception reason] UTF8String]); - fflush(stderr); -} - -- (void)invokeTest { - NSException *e = nil; - @try { - // Wrap things in autorelease pools because they may - // have an STMacro in their dealloc which may get called - // when the pool is cleaned up - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - // We don't log exceptions here, instead we let the person that called - // this log the exception. This ensures they are only logged once but the - // outer layers get the exceptions to report counts, etc. - @try { - [self setUp]; - @try { - NSInvocation *invocation = [self invocation]; -#if GTM_IPHONE_SIMULATOR - // We don't call [invocation invokeWithTarget:self]; because of - // Radar 8081169: NSInvalidArgumentException can't be caught - // It turns out that on iOS4 (and 3.2) exceptions thrown inside an - // [invocation invoke] on the simulator cannot be caught. - // http://openradar.appspot.com/8081169 - objc_msgSend(self, [invocation selector]); -#else - [invocation invokeWithTarget:self]; -#endif - } @catch (NSException *exception) { - e = [exception retain]; - } - [self tearDown]; - } @catch (NSException *exception) { - e = [exception retain]; - } - [pool release]; - } @catch (NSException *exception) { - e = [exception retain]; - } - if (e) { - [e autorelease]; - [e raise]; - } -} - -- (void)tearDown { -} - -- (NSString *)description { - // This matches the description OCUnit would return to you - return [NSString stringWithFormat:@"-[%@ %@]", [self class], - NSStringFromSelector([self selector])]; -} - -// Used for sorting methods below -static int MethodSort(id a, id b, void *context) { - NSInvocation *invocationA = a; - NSInvocation *invocationB = b; - const char *nameA = sel_getName([invocationA selector]); - const char *nameB = sel_getName([invocationB selector]); - return strcmp(nameA, nameB); -} - - -+ (NSArray *)testInvocations { - NSMutableArray *invocations = nil; - // Need to walk all the way up the parent classes collecting methods (in case - // a test is a subclass of another test). - Class senTestCaseClass = [SenTestCase class]; - for (Class currentClass = self; - currentClass && (currentClass != senTestCaseClass); - currentClass = class_getSuperclass(currentClass)) { - unsigned int methodCount; - Method *methods = class_copyMethodList(currentClass, &methodCount); - if (methods) { - // This handles disposing of methods for us even if an exception should fly. - [NSData dataWithBytesNoCopy:methods - length:sizeof(Method) * methodCount]; - if (!invocations) { - invocations = [NSMutableArray arrayWithCapacity:methodCount]; - } - for (size_t i = 0; i < methodCount; ++i) { - Method currMethod = methods[i]; - SEL sel = method_getName(currMethod); - char *returnType = NULL; - const char *name = sel_getName(sel); - // If it starts with test, takes 2 args (target and sel) and returns - // void run it. - if (strstr(name, "test") == name) { - returnType = method_copyReturnType(currMethod); - if (returnType) { - // This handles disposing of returnType for us even if an - // exception should fly. Length +1 for the terminator, not that - // the length really matters here, as we never reference inside - // the data block. - [NSData dataWithBytesNoCopy:returnType - length:strlen(returnType) + 1]; - } - } - // TODO: If a test class is a subclass of another, and they reuse the - // same selector name (ie-subclass overrides it), this current loop - // and test here will cause cause it to get invoked twice. To fix this - // the selector would have to be checked against all the ones already - // added, so it only gets done once. - if (returnType // True if name starts with "test" - && strcmp(returnType, @encode(void)) == 0 - && method_getNumberOfArguments(currMethod) == 2) { - NSMethodSignature *sig = [self instanceMethodSignatureForSelector:sel]; - NSInvocation *invocation - = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocations addObject:invocation]; - } - } - } - } - // Match SenTestKit and run everything in alphbetical order. - [invocations sortUsingFunction:MethodSort context:nil]; - return invocations; -} - -@end - -#endif // GTM_IPHONE_SDK - -@implementation GTMTestCase : SenTestCase -- (void)invokeTest { - Class devLogClass = NSClassFromString(@"GTMUnitTestDevLog"); - if (devLogClass) { - [devLogClass performSelector:@selector(enableTracking)]; - [devLogClass performSelector:@selector(verifyNoMoreLogsExpected)]; - - } - [super invokeTest]; - if (devLogClass) { - [devLogClass performSelector:@selector(verifyNoMoreLogsExpected)]; - [devLogClass performSelector:@selector(disableTracking)]; - } -} - -+ (BOOL)isAbstractTestCase { - NSString *name = NSStringFromClass(self); - return [name rangeOfString:@"AbstractTest"].location != NSNotFound; -} - -+ (NSArray *)testInvocations { - NSArray *invocations = nil; - if (![self isAbstractTestCase]) { - invocations = [super testInvocations]; - } - return invocations; -} - -@end - -// Leak detection -#if !GTM_IPHONE_DEVICE -// Don't want to get leaks on the iPhone Device as the device doesn't -// have 'leaks'. The simulator does though. - -// COV_NF_START -// We don't have leak checking on by default, so this won't be hit. -static void _GTMRunLeaks(void) { - // This is an atexit handler. It runs leaks for us to check if we are - // leaking anything in our tests. - const char* cExclusionsEnv = getenv("GTM_LEAKS_SYMBOLS_TO_IGNORE"); - NSMutableString *exclusions = [NSMutableString string]; - if (cExclusionsEnv) { - NSString *exclusionsEnv = [NSString stringWithUTF8String:cExclusionsEnv]; - NSArray *exclusionsArray = [exclusionsEnv componentsSeparatedByString:@","]; - NSString *exclusion; - NSCharacterSet *wcSet = [NSCharacterSet whitespaceCharacterSet]; - GTM_FOREACH_OBJECT(exclusion, exclusionsArray) { - exclusion = [exclusion stringByTrimmingCharactersInSet:wcSet]; - [exclusions appendFormat:@"-exclude \"%@\" ", exclusion]; - } - } - // Clearing out DYLD_ROOT_PATH because iPhone Simulator framework libraries - // are different from regular OS X libraries and leaks will fail to run - // because of missing symbols. Also capturing the output of leaks and then - // pipe rather than a direct pipe, because otherwise if leaks failed, - // the system() call will still be successful. Bug: - // http://code.google.com/p/google-toolbox-for-mac/issues/detail?id=56 - NSString *string - = [NSString stringWithFormat: - @"LeakOut=`DYLD_ROOT_PATH='' /usr/bin/leaks %@%d` &&" - @"echo \"$LeakOut\"|/usr/bin/sed -e 's/Leak: /Leaks:0: warning: Leak /'", - exclusions, getpid()]; - int ret = system([string UTF8String]); - if (ret) { - fprintf(stderr, - "%s:%d: Error: Unable to run leaks. 'system' returned: %d\n", - __FILE__, __LINE__, ret); - fflush(stderr); - } -} -// COV_NF_END - -static __attribute__((constructor)) void _GTMInstallLeaks(void) { - BOOL checkLeaks = YES; -#if !GTM_IPHONE_SDK - checkLeaks = GTMIsGarbageCollectionEnabled() ? NO : YES; -#endif // !GTM_IPHONE_SDK - if (checkLeaks) { - checkLeaks = getenv("GTM_ENABLE_LEAKS") ? YES : NO; - if (checkLeaks) { - // COV_NF_START - // We don't have leak checking on by default, so this won't be hit. - fprintf(stderr, "Leak Checking Enabled\n"); - fflush(stderr); - int ret = atexit(&_GTMRunLeaks); - // To avoid unused variable warning when _GTMDevAssert is stripped. - (void)ret; - _GTMDevAssert(ret == 0, - @"Unable to install _GTMRunLeaks as an atexit handler (%d)", - errno); - // COV_NF_END - } - } -} - -#endif // !GTM_IPHONE_DEVICE diff --git a/iphone/test/objc/GTMUnitTestDevLog.h b/iphone/test/objc/GTMUnitTestDevLog.h deleted file mode 100644 index f80743a4046c3..0000000000000 --- a/iphone/test/objc/GTMUnitTestDevLog.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// GTMUnitTestDevLog.h -// -// Copyright 2008 Google Inc. -// -// 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 "GTMDefines.h" -#import - -// GTMUnitTestDevLog tracks what messages are logged to verify that you only -// log what you expect to log during the running of unittests. This allows you -// to log with impunity from your actual core implementations and still be able -// to find unexpected logs in your output when running unittests. -// In your unittests you tell GTMUnitTestDevLog what messages you expect your -// test to spit out, and it will cause any that don't match to appear as errors -// in your unittest run output. You can match on exact strings or standard -// regexps. -// Set GTM_SHOW_UNITTEST_DEVLOGS in the environment to show the logs that that -// are expected and encountered. Otherwise they aren't display to keep the -// unit test results easier to read. - -@interface GTMUnitTestDevLog : NSObject -// Log a message -+ (void)log:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2); -+ (void)log:(NSString*)format args:(va_list)args NS_FORMAT_FUNCTION(1,0); - -// Turn tracking on/off -+ (void)enableTracking; -+ (void)disableTracking; -+ (BOOL)isTrackingEnabled; - -// Note that you are expecting a string that has an exact match. No need to -// escape any pattern characters. -+ (void)expectString:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); - -// Note that you are expecting a pattern. Pattern characters that you want -// exact matches on must be escaped. See [GTMRegex escapedPatternForString]. -// Patterns match across newlines (kGTMRegexOptionSupressNewlineSupport) making -// it easier to match output from the descriptions of NS collection types such -// as NSArray and NSDictionary. -+ (void)expectPattern:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); - -// Note that you are expecting exactly 'n' strings -+ (void)expect:(NSUInteger)n - casesOfString:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); - -// Note that you are expecting exactly 'n' patterns -+ (void)expect:(NSUInteger)n - casesOfPattern:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3); -+ (void)expect:(NSUInteger)n - casesOfPattern:(NSString*)format args:(va_list)args NS_FORMAT_FUNCTION(2,0); - -// Call when you want to verify that you have matched all the logs you expect -// to match. If your unittests inherit from GTMTestcase (like they should) you -// will get this called for free. -+ (void)verifyNoMoreLogsExpected; - -// Resets the expected logs so that you don't have anything expected. -// In general should not be needed, unless you have a variable logging case -// of some sort. -+ (void)resetExpectedLogs; -@end - -// Does the same as GTMUnitTestDevLog, but the logs are only expected in debug. -// ie-the expect requests don't count in release builds. -@interface GTMUnitTestDevLogDebug : GTMUnitTestDevLog -@end