Changeset 188817 in webkit
- Timestamp:
- Aug 21, 2015 7:32:41 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r188807 r188817 1 2015-08-21 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r188807, r188813, and r188815. 4 https://bugs.webkit.org/show_bug.cgi?id=148349 5 6 lots of 32-bit build problems, better to resolve separately 7 and try again (Requested by thorton on #webkit). 8 9 Reverted changesets: 10 11 "WebKitTestRunner should use WKWebView on OS X and iOS" 12 https://bugs.webkit.org/show_bug.cgi?id=143743 13 http://trac.webkit.org/changeset/188807 14 15 "Stop building WebKitTestRunner for 32-bit platforms" 16 https://bugs.webkit.org/show_bug.cgi?id=143743 17 http://trac.webkit.org/changeset/188813 18 19 "Stop building WebKitTestRunner for 32-bit platforms" 20 https://bugs.webkit.org/show_bug.cgi?id=143743 21 http://trac.webkit.org/changeset/188815 22 1 23 2015-08-21 Timothy Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h
r188807 r188817 181 181 macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \ 182 182 macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false) \ 183 macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \ 183 184 macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \ 184 185 macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \ -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r188807 r188817 3084 3084 } 3085 3085 3086 - (BOOL)_windowOcclusionDetectionEnabled3087 {3088 return [_wkView windowOcclusionDetectionEnabled];3089 }3090 3091 - (void)_setWindowOcclusionDetectionEnabled:(BOOL)flag3092 {3093 [_wkView setWindowOcclusionDetectionEnabled:flag];3094 }3095 3096 3086 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 3097 3087 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r188807 r188817 174 174 // Default value is 0. A value of 0 means the window's backing scale factor will be used and automatically update when the window moves screens. 175 175 @property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA); 176 177 @property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;178 179 176 #endif 180 177 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r188807 r188817 616 616 *returnDataRef = toAPI(returnData.release().leakRef()); 617 617 } 618 619 void WKBundlePageAddUserScript(WKBundlePageRef pageRef, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames)620 {621 toImpl(pageRef)->addUserScript(toWTFString(source), toUserContentInjectedFrames(injectedFrames), toUserScriptInjectionTime(injectionTime));622 }623 624 void WKBundlePageAddUserStyleSheet(WKBundlePageRef pageRef, WKStringRef source, WKUserContentInjectedFrames injectedFrames)625 {626 toImpl(pageRef)->addUserStyleSheet(toWTFString(source), toUserContentInjectedFrames(injectedFrames));627 }628 629 void WKBundlePageRemoveAllUserContent(WKBundlePageRef pageRef)630 {631 toImpl(pageRef)->removeAllUserContent();632 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
r188807 r188817 30 30 #include <WebKit/WKEvent.h> 31 31 #include <WebKit/WKGeometry.h> 32 #include <WebKit/WKUserContentInjectedFrames.h>33 #include <WebKit/WKUserScriptInjectionTime.h>34 32 35 33 #ifdef __cplusplus … … 96 94 WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken); 97 95 98 // UserContent API (compatible with Modern API, for WKTR)99 WK_EXPORT void WKBundlePageAddUserScript(WKBundlePageRef page, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames);100 WK_EXPORT void WKBundlePageAddUserStyleSheet(WKBundlePageRef page, WKStringRef source, WKUserContentInjectedFrames injectedFrames);101 WK_EXPORT void WKBundlePageRemoveAllUserContent(WKBundlePageRef page);102 103 96 #if TARGET_OS_IPHONE 104 97 WK_EXPORT void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef, bool); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r188807 r188817 5007 5007 } 5008 5008 5009 void WebPage::addUserScript(const String& source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)5010 {5011 ASSERT(m_userContentController);5012 5013 WebCore::UserScript userScript(source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectionTime, injectedFrames);5014 5015 m_userContentController->userContentController().addUserScript(mainThreadNormalWorld(), std::make_unique<WebCore::UserScript>(userScript));5016 }5017 5018 void WebPage::addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames injectedFrames)5019 {5020 ASSERT(m_userContentController);5021 5022 WebCore::UserStyleSheet userStyleSheet(source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel);5023 5024 m_userContentController->userContentController().addUserStyleSheet(mainThreadNormalWorld(), std::make_unique<WebCore::UserStyleSheet>(userStyleSheet), InjectInExistingDocuments);5025 }5026 5027 void WebPage::removeAllUserContent()5028 {5029 if (!m_userContentController)5030 return;5031 5032 m_userContentController->userContentController().removeAllUserContent();5033 }5034 5035 5009 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r188807 r188817 64 64 #include <WebCore/TextIndicator.h> 65 65 #include <WebCore/UserActivity.h> 66 #include <WebCore/UserContentTypes.h>67 #include <WebCore/UserScriptTypes.h>68 66 #include <WebCore/ViewState.h> 69 67 #include <WebCore/ViewportConfiguration.h> … … 917 915 #endif 918 916 919 void addUserScript(const String& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);920 void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);921 void removeAllUserContent();922 923 917 private: 924 918 WebPage(uint64_t pageID, const WebPageCreationParameters&); -
trunk/Tools/ChangeLog
r188815 r188817 1 2015-08-21 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r188807, r188813, and r188815. 4 https://bugs.webkit.org/show_bug.cgi?id=148349 5 6 lots of 32-bit build problems, better to resolve separately 7 and try again (Requested by thorton on #webkit). 8 9 Reverted changesets: 10 11 "WebKitTestRunner should use WKWebView on OS X and iOS" 12 https://bugs.webkit.org/show_bug.cgi?id=143743 13 http://trac.webkit.org/changeset/188807 14 15 "Stop building WebKitTestRunner for 32-bit platforms" 16 https://bugs.webkit.org/show_bug.cgi?id=143743 17 http://trac.webkit.org/changeset/188813 18 19 "Stop building WebKitTestRunner for 32-bit platforms" 20 https://bugs.webkit.org/show_bug.cgi?id=143743 21 http://trac.webkit.org/changeset/188815 22 1 23 2015-08-21 Tim Horton <timothy_horton@apple.com> 2 24 -
trunk/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
r188815 r188817 25 25 #include "Base.xcconfig" 26 26 27 VALID_ARCHS[sdk=macosx*] = $(ARCHS_STANDARD_64_BIT);27 ARCHS = $(ARCHS_STANDARD_32_64_BIT); 28 28 29 29 ONLY_ACTIVE_ARCH = YES; -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r188807 r188817 262 262 WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false); 263 263 264 WKBundle PageRemoveAllUserContent(page()->page());264 WKBundleRemoveAllUserContent(m_bundle, m_pageGroup); 265 265 266 266 m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r188807 r188817 173 173 { 174 174 WKRetainPtr<WKStringRef> sourceWK = toWK(source); 175 176 WKBundlePageAddUserScript(InjectedBundle::singleton().page()->page(), sourceWK.get(), 175 WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); 176 177 auto& injectedBundle = InjectedBundle::singleton(); 178 WKBundleAddUserScript(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, 177 179 (runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd), 178 180 (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); … … 182 184 { 183 185 WKRetainPtr<WKStringRef> sourceWK = toWK(source); 184 185 WKBundlePageAddUserStyleSheet(InjectedBundle::singleton().page()->page(), sourceWK.get(), 186 WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); 187 188 auto& injectedBundle = InjectedBundle::singleton(); 189 WKBundleAddUserStyleSheet(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, 186 190 (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); 187 191 } -
trunk/Tools/WebKitTestRunner/PlatformWebView.h
r188807 r188817 30 30 #include <WebKit/WKRetainPtr.h> 31 31 32 #if PLATFORM(COCOA) 33 OBJC_CLASS NSView; 34 OBJC_CLASS UIView; 35 OBJC_CLASS WKWebView; 36 OBJC_CLASS WKWebViewConfiguration; 37 OBJC_CLASS WebKitTestRunnerWindow; 38 39 typedef WKWebView* PlatformWKView; 32 #if defined(__APPLE__) && __APPLE__ 33 #ifdef __OBJC__ 34 @class WKView; 35 @class WebKitTestRunnerWindow; 36 #else 37 class WKView; 38 class WebKitTestRunnerWindow; 39 #endif 40 typedef WKView* PlatformWKView; 40 41 typedef WebKitTestRunnerWindow* PlatformWindow; 41 42 #elif defined(BUILDING_GTK__) … … 52 53 class PlatformWebView { 53 54 public: 54 #if PLATFORM(COCOA)55 PlatformWebView(WKWebViewConfiguration*, const ViewOptions&);56 #else57 55 PlatformWebView(WKPageConfigurationRef, const ViewOptions&); 58 #endif59 56 ~PlatformWebView(); 60 57 … … 64 61 void resizeTo(unsigned width, unsigned height); 65 62 void focus(); 63 64 // Window snapshot is always enabled by default on all other platform. 65 static bool windowSnapshotEnabled() { return true; } 66 66 67 67 WKRect windowFrame(); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r188807 r188817 198 198 } 199 199 200 WKPageRef TestController::createOtherPage(WKPageRef oldP age, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)200 WKPageRef TestController::createOtherPage(WKPageRef oldPpage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo) 201 201 { 202 202 PlatformWebView* parentView = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo)); 203 203 204 PlatformWebView* view = platformCreateOtherPage(parentView,configuration, parentView->options());204 PlatformWebView* view = new PlatformWebView(configuration, parentView->options()); 205 205 WKPageRef newPage = view->page(); 206 206 … … 311 311 } 312 312 313 313 314 void TestController::initialize(int argc, const char* argv[]) 314 315 { … … 372 373 WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "MediaKeys").get()); 373 374 } 374 m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration.get())).get(), configuration.get()); 375 375 376 m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get())); 376 377 m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get()); 377 378 … … 435 436 WKPageConfigurationSetContext(m_configuration.get(), m_context.get()); 436 437 WKPageConfigurationSetPageGroup(m_configuration.get(), m_pageGroup.get()); 437 WKPageConfigurationSetUserContentController(m_configuration.get(), adoptWK(WKUserContentControllerCreate()).get());438 438 439 439 // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now. … … 443 443 void TestController::createWebViewWithOptions(const ViewOptions& options) 444 444 { 445 platformCreateWebView(m_configuration.get(), options);445 m_mainWebView = std::make_unique<PlatformWebView>(m_configuration.get(), options); 446 446 WKPageUIClientV6 pageUIClient = { 447 447 { 6, m_mainWebView.get() }, … … 569 569 { 570 570 // Reset preferences 571 WKPreferencesRef preferences = platformPreferences();571 WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get()); 572 572 WKPreferencesResetTestRunnerOverrides(preferences); 573 573 WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(preferences, false); … … 623 623 624 624 WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing); 625 // FIXME: We should be testing the default.626 WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);627 625 628 626 WKCookieManagerDeleteAllCookies(WKContextGetCookieManager(m_context.get())); … … 636 634 637 635 m_beforeUnloadReturnValue = true; 638 639 // This setting differs between the antique and modern Mac WebKit2 API.640 // For now, maintain the antique behavior, because some tests depend on it!641 // FIXME: We should be testing the default.642 WKPageSetBackgroundExtendsBeyondPage(m_mainWebView->page(), false);643 636 644 637 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset")); … … 676 669 #endif 677 670 678 // In the case that a test using the chrome input field failed, be sure to clean up for the next test.671 // in the case that a test using the chrome input field failed, be sure to clean up for the next test 679 672 m_mainWebView->removeChromeInputField(); 680 673 m_mainWebView->focus(); … … 718 711 m_shouldLogHistoryClientCallbacks = false; 719 712 713 WKPageGroupRemoveAllUserContentFilters(WKPageGetPageGroup(m_mainWebView->page())); 714 720 715 setHidden(false); 721 722 platformResetStateToConsistentValues();723 716 724 717 // Reset main page back to about:blank … … 1601 1594 } 1602 1595 1603 #if !PLATFORM(COCOA)1604 void TestController::platformWillRunTest(const TestInvocation&)1605 {1606 }1607 1608 WKPreferencesRef TestController::platformPreferences()1609 {1610 WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageCopyPageConfiguration(m_mainWebView->page()));1611 return WKPageConfigurationGetPreferences(configuration.get());1612 }1613 1614 void TestController::platformCreateWebView(WKPageConfigurationRef configuration, const ViewOptions& options)1615 {1616 m_mainWebView = std::make_unique<PlatformWebView>(configuration, options);1617 }1618 1619 PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef configuration, const ViewOptions& options)1620 {1621 return new PlatformWebView(configuration, options);1622 }1623 1624 WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)1625 {1626 return context;1627 }1628 1629 void TestController::platformResetStateToConsistentValues()1630 {1631 1632 }1633 #endif1634 1635 1596 } // namespace WTR -
trunk/Tools/WebKitTestRunner/TestController.h
r188807 r188817 35 35 #include <wtf/Vector.h> 36 36 37 OBJC_CLASS WKWebViewConfiguration;38 39 37 namespace WTR { 40 38 … … 135 133 void platformInitialize(); 136 134 void platformDestroy(); 137 WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);138 135 void platformInitializeContext(); 139 void platformCreateWebView(WKPageConfigurationRef, const ViewOptions&);140 static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&);141 136 void platformResetPreferencesToConsistentValues(); 142 void platformResetStateToConsistentValues();143 137 void platformConfigureViewForTest(const TestInvocation&); 144 138 void platformWillRunTest(const TestInvocation&); 145 139 void platformRunUntil(bool& done, double timeout); 146 140 void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef); 147 WKPreferencesRef platformPreferences();148 141 void initializeInjectedBundlePath(); 149 142 void initializeTestPluginDirectory(); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r188807 r188817 269 269 270 270 if (m_dumpPixels && m_pixelResult) { 271 m_gotRepaint = false; 272 WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback); 273 TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout); 274 if (!m_gotRepaint) { 275 m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n"; 276 m_webProcessIsUnresponsive = true; 277 return; 271 if (PlatformWebView::windowSnapshotEnabled()) { 272 m_gotRepaint = false; 273 WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback); 274 TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout); 275 if (!m_gotRepaint) { 276 m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n"; 277 m_webProcessIsUnresponsive = true; 278 return; 279 } 278 280 } 279 281 dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get()); -
trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
r188807 r188817 41 41 29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */; }; 42 42 29A8FCE5145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */; }; 43 2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };44 2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };45 43 2E34C90018B68808000067BB /* WebKitTestRunnerInjectedBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */; }; 46 44 2E63ED8A1891AD7E002A7AFC /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */; }; … … 174 172 29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; }; 175 173 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerRangeMac.mm; sourceTree = "<group>"; }; 176 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestControllerCocoa.mm; path = cocoa/TestControllerCocoa.mm; sourceTree = "<group>"; };177 174 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityControllerIOS.mm; sourceTree = "<group>"; }; 178 175 2E63ED761891ACE9002A7AFC /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityNotificationHandler.h; sourceTree = "<group>"; }; … … 401 398 0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */, 402 399 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */, 403 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */,404 400 ); 405 401 name = cocoa; … … 791 787 2E63ED981891ADC7002A7AFC /* TestController.cpp in Sources */, 792 788 2E63ED921891ADAD002A7AFC /* TestControllerIOS.mm in Sources */, 793 2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */,794 789 0FEB90A81905C537000FDBF3 /* CrashReporterInfo.mm in Sources */, 795 790 2E63ED991891ADC7002A7AFC /* TestInvocation.cpp in Sources */, … … 811 806 E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */, 812 807 5670B8281386FCA5002EB355 /* EventSenderProxy.mm in Sources */, 813 2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */,814 808 26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp in Sources */, 815 809 BC793400118F7C84005EA8E2 /* main.mm in Sources */, -
trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp
r188807 r188817 62 62 63 63 void TestController::platformDestroy() 64 { 65 } 66 67 void TestController::platformWillRunTest(const TestInvocation&) 64 68 { 65 69 } -
trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp
r188807 r188817 50 50 51 51 void TestController::platformDestroy() 52 { 53 } 54 55 void TestController::platformWillRunTest(const TestInvocation&) 52 56 { 53 57 } -
trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
r188807 r188817 29 29 30 30 #import <WebKit/WKImageCG.h> 31 #import <WebKit/WKViewPrivate.h> 31 32 #import <WebKit/WKPreferencesPrivate.h> 32 #import <WebKit/WKWebViewConfiguration.h>33 #import <WebKit/WKWebViewPrivate.h>34 33 #import <wtf/RetainPtr.h> 35 36 @interface WKWebView (Details)37 - (WKPageRef)_pageForTesting;38 @end39 34 40 35 @interface WebKitTestRunnerWindow : UIWindow { … … 46 41 @end 47 42 43 @interface TestRunnerWKView : WKView { 44 BOOL _useTiledDrawing; 45 } 46 47 @property (nonatomic, assign) BOOL useTiledDrawing; 48 @end 49 50 @implementation TestRunnerWKView 51 52 @synthesize useTiledDrawing = _useTiledDrawing; 53 54 - (id)initWithFrame:(CGRect)frame configurationRef:(WKPageConfigurationRef)configuration useTiledDrawing:(BOOL)useTiledDrawing 55 { 56 if (!(self = [super initWithFrame:frame configurationRef:configuration])) 57 return nil; 58 59 _useTiledDrawing = useTiledDrawing; 60 return self; 61 } 62 63 - (BOOL)_shouldUseTiledDrawingArea 64 { 65 return _useTiledDrawing; 66 } 67 68 @end 69 48 70 @implementation WebKitTestRunnerWindow 49 71 @synthesize platformWebView = _platformWebView; … … 101 123 namespace WTR { 102 124 103 PlatformWebView::PlatformWebView(WK WebViewConfiguration*configuration, const ViewOptions& options)125 PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options) 104 126 : m_windowIsKey(true) 105 127 , m_options(options) 106 128 { 107 129 CGRect rect = CGRectMake(0, 0, TestController::viewWidth, TestController::viewHeight); 108 m_view = [[WKWebView alloc] initWithFrame:rect configuration:configuration]; 130 m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useTiledDrawing:m_options.useTiledDrawing]; 131 132 WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration); 133 134 WKPreferencesSetCompositingBordersVisible(WKPageGroupGetPreferences(pageGroupRef), YES); 135 WKPreferencesSetCompositingRepaintCountersVisible(WKPageGroupGetPreferences(pageGroupRef), YES); 109 136 110 137 CGRect windowRect = rect; … … 127 154 { 128 155 m_window.platformWebView = 0; 156 // [m_window close]; 129 157 [m_view release]; 130 158 [m_window release]; … … 133 161 WKPageRef PlatformWebView::page() 134 162 { 135 return [m_view _pageForTesting];163 return [m_view pageRef]; 136 164 } 137 165 138 166 void PlatformWebView::focus() 139 167 { 140 makeWebViewFirstResponder(); 168 // [m_window makeFirstResponder:m_view]; // FIXME: iOS equivalent? 141 169 setWindowIsKey(true); 142 170 } … … 157 185 { 158 186 [m_window setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)]; 159 [ platformView()setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];187 [m_view setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; 160 188 } 161 189 … … 188 216 void PlatformWebView::makeWebViewFirstResponder() 189 217 { 190 // FIXME: iOS equivalent? 191 // [m_window makeFirstResponder:m_view]; 218 // [m_window makeFirstResponder:m_view]; 192 219 } 193 220 … … 199 226 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() 200 227 { 201 // FIXME: Need an implementation of this, or we're depending on software paints! 202 return nullptr; 228 return 0; // FIXME for iOS? 203 229 } 204 230 205 231 bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const 206 232 { 233 if (m_options.useTiledDrawing != options.useTiledDrawing) 234 return false; 235 207 236 return true; 208 237 } -
trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
r188807 r188817 27 27 #import "TestController.h" 28 28 29 #import "CrashReporterInfo.h" 30 #import <Foundation/Foundation.h> 29 31 #import "PlatformWebView.h" 30 32 #import "TestInvocation.h" 31 #import <Foundation/Foundation.h>32 33 #import <WebKit/WKPreferencesRefPrivate.h> 33 #import <WebKit/WKProcessPoolPrivate.h>34 34 #import <WebKit/WKStringCF.h> 35 #import <WebKit/WKUserContentControllerPrivate.h>36 #import <WebKit/WKWebView.h>37 #import <WebKit/WKWebViewConfiguration.h>38 #import <WebKit/WKWebViewConfigurationPrivate.h>39 35 #import <wtf/MainThread.h> 40 36 … … 75 71 } 76 72 73 void TestController::platformWillRunTest(const TestInvocation& testInvocation) 74 { 75 setCrashReportApplicationSpecificInformationToURL(testInvocation.url()); 76 } 77 77 78 static bool shouldMakeViewportFlexible(const TestInvocation& test) 78 79 { … … 82 83 void TestController::platformResetPreferencesToConsistentValues() 83 84 { 84 WKPreferencesRef preferences = platformPreferences();85 WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get()); 85 86 // Note that WKPreferencesSetTextAutosizingEnabled has no effect on iOS. 86 87 WKPreferencesSetMinimumZoomFontSize(preferences, 0); … … 100 101 void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions&, const TestInvocation&) const 101 102 { 103 } 104 105 void TestController::platformRunUntil(bool& done, double timeout) 106 { 107 NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture]; 108 109 while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending) 110 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate]; 102 111 } 103 112 -
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
r188807 r188817 34 34 #import <WebKit/WKString.h> 35 35 #import <WebKit/WKPagePrivate.h> 36 #import <WebKit/WKWebView.h>37 36 #import <wtf/RetainPtr.h> 38 37 … … 270 269 // The right solution is just to use NSApplication's built-in event sending methods, 271 270 // instead of rolling our own algorithm for selecting an event target. 272 // FIXME: This is even worse now, because we need to hit the WKWebView's inner WKView 273 // when using the modern API, so the level of fakery and horror increases. 274 if (!targetView) { 275 targetView = m_testController->mainWebView()->platformView(); 276 for (NSView *wkWebViewChild in targetView.subviews) { 277 if ([wkWebViewChild isKindOfClass:[WKView class]]) { 278 targetView = wkWebViewChild; 279 break; 280 } 281 } 282 } 271 targetView = targetView ? targetView : m_testController->mainWebView()->platformView(); 283 272 ASSERT(targetView); 284 273 [NSApp _setCurrentEvent:event]; … … 413 402 { 414 403 NSView *view = m_testController->mainWebView()->platformView(); 415 NSPoint position = [view convertPoint:NSMakePoint(x, view.frame.size.height -y) toView:nil];404 NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil]; 416 405 m_position.x = position.x; 417 406 m_position.y = position.y; … … 420 409 modifierFlags:0 421 410 timestamp:absoluteTimeForEventTime(currentEventTime()) 422 windowNumber: view.window.windowNumber411 windowNumber:[[view window] windowNumber] 423 412 context:[NSGraphicsContext currentContext] 424 413 eventNumber:++eventNumber 425 414 clickCount:(m_leftMouseButtonDown ? m_clickCount : 0) 426 pressure:0]; 427 428 NSPoint windowLocation = event.locationInWindow; 429 NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:windowLocation]; 415 pressure:0.0]; 416 417 NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]; 430 418 if (targetView) { 431 419 [NSApp _setCurrentEvent:event]; 432 420 [targetView mouseMoved:event]; 433 421 [NSApp _setCurrentEvent:nil]; 434 } else 422 } else { 423 NSPoint windowLocation = [event locationInWindow]; 435 424 WTFLogAlways("mouseMoveTo failed to find a target view at %f,%f\n", windowLocation.x, windowLocation.y); 425 } 436 426 } 437 427 -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r188807 r188817 31 31 #import <WebKit/WKImageCG.h> 32 32 #import <WebKit/WKPreferencesPrivate.h> 33 #import <WebKit/WKWebViewConfiguration.h> 34 #import <WebKit/WKWebViewPrivate.h> 33 #import <WebKit/WKViewPrivate.h> 35 34 #import <wtf/RetainPtr.h> 36 37 @interface WKWebView (Details)38 - (WKPageRef)_pageForTesting;39 @end40 35 41 36 using namespace WTR; … … 52 47 @end 53 48 54 @interface TestRunnerWKWebView : WKWebView 55 @end 56 57 @implementation TestRunnerWKWebView 49 @interface TestRunnerWKView : WKView { 50 BOOL _useThreadedScrolling; 51 } 52 53 @property (nonatomic, assign) BOOL useThreadedScrolling; 54 @end 55 56 @implementation TestRunnerWKView 57 58 @synthesize useThreadedScrolling = _useThreadedScrolling; 59 60 - (id)initWithFrame:(NSRect)frame configurationRef:(WKPageConfigurationRef)configuration useThreadedScrolling:(BOOL)useThreadedScrolling 61 { 62 if (!(self = [super initWithFrame:frame configurationRef:configuration])) 63 return nil; 64 65 _useThreadedScrolling = useThreadedScrolling; 66 return self; 67 } 58 68 59 69 - (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag … … 111 121 namespace WTR { 112 122 113 PlatformWebView::PlatformWebView(WK WebViewConfiguration*configuration, const ViewOptions& options)123 PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options) 114 124 : m_windowIsKey(true) 115 125 , m_options(options) 116 126 { 127 WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration); 128 129 // The tiled drawing specific tests also depend on threaded scrolling. 130 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroupRef); 131 WKPreferencesSetThreadedScrollingEnabled(preferences, m_options.useThreadedScrolling); 132 117 133 // FIXME: Not sure this is the best place for this; maybe we should have API to set this so we can do it from TestController? 118 134 if (m_options.useRemoteLayerTree) 119 135 [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"WebKit2UseRemoteLayerTreeDrawingArea"]; 120 136 121 RetainPtr<WKWebViewConfiguration> copiedConfiguration = adoptNS([configuration copy]);122 WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);123 124 137 NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight); 125 m_view = [[TestRunnerWK WebView alloc] initWithFrame:rect configuration:copiedConfiguration.get()];126 [m_view _setWindowOcclusionDetectionEnabled:NO];138 m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useThreadedScrolling:options.useThreadedScrolling]; 139 [m_view setWindowOcclusionDetectionEnabled:NO]; 127 140 128 141 NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0]; … … 158 171 WKPageRef PlatformWebView::page() 159 172 { 160 return [m_view _pageForTesting];173 return [m_view pageRef]; 161 174 } 162 175 163 176 void PlatformWebView::focus() 164 177 { 165 [m_window makeFirstResponder: platformView()];178 [m_window makeFirstResponder:m_view]; 166 179 setWindowIsKey(true); 167 180 } … … 182 195 { 183 196 [m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES]; 184 [ platformView()setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];197 [m_view setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)]; 185 198 } 186 199 … … 193 206 void PlatformWebView::addChromeInputField() 194 207 { 195 NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];208 NSTextField* textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)]; 196 209 textField.tag = 1; 197 210 [[m_window contentView] addSubview:textField]; 198 211 [textField release]; 199 212 200 NSView *view = platformView(); 201 [textField setNextKeyView:view]; 202 [view setNextKeyView:textField]; 213 [textField setNextKeyView:m_view]; 214 [m_view setNextKeyView:textField]; 203 215 } 204 216 205 217 void PlatformWebView::removeChromeInputField() 206 218 { 207 NSView *textField = [[m_window contentView] viewWithTag:1];219 NSView* textField = [[m_window contentView] viewWithTag:1]; 208 220 if (textField) { 209 221 [textField removeFromSuperview]; … … 214 226 void PlatformWebView::makeWebViewFirstResponder() 215 227 { 216 [m_window makeFirstResponder: platformView()];228 [m_window makeFirstResponder:m_view]; 217 229 } 218 230 219 231 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() 220 232 { 221 [ platformView()display];233 [m_view display]; 222 234 CGWindowImageOption options = kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque; 223 235 -
trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm
r188807 r188817 27 27 #import "TestController.h" 28 28 29 #import "CrashReporterInfo.h" 29 30 #import "PlatformWebView.h" 30 31 #import "PoseAsClass.h" … … 33 34 #import <WebKit/WKContextPrivate.h> 34 35 #import <WebKit/WKPageGroup.h> 35 #import <WebKit/WKProcessPoolPrivate.h>36 36 #import <WebKit/WKStringCF.h> 37 37 #import <WebKit/WKURLCF.h> 38 #import <WebKit/WKUserContentControllerPrivate.h>39 #import <WebKit/WKWebView.h>40 #import <WebKit/WKWebViewConfiguration.h>41 #import <WebKit/WKWebViewConfigurationPrivate.h>42 38 #import <WebKit/_WKUserContentExtensionStore.h> 43 39 #import <WebKit/_WKUserContentExtensionStorePrivate.h> … … 78 74 } 79 75 76 void TestController::platformWillRunTest(const TestInvocation& testInvocation) 77 { 78 setCrashReportApplicationSpecificInformationToURL(testInvocation.url()); 79 } 80 80 81 static bool shouldUseThreadedScrolling(const TestInvocation& test) 81 82 { … … 85 86 void TestController::platformResetPreferencesToConsistentValues() 86 87 { 88 #if WK_API_ENABLED 89 __block bool doneRemoving = false; 90 [[_WKUserContentExtensionStore defaultStore] removeContentExtensionForIdentifier:@"TestContentExtensions" completionHandler:^(NSError *error) 91 { 92 doneRemoving = true; 93 }]; 94 platformRunUntil(doneRemoving, 0); 95 [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions]; 96 #endif 87 97 } 88 98 … … 112 122 { 113 123 if (!error) 114 [mainWebView()->platformView().configuration.userContentController _addUserContentFilter:filter];124 WKPageGroupAddUserContentFilter(WKPageGetPageGroup(TestController::singleton().mainWebView()->page()), (__bridge WKUserContentFilterRef)filter); 115 125 else 116 126 NSLog(@"%@", [error helpAnchor]); … … 119 129 platformRunUntil(doneCompiling, 0); 120 130 #endif 131 } 132 133 void TestController::platformRunUntil(bool& done, double timeout) 134 { 135 NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture]; 136 137 while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending) 138 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate]; 121 139 } 122 140
Note: See TracChangeset
for help on using the changeset viewer.