Changeset 188817 in webkit


Ignore:
Timestamp:
Aug 21, 2015 7:32:41 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r188807, r188813, and r188815.
https://bugs.webkit.org/show_bug.cgi?id=148349

lots of 32-bit build problems, better to resolve separately
and try again (Requested by thorton on #webkit).

Reverted changesets:

"WebKitTestRunner should use WKWebView on OS X and iOS"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188807

"Stop building WebKitTestRunner for 32-bit platforms"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188813

"Stop building WebKitTestRunner for 32-bit platforms"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188815

Location:
trunk
Files:
1 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r188807 r188817  
     12015-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
    1232015-08-21  Timothy Horton  <timothy_horton@apple.com>
    224
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r188807 r188817  
    181181    macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
    182182    macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false) \
     183    macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \
    183184    macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
    184185    macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r188807 r188817  
    30843084}
    30853085
    3086 - (BOOL)_windowOcclusionDetectionEnabled
    3087 {
    3088     return [_wkView windowOcclusionDetectionEnabled];
    3089 }
    3090 
    3091 - (void)_setWindowOcclusionDetectionEnabled:(BOOL)flag
    3092 {
    3093     [_wkView setWindowOcclusionDetectionEnabled:flag];
    3094 }
    3095 
    30963086#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
    30973087
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r188807 r188817  
    174174// 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.
    175175@property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
    176 
    177 @property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;
    178 
    179176#endif
    180177
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r188807 r188817  
    616616        *returnDataRef = toAPI(returnData.release().leakRef());
    617617}
    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  
    3030#include <WebKit/WKEvent.h>
    3131#include <WebKit/WKGeometry.h>
    32 #include <WebKit/WKUserContentInjectedFrames.h>
    33 #include <WebKit/WKUserScriptInjectionTime.h>
    3432
    3533#ifdef __cplusplus
     
    9694WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken);
    9795
    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 
    10396#if TARGET_OS_IPHONE
    10497WK_EXPORT void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef, bool);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r188807 r188817  
    50075007}
    50085008
    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 
    50355009} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r188807 r188817  
    6464#include <WebCore/TextIndicator.h>
    6565#include <WebCore/UserActivity.h>
    66 #include <WebCore/UserContentTypes.h>
    67 #include <WebCore/UserScriptTypes.h>
    6866#include <WebCore/ViewState.h>
    6967#include <WebCore/ViewportConfiguration.h>
     
    917915#endif
    918916
    919     void addUserScript(const String& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
    920     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
    921     void removeAllUserContent();
    922 
    923917private:
    924918    WebPage(uint64_t pageID, const WebPageCreationParameters&);
  • trunk/Tools/ChangeLog

    r188815 r188817  
     12015-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
    1232015-08-21  Tim Horton  <timothy_horton@apple.com>
    224
  • trunk/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig

    r188815 r188817  
    2525#include "Base.xcconfig"
    2626
    27 VALID_ARCHS[sdk=macosx*] = $(ARCHS_STANDARD_64_BIT);
     27ARCHS = $(ARCHS_STANDARD_32_64_BIT);
    2828
    2929ONLY_ACTIVE_ARCH = YES;
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r188807 r188817  
    262262    WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
    263263
    264     WKBundlePageRemoveAllUserContent(page()->page());
     264    WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
    265265
    266266    m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates"));
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r188807 r188817  
    173173{
    174174    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,
    177179        (runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd),
    178180        (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
     
    182184{
    183185    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,
    186190        (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
    187191}
  • trunk/Tools/WebKitTestRunner/PlatformWebView.h

    r188807 r188817  
    3030#include <WebKit/WKRetainPtr.h>
    3131
    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
     37class WKView;
     38class WebKitTestRunnerWindow;
     39#endif
     40typedef WKView* PlatformWKView;
    4041typedef WebKitTestRunnerWindow* PlatformWindow;
    4142#elif defined(BUILDING_GTK__)
     
    5253class PlatformWebView {
    5354public:
    54 #if PLATFORM(COCOA)
    55     PlatformWebView(WKWebViewConfiguration*, const ViewOptions&);
    56 #else
    5755    PlatformWebView(WKPageConfigurationRef, const ViewOptions&);
    58 #endif
    5956    ~PlatformWebView();
    6057
     
    6461    void resizeTo(unsigned width, unsigned height);
    6562    void focus();
     63
     64    // Window snapshot is always enabled by default on all other platform.
     65    static bool windowSnapshotEnabled() { return true; }
    6666
    6767    WKRect windowFrame();
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r188807 r188817  
    198198}
    199199
    200 WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
     200WKPageRef TestController::createOtherPage(WKPageRef oldPpage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
    201201{
    202202    PlatformWebView* parentView = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
    203203
    204     PlatformWebView* view = platformCreateOtherPage(parentView, configuration, parentView->options());
     204    PlatformWebView* view = new PlatformWebView(configuration, parentView->options());
    205205    WKPageRef newPage = view->page();
    206206
     
    311311}
    312312
     313
    313314void TestController::initialize(int argc, const char* argv[])
    314315{
     
    372373        WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "MediaKeys").get());
    373374    }
    374     m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration.get())).get(), configuration.get());
    375 
     375
     376    m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get()));
    376377    m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
    377378
     
    435436    WKPageConfigurationSetContext(m_configuration.get(), m_context.get());
    436437    WKPageConfigurationSetPageGroup(m_configuration.get(), m_pageGroup.get());
    437     WKPageConfigurationSetUserContentController(m_configuration.get(), adoptWK(WKUserContentControllerCreate()).get());
    438438
    439439    // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
     
    443443void TestController::createWebViewWithOptions(const ViewOptions& options)
    444444{
    445     platformCreateWebView(m_configuration.get(), options);
     445    m_mainWebView = std::make_unique<PlatformWebView>(m_configuration.get(), options);
    446446    WKPageUIClientV6 pageUIClient = {
    447447        { 6, m_mainWebView.get() },
     
    569569{
    570570    // Reset preferences
    571     WKPreferencesRef preferences = platformPreferences();
     571    WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
    572572    WKPreferencesResetTestRunnerOverrides(preferences);
    573573    WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(preferences, false);
     
    623623
    624624    WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing);
    625     // FIXME: We should be testing the default.
    626     WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);
    627625
    628626    WKCookieManagerDeleteAllCookies(WKContextGetCookieManager(m_context.get()));
     
    636634
    637635    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);
    643636
    644637    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset"));
     
    676669#endif
    677670
    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
    679672    m_mainWebView->removeChromeInputField();
    680673    m_mainWebView->focus();
     
    718711    m_shouldLogHistoryClientCallbacks = false;
    719712
     713    WKPageGroupRemoveAllUserContentFilters(WKPageGetPageGroup(m_mainWebView->page()));
     714
    720715    setHidden(false);
    721 
    722     platformResetStateToConsistentValues();
    723716
    724717    // Reset main page back to about:blank
     
    16011594}
    16021595
    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 #endif
    1634 
    16351596} // namespace WTR
  • trunk/Tools/WebKitTestRunner/TestController.h

    r188807 r188817  
    3535#include <wtf/Vector.h>
    3636
    37 OBJC_CLASS WKWebViewConfiguration;
    38 
    3937namespace WTR {
    4038
     
    135133    void platformInitialize();
    136134    void platformDestroy();
    137     WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
    138135    void platformInitializeContext();
    139     void platformCreateWebView(WKPageConfigurationRef, const ViewOptions&);
    140     static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&);
    141136    void platformResetPreferencesToConsistentValues();
    142     void platformResetStateToConsistentValues();
    143137    void platformConfigureViewForTest(const TestInvocation&);
    144138    void platformWillRunTest(const TestInvocation&);
    145139    void platformRunUntil(bool& done, double timeout);
    146140    void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef);
    147     WKPreferencesRef platformPreferences();
    148141    void initializeInjectedBundlePath();
    149142    void initializeTestPluginDirectory();
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r188807 r188817  
    269269
    270270    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            }
    278280        }
    279281        dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get());
  • trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

    r188807 r188817  
    4141                29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */; };
    4242                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 */; };
    4543                2E34C90018B68808000067BB /* WebKitTestRunnerInjectedBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */; };
    4644                2E63ED8A1891AD7E002A7AFC /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */; };
     
    174172                29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; };
    175173                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>"; };
    177174                2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityControllerIOS.mm; sourceTree = "<group>"; };
    178175                2E63ED761891ACE9002A7AFC /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityNotificationHandler.h; sourceTree = "<group>"; };
     
    401398                                0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */,
    402399                                0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */,
    403                                 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */,
    404400                        );
    405401                        name = cocoa;
     
    791787                                2E63ED981891ADC7002A7AFC /* TestController.cpp in Sources */,
    792788                                2E63ED921891ADAD002A7AFC /* TestControllerIOS.mm in Sources */,
    793                                 2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */,
    794789                                0FEB90A81905C537000FDBF3 /* CrashReporterInfo.mm in Sources */,
    795790                                2E63ED991891ADC7002A7AFC /* TestInvocation.cpp in Sources */,
     
    811806                                E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */,
    812807                                5670B8281386FCA5002EB355 /* EventSenderProxy.mm in Sources */,
    813                                 2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */,
    814808                                26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp in Sources */,
    815809                                BC793400118F7C84005EA8E2 /* main.mm in Sources */,
  • trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp

    r188807 r188817  
    6262
    6363void TestController::platformDestroy()
     64{
     65}
     66
     67void TestController::platformWillRunTest(const TestInvocation&)
    6468{
    6569}
  • trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp

    r188807 r188817  
    5050
    5151void TestController::platformDestroy()
     52{
     53}
     54
     55void TestController::platformWillRunTest(const TestInvocation&)
    5256{
    5357}
  • trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm

    r188807 r188817  
    2929
    3030#import <WebKit/WKImageCG.h>
     31#import <WebKit/WKViewPrivate.h>
    3132#import <WebKit/WKPreferencesPrivate.h>
    32 #import <WebKit/WKWebViewConfiguration.h>
    33 #import <WebKit/WKWebViewPrivate.h>
    3433#import <wtf/RetainPtr.h>
    35 
    36 @interface WKWebView (Details)
    37 - (WKPageRef)_pageForTesting;
    38 @end
    3934
    4035@interface WebKitTestRunnerWindow : UIWindow {
     
    4641@end
    4742
     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
    4870@implementation WebKitTestRunnerWindow
    4971@synthesize platformWebView = _platformWebView;
     
    101123namespace WTR {
    102124
    103 PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
     125PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
    104126    : m_windowIsKey(true)
    105127    , m_options(options)
    106128{
    107129    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);
    109136
    110137    CGRect windowRect = rect;
     
    127154{
    128155    m_window.platformWebView = 0;
     156//    [m_window close];
    129157    [m_view release];
    130158    [m_window release];
     
    133161WKPageRef PlatformWebView::page()
    134162{
    135     return [m_view _pageForTesting];
     163    return [m_view pageRef];
    136164}
    137165
    138166void PlatformWebView::focus()
    139167{
    140     makeWebViewFirstResponder();
     168//    [m_window makeFirstResponder:m_view]; // FIXME: iOS equivalent?
    141169    setWindowIsKey(true);
    142170}
     
    157185{
    158186    [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)];
    160188}
    161189
     
    188216void PlatformWebView::makeWebViewFirstResponder()
    189217{
    190     // FIXME: iOS equivalent?
    191     // [m_window makeFirstResponder:m_view];
     218//    [m_window makeFirstResponder:m_view];
    192219}
    193220
     
    199226WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
    200227{
    201     // FIXME: Need an implementation of this, or we're depending on software paints!
    202     return nullptr;
     228    return 0; // FIXME for iOS?
    203229}
    204230
    205231bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const
    206232{
     233    if (m_options.useTiledDrawing != options.useTiledDrawing)
     234        return false;
     235
    207236    return true;
    208237}
  • trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm

    r188807 r188817  
    2727#import "TestController.h"
    2828
     29#import "CrashReporterInfo.h"
     30#import <Foundation/Foundation.h>
    2931#import "PlatformWebView.h"
    3032#import "TestInvocation.h"
    31 #import <Foundation/Foundation.h>
    3233#import <WebKit/WKPreferencesRefPrivate.h>
    33 #import <WebKit/WKProcessPoolPrivate.h>
    3434#import <WebKit/WKStringCF.h>
    35 #import <WebKit/WKUserContentControllerPrivate.h>
    36 #import <WebKit/WKWebView.h>
    37 #import <WebKit/WKWebViewConfiguration.h>
    38 #import <WebKit/WKWebViewConfigurationPrivate.h>
    3935#import <wtf/MainThread.h>
    4036
     
    7571}
    7672
     73void TestController::platformWillRunTest(const TestInvocation& testInvocation)
     74{
     75    setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
     76}
     77
    7778static bool shouldMakeViewportFlexible(const TestInvocation& test)
    7879{
     
    8283void TestController::platformResetPreferencesToConsistentValues()
    8384{
    84     WKPreferencesRef preferences = platformPreferences();
     85    WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
    8586    // Note that WKPreferencesSetTextAutosizingEnabled has no effect on iOS.
    8687    WKPreferencesSetMinimumZoomFontSize(preferences, 0);
     
    100101void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions&, const TestInvocation&) const
    101102{
     103}
     104
     105void 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];
    102111}
    103112
  • trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm

    r188807 r188817  
    3434#import <WebKit/WKString.h>
    3535#import <WebKit/WKPagePrivate.h>
    36 #import <WebKit/WKWebView.h>
    3736#import <wtf/RetainPtr.h>
    3837
     
    270269    // The right solution is just to use NSApplication's built-in event sending methods,
    271270    // 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();
    283272    ASSERT(targetView);
    284273    [NSApp _setCurrentEvent:event];
     
    413402{
    414403    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];
    416405    m_position.x = position.x;
    417406    m_position.y = position.y;
     
    420409                                   modifierFlags:0
    421410                                       timestamp:absoluteTimeForEventTime(currentEventTime())
    422                                     windowNumber:view.window.windowNumber
     411                                    windowNumber:[[view window] windowNumber]
    423412                                         context:[NSGraphicsContext currentContext]
    424413                                     eventNumber:++eventNumber
    425414                                      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]];
    430418    if (targetView) {
    431419        [NSApp _setCurrentEvent:event];
    432420        [targetView mouseMoved:event];
    433421        [NSApp _setCurrentEvent:nil];
    434     } else
     422    } else {
     423        NSPoint windowLocation = [event locationInWindow];
    435424        WTFLogAlways("mouseMoveTo failed to find a target view at %f,%f\n", windowLocation.x, windowLocation.y);
     425    }
    436426}
    437427
  • trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

    r188807 r188817  
    3131#import <WebKit/WKImageCG.h>
    3232#import <WebKit/WKPreferencesPrivate.h>
    33 #import <WebKit/WKWebViewConfiguration.h>
    34 #import <WebKit/WKWebViewPrivate.h>
     33#import <WebKit/WKViewPrivate.h>
    3534#import <wtf/RetainPtr.h>
    36 
    37 @interface WKWebView (Details)
    38 - (WKPageRef)_pageForTesting;
    39 @end
    4035
    4136using namespace WTR;
     
    5247@end
    5348
    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}
    5868
    5969- (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag
     
    111121namespace WTR {
    112122
    113 PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
     123PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
    114124    : m_windowIsKey(true)
    115125    , m_options(options)
    116126{
     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
    117133    // 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?
    118134    if (m_options.useRemoteLayerTree)
    119135        [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"WebKit2UseRemoteLayerTreeDrawingArea"];
    120136
    121     RetainPtr<WKWebViewConfiguration> copiedConfiguration = adoptNS([configuration copy]);
    122     WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);
    123 
    124137    NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight);
    125     m_view = [[TestRunnerWKWebView 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];
    127140
    128141    NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
     
    158171WKPageRef PlatformWebView::page()
    159172{
    160     return [m_view _pageForTesting];
     173    return [m_view pageRef];
    161174}
    162175
    163176void PlatformWebView::focus()
    164177{
    165     [m_window makeFirstResponder:platformView()];
     178    [m_window makeFirstResponder:m_view];
    166179    setWindowIsKey(true);
    167180}
     
    182195{
    183196    [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)];
    185198}
    186199
     
    193206void PlatformWebView::addChromeInputField()
    194207{
    195     NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
     208    NSTextField* textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
    196209    textField.tag = 1;
    197210    [[m_window contentView] addSubview:textField];
    198211    [textField release];
    199212
    200     NSView *view = platformView();
    201     [textField setNextKeyView:view];
    202     [view setNextKeyView:textField];
     213    [textField setNextKeyView:m_view];
     214    [m_view setNextKeyView:textField];
    203215}
    204216
    205217void PlatformWebView::removeChromeInputField()
    206218{
    207     NSView *textField = [[m_window contentView] viewWithTag:1];
     219    NSView* textField = [[m_window contentView] viewWithTag:1];
    208220    if (textField) {
    209221        [textField removeFromSuperview];
     
    214226void PlatformWebView::makeWebViewFirstResponder()
    215227{
    216     [m_window makeFirstResponder:platformView()];
     228    [m_window makeFirstResponder:m_view];
    217229}
    218230
    219231WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
    220232{
    221     [platformView() display];
     233    [m_view display];
    222234    CGWindowImageOption options = kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque;
    223235
  • trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm

    r188807 r188817  
    2727#import "TestController.h"
    2828
     29#import "CrashReporterInfo.h"
    2930#import "PlatformWebView.h"
    3031#import "PoseAsClass.h"
     
    3334#import <WebKit/WKContextPrivate.h>
    3435#import <WebKit/WKPageGroup.h>
    35 #import <WebKit/WKProcessPoolPrivate.h>
    3636#import <WebKit/WKStringCF.h>
    3737#import <WebKit/WKURLCF.h>
    38 #import <WebKit/WKUserContentControllerPrivate.h>
    39 #import <WebKit/WKWebView.h>
    40 #import <WebKit/WKWebViewConfiguration.h>
    41 #import <WebKit/WKWebViewConfigurationPrivate.h>
    4238#import <WebKit/_WKUserContentExtensionStore.h>
    4339#import <WebKit/_WKUserContentExtensionStorePrivate.h>
     
    7874}
    7975
     76void TestController::platformWillRunTest(const TestInvocation& testInvocation)
     77{
     78    setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
     79}
     80
    8081static bool shouldUseThreadedScrolling(const TestInvocation& test)
    8182{
     
    8586void TestController::platformResetPreferencesToConsistentValues()
    8687{
     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
    8797}
    8898
     
    112122    {
    113123        if (!error)
    114             [mainWebView()->platformView().configuration.userContentController _addUserContentFilter:filter];
     124            WKPageGroupAddUserContentFilter(WKPageGetPageGroup(TestController::singleton().mainWebView()->page()), (__bridge WKUserContentFilterRef)filter);
    115125        else
    116126            NSLog(@"%@", [error helpAnchor]);
     
    119129    platformRunUntil(doneCompiling, 0);
    120130#endif
     131}
     132
     133void 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];
    121139}
    122140
Note: See TracChangeset for help on using the changeset viewer.