Skip to content

Commit ca37f6a

Browse files
committed
Add a test harness for running UI tests on the iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=161265 .: Add the new MobileMiniBrowser project to the WebKit workspace. Reviewed by Simon Fraser. * WebKit.xcworkspace/contents.xcworkspacedata: Tools: Reviewed by Simon Fraser. Add a new iOS Simulator application which uses WKWebView to implement a basic browser, and which can serve as a test harness for WebKit UI tests. Also add a basic media playback test which verifies that a <video> element will begin playing in fullscreen on an iPhone device, but will play inline on an iPad device. * Makefile: Add MobileMiniBrowser as a Module for iOS builds. * MobileMiniBrowser/Configurations/Base.xcconfig: Added. * MobileMiniBrowser/Configurations/DebugRelease.xcconfig: Added. * MobileMiniBrowser/Configurations/MobileMiniBrowser.xcconfig: Added. * MobileMiniBrowser/Makefile: Added. * MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj: Added. * MobileMiniBrowser/MobileMiniBrowser/AppDelegate.h: Added. * MobileMiniBrowser/MobileMiniBrowser/AppDelegate.m: Added. (-[AppDelegate application:didFinishLaunchingWithOptions:]): (-[AppDelegate applicationWillResignActive:]): (-[AppDelegate applicationDidEnterBackground:]): (-[AppDelegate applicationWillEnterForeground:]): (-[AppDelegate applicationDidBecomeActive:]): (-[AppDelegate applicationWillTerminate:]): * MobileMiniBrowser/MobileMiniBrowser/Assets.xcassets/AppIcon.appiconset/Contents.json: Added. * MobileMiniBrowser/MobileMiniBrowser/Base.lproj/LaunchScreen.storyboard: Added. * MobileMiniBrowser/MobileMiniBrowser/Base.lproj/Main.storyboard: Added. * MobileMiniBrowser/MobileMiniBrowser/Info.plist: Added. * MobileMiniBrowser/MobileMiniBrowser/TabViewController.h: Added. * MobileMiniBrowser/MobileMiniBrowser/TabViewController.m: Added. (-[TabViewController dealloc]): (-[TabViewController viewDidLoad]): (-[TabViewController observeValueForKeyPath:ofObject:change:context:]): (-[TabViewController tableView:cellForRowAtIndexPath:]): (-[TabViewController tableView:numberOfRowsInSection:]): (-[TabViewController numberOfSectionsInTableView:]): (-[TabViewController tableView:canEditRowAtIndexPath:]): (-[TabViewController tableView:canMoveRowAtIndexPath:]): (-[TabViewController tableView:commitEditingStyle:forRowAtIndexPath:]): (-[TabViewController tableView:didSelectRowAtIndexPath:]): * MobileMiniBrowser/MobileMiniBrowser/WebViewController.h: Added. * MobileMiniBrowser/MobileMiniBrowser/WebViewController.m: Added. (-[WebViewController viewDidLoad]): (-[WebViewController didReceiveMemoryWarning]): (-[WebViewController reload:]): (-[WebViewController goBack:]): (-[WebViewController goForward:]): (-[WebViewController urlFieldEditingBegan:]): (-[WebViewController navigateTo:]): (-[WebViewController showTabs:]): (-[WebViewController selectWebViewAtIndex:]): (-[WebViewController removeWebViewAtIndex:]): (-[WebViewController addWebView]): (-[WebViewController createWebView]): (-[WebViewController removeWebView:]): (-[WebViewController setCurrentWebView:]): (-[WebViewController webView:didFailNavigation:withError:]): (-[WebViewController observeValueForKeyPath:ofObject:change:context:]): * MobileMiniBrowser/MobileMiniBrowser/main.m: Added. (main): * MobileMiniBrowser/MobileMiniBrowserUITests/Info.plist: Added. * MobileMiniBrowser/MobileMiniBrowserUITests/MobileMiniBrowserUITests.m: Added. (-[MobileMiniBrowserUITests setUp]): (-[MobileMiniBrowserUITests tearDown]): (-[MobileMiniBrowserUITests testBasicVideoPlayback]): Canonical link: https://commits.webkit.org/179433@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent c68ffcb commit ca37f6a

22 files changed

Lines changed: 1715 additions & 1 deletion

File tree

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2016-08-26 Jer Noble <jer.noble@apple.com>
2+
3+
Add a test harness for running UI tests on the iOS Simulator
4+
https://bugs.webkit.org/show_bug.cgi?id=161265
5+
6+
Add the new MobileMiniBrowser project to the WebKit workspace.
7+
8+
Reviewed by Simon Fraser.
9+
10+
* WebKit.xcworkspace/contents.xcworkspacedata:
11+
112
2016-08-24 Alexey Proskuryakov <ap@apple.com>
213

314
Add svn:global-ignores to the root to ignore *.pyc files everythere in the repository.

