diff options
-rw-r--r-- | build/common.gypi | 24 | ||||
-rw-r--r-- | ios/ios.gyp | 3 | ||||
-rw-r--r-- | ios/third_party/earl_grey/earl_grey.gyp | 308 | ||||
-rw-r--r-- | ios/third_party/ochamcrest/ochamcrest.gyp | 143 | ||||
-rw-r--r-- | ios/web/DEPS | 1 | ||||
-rw-r--r-- | ios/web/ios_web_shell.gyp | 9 | ||||
-rw-r--r-- | ios/web/ios_web_shell_exported_symbols_list | 3 | ||||
-rw-r--r-- | ios/web/ios_web_shell_tests.gyp | 63 | ||||
-rw-r--r-- | ios/web/shell/test/web_shell_navigation_egtest.mm | 65 |
9 files changed, 527 insertions, 92 deletions
diff --git a/build/common.gypi b/build/common.gypi index aea53b9..7c4e60e 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -5071,6 +5071,7 @@ # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', @@ -5159,29 +5160,6 @@ }], ], }], - ['OS=="mac"', { - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden - }, - }], - ['OS=="ios"', { - 'configurations': { - 'Debug': { - 'xcode_settings': { - # XCTests inject a dynamic library into the application. If - # fvisibility is set to hidden, then some symbols needed by - # XCTests are not available. Disable this setting for - # Debug configuration. - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', - }, - }, - 'Release': { - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden - }, - }, - }, - }], ], 'target_conditions': [ ['_type!="static_library"', { diff --git a/ios/ios.gyp b/ios/ios.gyp index ba0c326..851dcaa 100644 --- a/ios/ios.gyp +++ b/ios/ios.gyp @@ -23,11 +23,10 @@ 'provider/ios_provider_chrome.gyp:*', 'provider/ios_provider_web.gyp:*', 'testing/ios_testing.gyp:*', - 'third_party/fishhook/fishhook.gyp:*', - 'third_party/ochamcrest/ochamcrest.gyp:*', 'web/ios_web.gyp:*', 'web/ios_web_inttests.gyp:*', 'web/ios_web_shell.gyp:*', + 'web/ios_web_shell_tests.gyp:*', 'web/ios_web_unittests.gyp:*', ], }, diff --git a/ios/third_party/earl_grey/earl_grey.gyp b/ios/third_party/earl_grey/earl_grey.gyp new file mode 100644 index 0000000..ba01c50 --- /dev/null +++ b/ios/third_party/earl_grey/earl_grey.gyp @@ -0,0 +1,308 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'EarlGrey', + 'type': 'shared_library', + 'mac_bundle': 1, + 'sources': [ + 'src/EarlGrey/Action/GREYAction.h', + 'src/EarlGrey/Action/GREYActionBlock.h', + 'src/EarlGrey/Action/GREYActionBlock.m', + 'src/EarlGrey/Action/GREYActions.h', + 'src/EarlGrey/Action/GREYActions.m', + 'src/EarlGrey/Action/GREYBaseAction.m', + 'src/EarlGrey/Action/GREYChangeStepperAction.h', + 'src/EarlGrey/Action/GREYChangeStepperAction.m', + 'src/EarlGrey/Action/GREYPathGestureUtils.h', + 'src/EarlGrey/Action/GREYPathGestureUtils.m', + 'src/EarlGrey/Action/GREYPickerAction.h', + 'src/EarlGrey/Action/GREYPickerAction.m', + 'src/EarlGrey/Action/GREYScrollAction.h', + 'src/EarlGrey/Action/GREYScrollAction.m', + 'src/EarlGrey/Action/GREYScrollActionError.m', + 'src/EarlGrey/Action/GREYScrollToContentEdgeAction.h', + 'src/EarlGrey/Action/GREYScrollToContentEdgeAction.m', + 'src/EarlGrey/Action/GREYSlideAction.h', + 'src/EarlGrey/Action/GREYSlideAction.m', + 'src/EarlGrey/Action/GREYSwipeAction.h', + 'src/EarlGrey/Action/GREYSwipeAction.m', + 'src/EarlGrey/Action/GREYTapAction.h', + 'src/EarlGrey/Action/GREYTapAction.m', + 'src/EarlGrey/Action/GREYTapper.h', + 'src/EarlGrey/Action/GREYTapper.m', + 'src/EarlGrey/Additions/__NSCFLocalDataTask_GREYAdditions.h', + 'src/EarlGrey/Additions/__NSCFLocalDataTask_GREYAdditions.m', + 'src/EarlGrey/Additions/_UIGestureRecognizerFailureMap_GREYAdditions.h', + 'src/EarlGrey/Additions/_UIGestureRecognizerFailureMap_GREYAdditions.m', + 'src/EarlGrey/Additions/_UIModalItemsPresentingViewController_GREYAdditions.h', + 'src/EarlGrey/Additions/_UIModalItemsPresentingViewController_GREYAdditions.m', + 'src/EarlGrey/Additions/CAAnimation+GREYAdditions.h', + 'src/EarlGrey/Additions/CAAnimation+GREYAdditions.m', + 'src/EarlGrey/Additions/CALayer+GREYAdditions.h', + 'src/EarlGrey/Additions/CALayer+GREYAdditions.m', + 'src/EarlGrey/Additions/CGGeometry+GREYAdditions.h', + 'src/EarlGrey/Additions/CGGeometry+GREYAdditions.m', + 'src/EarlGrey/Additions/NSError+GREYAdditions.h', + 'src/EarlGrey/Additions/NSError+GREYAdditions.m', + 'src/EarlGrey/Additions/NSObject+GREYAdditions.h', + 'src/EarlGrey/Additions/NSObject+GREYAdditions.m', + 'src/EarlGrey/Additions/NSRunLoop+GREYAdditions.h', + 'src/EarlGrey/Additions/NSRunLoop+GREYAdditions.m', + 'src/EarlGrey/Additions/NSString+GREYAdditions.h', + 'src/EarlGrey/Additions/NSString+GREYAdditions.m', + 'src/EarlGrey/Additions/NSTimer+GREYAdditions.h', + 'src/EarlGrey/Additions/NSTimer+GREYAdditions.m', + 'src/EarlGrey/Additions/NSURL+GREYAdditions.h', + 'src/EarlGrey/Additions/NSURL+GREYAdditions.m', + 'src/EarlGrey/Additions/NSURLConnection+GREYAdditions.h', + 'src/EarlGrey/Additions/NSURLConnection+GREYAdditions.m', + 'src/EarlGrey/Additions/UIAnimation+GREYAdditions.h', + 'src/EarlGrey/Additions/UIAnimation+GREYAdditions.m', + 'src/EarlGrey/Additions/UIApplication+GREYAdditions.h', + 'src/EarlGrey/Additions/UIApplication+GREYAdditions.m', + 'src/EarlGrey/Additions/UIScrollView+GREYAdditions.h', + 'src/EarlGrey/Additions/UIScrollView+GREYAdditions.m', + 'src/EarlGrey/Additions/UISwitch+GREYAdditions.h', + 'src/EarlGrey/Additions/UISwitch+GREYAdditions.m', + 'src/EarlGrey/Additions/UITouch+GREYAdditions.h', + 'src/EarlGrey/Additions/UITouch+GREYAdditions.m', + 'src/EarlGrey/Additions/UIView+GREYAdditions.h', + 'src/EarlGrey/Additions/UIView+GREYAdditions.m', + 'src/EarlGrey/Additions/UIViewController+GREYAdditions.h', + 'src/EarlGrey/Additions/UIViewController+GREYAdditions.m', + 'src/EarlGrey/Additions/UIWebView+GREYAdditions.h', + 'src/EarlGrey/Additions/UIWebView+GREYAdditions.m', + 'src/EarlGrey/Additions/UIWindow+GREYAdditions.h', + 'src/EarlGrey/Additions/UIWindow+GREYAdditions.m', + 'src/EarlGrey/Additions/XCTestCase+GREYAdditions.h', + 'src/EarlGrey/Additions/XCTestCase+GREYAdditions.m', + 'src/EarlGrey/AppSupport/GREYIdlingResource.h', + 'src/EarlGrey/Assertion/GREYAssertion.h', + 'src/EarlGrey/Assertion/GREYAssertionBlock.h', + 'src/EarlGrey/Assertion/GREYAssertionBlock.m', + 'src/EarlGrey/Assertion/GREYAssertionDefines.h', + 'src/EarlGrey/Assertion/GREYAssertions.h', + 'src/EarlGrey/Assertion/GREYAssertions.m', + 'src/EarlGrey/Common/GREYAnalytics.h', + 'src/EarlGrey/Common/GREYAnalytics.m', + 'src/EarlGrey/Common/GREYConfiguration.h', + 'src/EarlGrey/Common/GREYConfiguration.m', + 'src/EarlGrey/Common/GREYConstants.h', + 'src/EarlGrey/Common/GREYConstants.m', + 'src/EarlGrey/Common/GREYDefines.h', + 'src/EarlGrey/Common/GREYElementHierarchy.h', + 'src/EarlGrey/Common/GREYElementHierarchy.m', + 'src/EarlGrey/Common/GREYExposed.h', + 'src/EarlGrey/Common/GREYPrivate.h', + 'src/EarlGrey/Common/GREYScreenshotUtil.h', + 'src/EarlGrey/Common/GREYScreenshotUtil.m', + 'src/EarlGrey/Common/GREYSwizzler.h', + 'src/EarlGrey/Common/GREYSwizzler.m', + 'src/EarlGrey/Common/GREYVisibilityChecker.h', + 'src/EarlGrey/Common/GREYVisibilityChecker.m', + 'src/EarlGrey/Core/GREYElementFinder.h', + 'src/EarlGrey/Core/GREYElementFinder.m', + 'src/EarlGrey/Core/GREYElementInteraction.h', + 'src/EarlGrey/Core/GREYElementInteraction.m', + 'src/EarlGrey/Core/GREYInteractionDataSource.h', + 'src/EarlGrey/Core/GREYKeyboard.h', + 'src/EarlGrey/Core/GREYKeyboard.m', + 'src/EarlGrey/Delegate/GREYCAAnimationDelegate.h', + 'src/EarlGrey/Delegate/GREYCAAnimationDelegate.m', + 'src/EarlGrey/Delegate/GREYNSURLConnectionDelegate.h', + 'src/EarlGrey/Delegate/GREYNSURLConnectionDelegate.m', + 'src/EarlGrey/Delegate/GREYSurrogateDelegate.h', + 'src/EarlGrey/Delegate/GREYSurrogateDelegate.m', + 'src/EarlGrey/Delegate/GREYUIWebViewDelegate.h', + 'src/EarlGrey/Delegate/GREYUIWebViewDelegate.m', + 'src/EarlGrey/EarlGrey.h', + 'src/EarlGrey/EarlGrey.m', + 'src/EarlGrey/Event/GREYSingleSequenceTouchInjector.h', + 'src/EarlGrey/Event/GREYSingleSequenceTouchInjector.m', + 'src/EarlGrey/Event/GREYSyntheticEvents.h', + 'src/EarlGrey/Event/GREYSyntheticEvents.m', + 'src/EarlGrey/Exception/GREYDefaultFailureHandler.h', + 'src/EarlGrey/Exception/GREYDefaultFailureHandler.m', + 'src/EarlGrey/Exception/GREYFailureHandler.h', + 'src/EarlGrey/Exception/GREYFrameworkException.h', + 'src/EarlGrey/Exception/GREYFrameworkException.m', + 'src/EarlGrey/Matcher/GREYAllOf.h', + 'src/EarlGrey/Matcher/GREYAllOf.m', + 'src/EarlGrey/Matcher/GREYAnyOf.h', + 'src/EarlGrey/Matcher/GREYAnyOf.m', + 'src/EarlGrey/Matcher/GREYBaseMatcher.h', + 'src/EarlGrey/Matcher/GREYBaseMatcher.m', + 'src/EarlGrey/Matcher/GREYDescription.h', + 'src/EarlGrey/Matcher/GREYElementMatcherBlock.h', + 'src/EarlGrey/Matcher/GREYElementMatcherBlock.m', + 'src/EarlGrey/Matcher/GREYHCMatcher.h', + 'src/EarlGrey/Matcher/GREYHCMatcher.m', + 'src/EarlGrey/Matcher/GREYLayoutConstraint.h', + 'src/EarlGrey/Matcher/GREYLayoutConstraint.m', + 'src/EarlGrey/Matcher/GREYMatcher.h', + 'src/EarlGrey/Matcher/GREYMatchers.h', + 'src/EarlGrey/Matcher/GREYMatchers.m', + 'src/EarlGrey/Matcher/GREYNot.h', + 'src/EarlGrey/Matcher/GREYNot.m', + 'src/EarlGrey/Matcher/GREYStringDescription.h', + 'src/EarlGrey/Matcher/GREYStringDescription.m', + 'src/EarlGrey/Provider/GREYDataEnumerator.h', + 'src/EarlGrey/Provider/GREYDataEnumerator.m', + 'src/EarlGrey/Provider/GREYElementProvider.h', + 'src/EarlGrey/Provider/GREYElementProvider.m', + 'src/EarlGrey/Provider/GREYProvider.h', + 'src/EarlGrey/Provider/GREYUIWindowProvider.h', + 'src/EarlGrey/Provider/GREYUIWindowProvider.m', + 'src/EarlGrey/Synchronization/GREYAppStateTracker.h', + 'src/EarlGrey/Synchronization/GREYAppStateTracker.m', + 'src/EarlGrey/Synchronization/GREYBeaconImageProtocol.h', + 'src/EarlGrey/Synchronization/GREYBeaconImageProtocol.m', + 'src/EarlGrey/Synchronization/GREYCondition.h', + 'src/EarlGrey/Synchronization/GREYCondition.m', + 'src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.m', + 'src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.m', + 'src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.m', + 'src/EarlGrey/Synchronization/GREYSyncAPI.h', + 'src/EarlGrey/Synchronization/GREYSyncAPI.m', + 'src/EarlGrey/Synchronization/GREYTimedIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYTimedIdlingResource.m', + 'src/EarlGrey/Synchronization/GREYUIThreadExecutor.h', + 'src/EarlGrey/Synchronization/GREYUIThreadExecutor.m', + 'src/EarlGrey/Synchronization/GREYUIWebViewIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYUIWebViewIdlingResource.m', + ], + 'mac_framework_headers': [ + 'src/EarlGrey/EarlGrey.h', + 'src/EarlGrey/Action/GREYAction.h', + 'src/EarlGrey/Action/GREYActionBlock.h', + 'src/EarlGrey/Action/GREYActions.h', + 'src/EarlGrey/Action/GREYBaseAction.h', + 'src/EarlGrey/Action/GREYScrollActionError.h', + 'src/EarlGrey/AppSupport/GREYIdlingResource.h', + 'src/EarlGrey/Assertion/GREYAssertion.h', + 'src/EarlGrey/Assertion/GREYAssertionBlock.h', + 'src/EarlGrey/Assertion/GREYAssertionDefines.h', + 'src/EarlGrey/Assertion/GREYAssertions.h', + 'src/EarlGrey/Common/GREYConfiguration.h', + 'src/EarlGrey/Common/GREYConstants.h', + 'src/EarlGrey/Common/GREYDefines.h', + 'src/EarlGrey/Common/GREYElementHierarchy.h', + 'src/EarlGrey/Common/GREYScreenshotUtil.h', + 'src/EarlGrey/Core/GREYElementFinder.h', + 'src/EarlGrey/Core/GREYElementInteraction.h', + 'src/EarlGrey/Core/GREYInteraction.h', + 'src/EarlGrey/Exception/GREYFailureHandler.h', + 'src/EarlGrey/Exception/GREYFrameworkException.h', + 'src/EarlGrey/Matcher/GREYAllOf.h', + 'src/EarlGrey/Matcher/GREYAnyOf.h', + 'src/EarlGrey/Matcher/GREYBaseMatcher.h', + 'src/EarlGrey/Matcher/GREYDescription.h', + 'src/EarlGrey/Matcher/GREYElementMatcherBlock.h', + 'src/EarlGrey/Matcher/GREYLayoutConstraint.h', + 'src/EarlGrey/Matcher/GREYMatcher.h', + 'src/EarlGrey/Matcher/GREYMatchers.h', + 'src/EarlGrey/Matcher/GREYNot.h', + 'src/EarlGrey/Provider/GREYDataEnumerator.h', + 'src/EarlGrey/Provider/GREYProvider.h', + 'src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.h', + 'src/EarlGrey/Synchronization/GREYSyncAPI.h', + 'src/EarlGrey/Synchronization/GREYCondition.h', + 'src/EarlGrey/Synchronization/GREYUIThreadExecutor.h', + ], + 'mac_framework_private_headers': [ + 'src/EarlGrey/Action/GREYPathGestureUtils.h', + 'src/EarlGrey/Action/GREYScrollAction.h', + 'src/EarlGrey/Action/GREYSwipeAction.h', + 'src/EarlGrey/Action/GREYTapAction.h', + 'src/EarlGrey/Additions/__NSCFLocalDataTask_GREYAdditions.h', + 'src/EarlGrey/Additions/_UIGestureRecognizerFailureMap_GREYAdditions.h', + 'src/EarlGrey/Additions/_UIModalItemsPresentingViewController_GREYAdditions.h', + 'src/EarlGrey/Additions/CAAnimation+GREYAdditions.h', + 'src/EarlGrey/Additions/CALayer+GREYAdditions.h', + 'src/EarlGrey/Additions/CGGeometry+GREYAdditions.h', + 'src/EarlGrey/Additions/NSError+GREYAdditions.h', + 'src/EarlGrey/Additions/NSRunLoop+GREYAdditions.h', + 'src/EarlGrey/Additions/NSString+GREYAdditions.h', + 'src/EarlGrey/Additions/NSTimer+GREYAdditions.h', + 'src/EarlGrey/Additions/NSURL+GREYAdditions.h', + 'src/EarlGrey/Additions/NSURLConnection+GREYAdditions.h', + 'src/EarlGrey/Additions/UIAnimation+GREYAdditions.h', + 'src/EarlGrey/Additions/UIApplication+GREYAdditions.h', + 'src/EarlGrey/Additions/UIScrollView+GREYAdditions.h', + 'src/EarlGrey/Additions/UISwitch+GREYAdditions.h', + 'src/EarlGrey/Additions/UITouch+GREYAdditions.h', + 'src/EarlGrey/Additions/UIView+GREYAdditions.h', + 'src/EarlGrey/Additions/UIViewController+GREYAdditions.h', + 'src/EarlGrey/Additions/UIWebView+GREYAdditions.h', + 'src/EarlGrey/Additions/UIWindow+GREYAdditions.h', + 'src/EarlGrey/Additions/XCTestCase+GREYAdditions.h', + 'src/EarlGrey/Common/GREYExposed.h', + 'src/EarlGrey/Common/GREYPrivate.h', + 'src/EarlGrey/Common/GREYSwizzler.h', + 'src/EarlGrey/Common/GREYVisibilityChecker.h', + 'src/EarlGrey/Delegate/GREYCAAnimationDelegate.h', + 'src/EarlGrey/Delegate/GREYNSURLConnectionDelegate.h', + 'src/EarlGrey/Delegate/GREYSurrogateDelegate.h', + 'src/EarlGrey/Delegate/GREYUIWebViewDelegate.h', + 'src/EarlGrey/Event/GREYSingleSequenceTouchInjector.h', + 'src/EarlGrey/Event/GREYSyntheticEvents.h', + 'src/EarlGrey/Provider/GREYElementProvider.h', + 'src/EarlGrey/Provider/GREYUIWindowProvider.h', + 'src/EarlGrey/Synchronization/GREYAppStateTracker.h', + 'src/EarlGrey/Synchronization/GREYTimedIdlingResource.h', + ], + 'dependencies': [ + '../../../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac', + '../fishhook/fishhook.gyp:fishhook', + '../ochamcrest/ochamcrest.gyp:OCHamcrest', + ], + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + 'USE_HEADERMAP': 'YES', + 'CLANG_ENABLE_OBJC_ARC': 'YES', + }, + 'link_settings': { + 'libraries': [ + 'CoreGraphics.framework', + 'Foundation.framework', + 'IOKit.framework', + 'QuartzCore.framework', + 'UIKit.framework', + 'XCTest.framework', + ], + }, + 'include_dirs': [ + 'src', + 'src/EarlGrey', + ], + 'export_dependent_settings': [ + '../ochamcrest/ochamcrest.gyp:OCHamcrest', + ], + 'mac_framework_dirs': [ + '$(SDKROOT)/../../Library/Frameworks', + '<(PRODUCT_DIR)' + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'src/EarlGrey', + ], + 'mac_framework_dirs': [ + # EarlGrey and its dependencies need to link to XCTest.framework + # which is not under SDKROOT. + '$(SDKROOT)/../../Library/Frameworks', + '<(PRODUCT_DIR)' + ], + }, + }, + ], +} + diff --git a/ios/third_party/ochamcrest/ochamcrest.gyp b/ios/third_party/ochamcrest/ochamcrest.gyp index 95d5a6c..5fcfa7a 100644 --- a/ios/third_party/ochamcrest/ochamcrest.gyp +++ b/ios/third_party/ochamcrest/ochamcrest.gyp @@ -4,9 +4,12 @@ { 'chromium_sources': 0, - 'variables': { - 'ochamcrest_copy_dir': '<(SHARED_INTERMEDIATE_DIR)/ios/third_party/ochamcrest', - 'ochamcrest_sources': [ + 'targets': [ + { + 'target_name': 'OCHamcrest', + 'type': 'shared_library', + 'mac_bundle': 1, + 'sources': [ 'src/Source/Core/HCAssertThat.h', 'src/Source/Core/HCAssertThat.m', 'src/Source/Core/HCBaseDescription.h', @@ -159,75 +162,83 @@ 'src/Source/Library/Text/HCSubstringMatcher.h', 'src/Source/Library/Text/HCSubstringMatcher.m', 'src/Source/OCHamcrest.h', - ], - }, - 'targets': [ - # OCHamcrest sources contains import rules using relative file names - # ("HCAssertThat.h") and other using paths in an installed framework - # (<OCHamcrest/HCMatcher.h>). In order to build, copy all the sources - # to <(SHARED_INTERMEDIATE_DIR)/ios/third_party/ochmacrest/OCHamcrest - # so that both type of import work (another option considered was to - # build forwarding headers but this required duplicating the list of - # files in GN build and was ruled out). - # - # To avoid ODR violation, direct import of ios/third_party/ochamcrest - # is forbidden in ios/DEPS and code should instead use import as if - # OCHamcrest was in a framework (i.e. #import <OCHamcrest/OCHamcrest.h>). - { - 'target_name': 'ochamcrest_copy_sources', - 'hard_dependency': 1, - 'type': 'none', - 'actions': [ - { - 'action_name': 'copy_ochamcrest_sources', - 'inputs': [ - '../../chrome/tools/build/ios_copy_files.py', - '<@(ochamcrest_sources)', - ], - 'outputs': [ - '<!@pymod_do_main(ios_copy_files -o ' - '--dest-dir <(ochamcrest_copy_dir)/OCHamcrest ' - '<(ochamcrest_sources))', - ], - 'action': [ - 'python', - '../../chrome/tools/build/ios_copy_files.py', - '--dest-dir', - '<(ochamcrest_copy_dir)/OCHamcrest/', - '<@(ochamcrest_sources)', - ], - 'message': 'Copying OCHamcrest sources files', - }, ], - }, - { - 'target_name': 'ochamcrest', - 'type': 'static_library', - 'sources': [ - '<!@pymod_do_main(ios_copy_files -o ' - '--dest-dir <(ochamcrest_copy_dir)/OCHamcrest ' - '<(ochamcrest_sources))', - ], - 'include_dirs': [ - '<(ochamcrest_copy_dir)', + 'mac_framework_headers': [ + 'src/Source/Core/HCAssertThat.h', + 'src/Source/Core/HCBaseDescription.h', + 'src/Source/Core/HCBaseMatcher.h', + 'src/Source/Core/HCDescription.h', + 'src/Source/Core/HCDiagnosingMatcher.h', + 'src/Source/Core/HCMatcher.h', + 'src/Source/Core/HCSelfDescribing.h', + 'src/Source/Core/HCStringDescription.h', + 'src/Source/Core/Helpers/HCCollect.h', + 'src/Source/Core/Helpers/HCInvocationMatcher.h', + 'src/Source/Core/Helpers/HCRequireNonNilObject.h', + 'src/Source/Core/Helpers/HCWrapInMatcher.h', + 'src/Source/Core/Helpers/TestFailureReporters/HCTestFailure.h', + 'src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporter.h', + 'src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporterChain.h', + 'src/Source/Library/Collection/HCEvery.h', + 'src/Source/Library/Collection/HCHasCount.h', + 'src/Source/Library/Collection/HCIsCollectionContaining.h', + 'src/Source/Library/Collection/HCIsCollectionContainingInAnyOrder.h', + 'src/Source/Library/Collection/HCIsCollectionContainingInOrder.h', + 'src/Source/Library/Collection/HCIsCollectionContainingInRelativeOrder.h', + 'src/Source/Library/Collection/HCIsCollectionOnlyContaining.h', + 'src/Source/Library/Collection/HCIsDictionaryContaining.h', + 'src/Source/Library/Collection/HCIsDictionaryContainingEntries.h', + 'src/Source/Library/Collection/HCIsDictionaryContainingKey.h', + 'src/Source/Library/Collection/HCIsDictionaryContainingValue.h', + 'src/Source/Library/Collection/HCIsEmptyCollection.h', + 'src/Source/Library/Collection/HCIsIn.h', + 'src/Source/Library/Decorator/HCDescribedAs.h', + 'src/Source/Library/Decorator/HCIs.h', + 'src/Source/Library/Logical/HCAllOf.h', + 'src/Source/Library/Logical/HCAnyOf.h', + 'src/Source/Library/Logical/HCIsAnything.h', + 'src/Source/Library/Logical/HCIsNot.h', + 'src/Source/Library/Number/HCIsCloseTo.h', + 'src/Source/Library/Number/HCIsEqualToNumber.h', + 'src/Source/Library/Number/HCIsTrueFalse.h', + 'src/Source/Library/Number/HCNumberAssert.h', + 'src/Source/Library/Number/HCOrderingComparison.h', + 'src/Source/Library/Object/HCArgumentCaptor.h', + 'src/Source/Library/Object/HCClassMatcher.h', + 'src/Source/Library/Object/HCConformsToProtocol.h', + 'src/Source/Library/Object/HCHasDescription.h', + 'src/Source/Library/Object/HCHasProperty.h', + 'src/Source/Library/Object/HCIsEqual.h', + 'src/Source/Library/Object/HCIsInstanceOf.h', + 'src/Source/Library/Object/HCIsNil.h', + 'src/Source/Library/Object/HCIsSame.h', + 'src/Source/Library/Object/HCIsTypeOf.h', + 'src/Source/Library/Object/HCThrowsException.h', + 'src/Source/Library/Text/HCIsEqualIgnoringCase.h', + 'src/Source/Library/Text/HCIsEqualIgnoringWhiteSpace.h', + 'src/Source/Library/Text/HCStringContains.h', + 'src/Source/Library/Text/HCStringContainsInOrder.h', + 'src/Source/Library/Text/HCStringEndsWith.h', + 'src/Source/Library/Text/HCStringStartsWith.h', + 'src/Source/Library/Text/HCSubstringMatcher.h', + 'src/Source/OCHamcrest.h', ], 'xcode_settings': { - 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + 'USE_HEADERMAP': 'YES', + 'CLANG_ENABLE_ARC': 'YES', }, - 'link_settings': { - 'libraries': [ - 'XCTest.framework', - ], - }, - 'dependencies': [ - 'ochamcrest_copy_sources', + 'include_dirs': [ + 'src', + 'src/Source', ], - 'export_dependent_settings': [ - 'ochamcrest_copy_sources', + 'mac_framework_dirs': [ + '$(SDKROOT)/../../Library/Frameworks', ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(ochamcrest_copy_dir)', + 'link_settings': { + 'libraries': [ + 'Foundation.framework', + 'UIKit.framework', ], }, }, diff --git a/ios/web/DEPS b/ios/web/DEPS index 8ed91b4..1cc62e5 100644 --- a/ios/web/DEPS +++ b/ios/web/DEPS @@ -11,4 +11,5 @@ include_rules = [ # For tests. "+ios/testing", + "+ios/third_party/earl_grey/src", ] diff --git a/ios/web/ios_web_shell.gyp b/ios/web/ios_web_shell.gyp index 9659780..e4a5c64 100644 --- a/ios/web/ios_web_shell.gyp +++ b/ios/web/ios_web_shell.gyp @@ -20,8 +20,12 @@ ], 'xcode_settings': { 'INFOPLIST_FILE': 'shell/Info.plist', + 'STRIPFLAGS': '-S', 'OTHER_LDFLAGS': [ - '-Xlinker -objc_abi_version -Xlinker 2' + '-Xlinker -objc_abi_version', + '-Xlinker 2', + '-exported_symbols_list', + '../../ios/web/ios_web_shell_exported_symbols_list' ] }, 'sources': [ @@ -68,6 +72,9 @@ 'shell/view_controller.h', 'shell/view_controller.mm', ], + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + }, 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', diff --git a/ios/web/ios_web_shell_exported_symbols_list b/ios/web/ios_web_shell_exported_symbols_list new file mode 100644 index 0000000..ab67bf78 --- /dev/null +++ b/ios/web/ios_web_shell_exported_symbols_list @@ -0,0 +1,3 @@ +_kWebShellAddressFieldAccessibilityLabel +_kWebShellBackButtonAccessibilityLabel +_kWebShellForwardButtonAccessibilityLabel diff --git a/ios/web/ios_web_shell_tests.gyp b/ios/web/ios_web_shell_tests.gyp new file mode 100644 index 0000000..87cd0d8 --- /dev/null +++ b/ios/web/ios_web_shell_tests.gyp @@ -0,0 +1,63 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'conditions': [ + # The iOS frameworks being built for ios_web_shell_test require certs which + # bot do not currently have installed. Ninja allows this, Xcode does not. + ['"<(GENERATOR)"=="ninja"', { + 'targets': [ + { + 'variables': { + 'test_host': 'ios_web_shell.app/ios_web_shell', + }, + 'target_name': 'ios_web_shell_test', + 'type': 'loadable_module', + 'mac_xctest_bundle': 1, + 'dependencies': [ + '../third_party/earl_grey/earl_grey.gyp:EarlGrey', + 'ios_web_shell.gyp:ios_web_shell', + ], + 'sources': [ + 'shell/test/web_shell_navigation_egtest.mm', + ], + 'xcode_settings': { + 'WRAPPER_EXTENSION': 'xctest', + 'TEST_HOST': '<(test_host)', + 'BUNDLE_LOADER': '$(TEST_HOST)', + 'conditions':[ + ['"<(GENERATOR)"!="xcode" or "<(GENERATOR_FLAVOR)"=="ninja"', { + 'OTHER_LDFLAGS': [ + '-bundle_loader <@(test_host)', + ], + }], + ], + }, + 'link_settings': { + 'libraries': [ + 'CoreGraphics.framework', + 'Foundation.framework', + 'QuartzCore.framework', + 'UIKit.framework', + 'XCTest.framework', + ], + }, + }, + ], + }, { # GENERATOR != ninja + 'targets': [ + { + # The iOS frameworks being built for ios_web_shell_test require certs + # which bot do not currently have installed. Ninja allows this, Xcode + # does not. + 'target_name': 'ios_web_shell_test', + 'type': 'none', + }, + ], + }], + ], +} diff --git a/ios/web/shell/test/web_shell_navigation_egtest.mm b/ios/web/shell/test/web_shell_navigation_egtest.mm new file mode 100644 index 0000000..38936ae --- /dev/null +++ b/ios/web/shell/test/web_shell_navigation_egtest.mm @@ -0,0 +1,65 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <UIKit/UIKit.h> +#import <XCTest/XCTest.h> + +#import <EarlGrey/EarlGrey.h> + +#import "ios/web/shell/view_controller.h" + +@interface CRWWebShellNavigationTest : XCTestCase + +@end + +@implementation CRWWebShellNavigationTest + +// Sample test to load a live URL, go back and then forward. +- (void)testExternalURLBackAndForward { + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellAddressFieldAccessibilityLabel)] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Clear text")] + performAction:grey_tap()]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellAddressFieldAccessibilityLabel)] + performAction:grey_typeText(@"http://browsingtest.appspot.com\n")]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellBackButtonAccessibilityLabel)] + performAction:grey_tap()]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellForwardButtonAccessibilityLabel)] + performAction:grey_tap()]; +} + +// Sample test to load a live URL, go back, forward, and then back again. +- (void)testExternalURLBackAndForwardAndBack { + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellAddressFieldAccessibilityLabel)] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Clear text")] + performAction:grey_tap()]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellAddressFieldAccessibilityLabel)] + performAction:grey_typeText(@"http://browsingtest.appspot.com\n")]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellBackButtonAccessibilityLabel)] + performAction:grey_tap()]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellForwardButtonAccessibilityLabel)] + performAction:grey_tap()]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityLabel( + kWebShellBackButtonAccessibilityLabel)] + performAction:grey_tap()]; +} +@end |