Tools/ChangeLog

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
2016-08-26 Jer Noble <jer.noble@apple.com>
2+
3+
Add a test harness for running UI tests on the iOS Simulator
4+
https://bugs.webkit.org/show_bug.cgi?id=161265
5+
6+
Reviewed by Simon Fraser.
7+
8+
Add a new iOS Simulator application which uses WKWebView to implement a basic browser, and which
9+
can serve as a test harness for WebKit UI tests.
10+
11+
Also add a basic media playback test which verifies that a <video> element will begin playing in
12+
fullscreen on an iPhone device, but will play inline on an iPad device.
13+
14+
* Makefile: Add MobileMiniBrowser as a Module for iOS builds.
15+
* MobileMiniBrowser/Configurations/Base.xcconfig: Added.
16+
* MobileMiniBrowser/Configurations/DebugRelease.xcconfig: Added.
17+
* MobileMiniBrowser/Configurations/MobileMiniBrowser.xcconfig: Added.
18+
* MobileMiniBrowser/Makefile: Added.
19+
* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj: Added.
20+
* MobileMiniBrowser/MobileMiniBrowser/AppDelegate.h: Added.
21+
* MobileMiniBrowser/MobileMiniBrowser/AppDelegate.m: Added.
22+
(-[AppDelegate application:didFinishLaunchingWithOptions:]):
23+
(-[AppDelegate applicationWillResignActive:]):
24+
(-[AppDelegate applicationDidEnterBackground:]):
25+
(-[AppDelegate applicationWillEnterForeground:]):
26+
(-[AppDelegate applicationDidBecomeActive:]):
27+
(-[AppDelegate applicationWillTerminate:]):
28+
* MobileMiniBrowser/MobileMiniBrowser/Assets.xcassets/AppIcon.appiconset/Contents.json: Added.
29+
* MobileMiniBrowser/MobileMiniBrowser/Base.lproj/LaunchScreen.storyboard: Added.
30+
* MobileMiniBrowser/MobileMiniBrowser/Base.lproj/Main.storyboard: Added.
31+
* MobileMiniBrowser/MobileMiniBrowser/Info.plist: Added.
32+
* MobileMiniBrowser/MobileMiniBrowser/TabViewController.h: Added.
33+
* MobileMiniBrowser/MobileMiniBrowser/TabViewController.m: Added.
34+
(-[TabViewController dealloc]):
35+
(-[TabViewController viewDidLoad]):
36+
(-[TabViewController observeValueForKeyPath:ofObject:change:context:]):
37+
(-[TabViewController tableView:cellForRowAtIndexPath:]):
38+
(-[TabViewController tableView:numberOfRowsInSection:]):
39+
(-[TabViewController numberOfSectionsInTableView:]):
40+
(-[TabViewController tableView:canEditRowAtIndexPath:]):
41+
(-[TabViewController tableView:canMoveRowAtIndexPath:]):
42+
(-[TabViewController tableView:commitEditingStyle:forRowAtIndexPath:]):
43+
(-[TabViewController tableView:didSelectRowAtIndexPath:]):
44+
* MobileMiniBrowser/MobileMiniBrowser/WebViewController.h: Added.
45+
* MobileMiniBrowser/MobileMiniBrowser/WebViewController.m: Added.
46+
(-[WebViewController viewDidLoad]):
47+
(-[WebViewController didReceiveMemoryWarning]):
48+
(-[WebViewController reload:]):
49+
(-[WebViewController goBack:]):
50+
(-[WebViewController goForward:]):
51+
(-[WebViewController urlFieldEditingBegan:]):
52+
(-[WebViewController navigateTo:]):
53+
(-[WebViewController showTabs:]):
54+
(-[WebViewController selectWebViewAtIndex:]):
55+
(-[WebViewController removeWebViewAtIndex:]):
56+
(-[WebViewController addWebView]):
57+
(-[WebViewController createWebView]):
58+
(-[WebViewController removeWebView:]):
59+
(-[WebViewController setCurrentWebView:]):
60+
(-[WebViewController webView:didFailNavigation:withError:]):
61+
(-[WebViewController observeValueForKeyPath:ofObject:change:context:]):
62+
* MobileMiniBrowser/MobileMiniBrowser/main.m: Added.
63+
(main):
64+
* MobileMiniBrowser/MobileMiniBrowserUITests/Info.plist: Added.
65+
* MobileMiniBrowser/MobileMiniBrowserUITests/MobileMiniBrowserUITests.m: Added.
66+
(-[MobileMiniBrowserUITests setUp]):
67+
(-[MobileMiniBrowserUITests tearDown]):
68+
(-[MobileMiniBrowserUITests testBasicVideoPlayback]):
69+
170
2016-08-26 Aakash Jain <aakash_jain@apple.com>
271

372
webkit-queues queue-status page should should list more recent statuses

Tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ MODULES = DumpRenderTree WebKitTestRunner MiniBrowser ../Source/ThirdParty/gtest
22

33
ifneq (,$(SDKROOT))
44
ifeq (,$(findstring macosx,$(SDKROOT)))
5-
MODULES = DumpRenderTree WebKitTestRunner ../Source/ThirdParty/gtest/xcode TestWebKitAPI
5+
MODULES = DumpRenderTree WebKitTestRunner MobileMiniBrowser ../Source/ThirdParty/gtest/xcode TestWebKitAPI
66
endif
77
ifeq (,$(DO_NOT_BUILD_LAYOUT_TEST_RELAY))
88
MODULES += LayoutTestRelay
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright (C) 2016 Apple Inc. All rights reserved.
2+
//
3+
// Redistribution and use in source and binary forms, with or without
4+
// modification, are permitted provided that the following conditions
5+
// are met:
6+
// 1. Redistributions of source code must retain the above copyright
7+
// notice, this list of conditions and the following disclaimer.
8+
// 2. Redistributions in binary form must reproduce the above copyright
9+
// notice, this list of conditions and the following disclaimer in the
10+
// documentation and/or other materials provided with the distribution.
11+
//
12+
// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
13+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
16+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20+
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
24+
#include "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
25+
26+
SDKROOT = iphoneos;
27+
28+
TARGETED_DEVICE_FAMILY = 1,2;
29+
30+
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
31+
32+
GCC_C_LANGUAGE_STANDARD = gnu99;
33+
34+
GCC_PREPROCESSOR_DEFINITIONS = $(ENGINEERING_BUILD_DEFINES) $(inherited);
35+
36+
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
37+
38+
CLANG_WARN_BOOL_CONVERSION = YES;
39+
CLANG_WARN_CONSTANT_CONVERSION = YES;
40+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
41+
CLANG_WARN_EMPTY_BODY = YES;
42+
CLANG_WARN_ENUM_CONVERSION = YES;
43+
CLANG_WARN_INT_CONVERSION = YES;
44+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
45+
CLANG_ENABLE_OBJC_ARC = YES;
46+
47+
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
48+
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
49+
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
50+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
51+
GCC_WARN_UNDECLARED_SELECTOR = YES;
52+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
53+
GCC_WARN_UNUSED_FUNCTION = YES;
54+
GCC_WARN_UNUSED_VARIABLE = YES;
55+
56+
WARNING_CFLAGS = -Wall -Wundef -Wformat-security -Wimplicit-fallthrough -Wmissing-format-attribute -Wpointer-arith -Wexit-time-destructors -Wglobal-constructors -Woverriding-method-mismatch -Wmethod-signatures;
57+
58+
OTHER_CFLAGS = -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(inherited);
59+
60+
ALWAYS_SEARCH_USER_PATHS = NO;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (C) 2016 Apple Inc. All rights reserved.
2+
//
3+
// Redistribution and use in source and binary forms, with or without
4+
// modification, are permitted provided that the following conditions
5+
// are met:
6+
// 1. Redistributions of source code must retain the above copyright
7+
// notice, this list of conditions and the following disclaimer.
8+
// 2. Redistributions in binary form must reproduce the above copyright
9+
// notice, this list of conditions and the following disclaimer in the
10+
// documentation and/or other materials provided with the distribution.
11+
//
12+
// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
13+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
16+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20+
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
24+
#include "Base.xcconfig"
25+
26+
ARCHS = $(ARCHS_STANDARD_32_64_BIT);
27+
28+
ONLY_ACTIVE_ARCH = YES;
29+
30+
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
31+
32+
SDKROOT = $(SDKROOT_$(PLATFORM_NAME));
33+
SDKROOT_iphoneos = $(SDKROOT);
34+
SDKROOT_iphonesimulator = $(SDKROOT);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (C) 2016 Apple Inc. All rights reserved.
2+
//
3+
// Redistribution and use in source and binary forms, with or without
4+
// modification, are permitted provided that the following conditions
5+
// are met:
6+
// 1. Redistributions of source code must retain the above copyright
7+
// notice, this list of conditions and the following disclaimer.
8+
// 2. Redistributions in binary form must reproduce the above copyright
9+
// notice, this list of conditions and the following disclaimer in the
10+
// documentation and/or other materials provided with the distribution.
11+
//
12+
// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
13+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
16+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20+
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
24+
PRODUCT_NAME = MiniBrowser
25+
EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = *

Tools/MobileMiniBrowser/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
SCRIPTS_PATH = ../Scripts
3+
include ../../Makefile.shared
4+
5+
test-iphone: all
6+
( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) -scheme MobileMiniBrowserUITests -destination 'platform=iOS Simulator,name=iPhone 5s For WebKit Development' test | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
7+
8+
test-ipad: all
9+
( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) -scheme MobileMiniBrowserUITests -destination 'platform=iOS Simulator,name=iPad Retina' test | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
10+
11+
test: test-iphone test-ipad
12+

0 commit comments

Comments
 (0)