Diff
Modified: trunk/Source/WebKit2/ChangeLog (188816 => 188817)
--- trunk/Source/WebKit2/ChangeLog 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/ChangeLog 2015-08-22 02:32:41 UTC (rev 188817)
@@ -1,3 +1,25 @@
+2015-08-21 Commit Queue <[email protected]>
+
+ 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
+
2015-08-21 Timothy Horton <[email protected]>
WebKitTestRunner should use WKWebView on OS X and iOS
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (188816 => 188817)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -180,6 +180,7 @@
macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \
macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false) \
+ macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \
macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \
macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false) \
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (188816 => 188817)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -3083,16 +3083,6 @@
return [_wkView _topContentInset];
}
-- (BOOL)_windowOcclusionDetectionEnabled
-{
- return [_wkView windowOcclusionDetectionEnabled];
-}
-
-- (void)_setWindowOcclusionDetectionEnabled:(BOOL)flag
-{
- [_wkView setWindowOcclusionDetectionEnabled:flag];
-}
-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
- (void)_setAutomaticallyAdjustsContentInsets:(BOOL)automaticallyAdjustsContentInsets
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (188816 => 188817)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -173,9 +173,6 @@
// 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.
@property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
-
-@property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;
-
#endif
- (void)_killWebContentProcessAndResetState;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (188816 => 188817)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -615,18 +615,3 @@
if (returnDataRef)
*returnDataRef = toAPI(returnData.release().leakRef());
}
-
-void WKBundlePageAddUserScript(WKBundlePageRef pageRef, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames)
-{
- toImpl(pageRef)->addUserScript(toWTFString(source), toUserContentInjectedFrames(injectedFrames), toUserScriptInjectionTime(injectionTime));
-}
-
-void WKBundlePageAddUserStyleSheet(WKBundlePageRef pageRef, WKStringRef source, WKUserContentInjectedFrames injectedFrames)
-{
- toImpl(pageRef)->addUserStyleSheet(toWTFString(source), toUserContentInjectedFrames(injectedFrames));
-}
-
-void WKBundlePageRemoveAllUserContent(WKBundlePageRef pageRef)
-{
- toImpl(pageRef)->removeAllUserContent();
-}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (188816 => 188817)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -29,8 +29,6 @@
#include <WebKit/WKBase.h>
#include <WebKit/WKEvent.h>
#include <WebKit/WKGeometry.h>
-#include <WebKit/WKUserContentInjectedFrames.h>
-#include <WebKit/WKUserScriptInjectionTime.h>
#ifdef __cplusplus
extern "C" {
@@ -95,11 +93,6 @@
WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef);
WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken);
-// UserContent API (compatible with Modern API, for WKTR)
-WK_EXPORT void WKBundlePageAddUserScript(WKBundlePageRef page, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames);
-WK_EXPORT void WKBundlePageAddUserStyleSheet(WKBundlePageRef page, WKStringRef source, WKUserContentInjectedFrames injectedFrames);
-WK_EXPORT void WKBundlePageRemoveAllUserContent(WKBundlePageRef page);
-
#if TARGET_OS_IPHONE
WK_EXPORT void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef, bool);
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (188816 => 188817)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -5006,30 +5006,4 @@
send(Messages::WebPageProxy::ImageOrMediaDocumentSizeChanged(newSize));
}
-void WebPage::addUserScript(const String& source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
-{
- ASSERT(m_userContentController);
-
- WebCore::UserScript userScript(source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectionTime, injectedFrames);
-
- m_userContentController->userContentController().addUserScript(mainThreadNormalWorld(), std::make_unique<WebCore::UserScript>(userScript));
-}
-
-void WebPage::addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames injectedFrames)
-{
- ASSERT(m_userContentController);
-
- WebCore::UserStyleSheet userStyleSheet(source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel);
-
- m_userContentController->userContentController().addUserStyleSheet(mainThreadNormalWorld(), std::make_unique<WebCore::UserStyleSheet>(userStyleSheet), InjectInExistingDocuments);
-}
-
-void WebPage::removeAllUserContent()
-{
- if (!m_userContentController)
- return;
-
- m_userContentController->userContentController().removeAllUserContent();
-}
-
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (188816 => 188817)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -63,8 +63,6 @@
#include <WebCore/TextChecking.h>
#include <WebCore/TextIndicator.h>
#include <WebCore/UserActivity.h>
-#include <WebCore/UserContentTypes.h>
-#include <WebCore/UserScriptTypes.h>
#include <WebCore/ViewState.h>
#include <WebCore/ViewportConfiguration.h>
#include <WebCore/WebCoreKeyboardUIMode.h>
@@ -916,10 +914,6 @@
#endif
#endif
- void addUserScript(const String& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
- void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
- void removeAllUserContent();
-
private:
WebPage(uint64_t pageID, const WebPageCreationParameters&);
Modified: trunk/Tools/ChangeLog (188816 => 188817)
--- trunk/Tools/ChangeLog 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/ChangeLog 2015-08-22 02:32:41 UTC (rev 188817)
@@ -1,3 +1,25 @@
+2015-08-21 Commit Queue <[email protected]>
+
+ 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
+
2015-08-21 Tim Horton <[email protected]>
Stop building WebKitTestRunner for 32-bit platforms
Modified: trunk/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig 2015-08-22 02:32:41 UTC (rev 188817)
@@ -24,7 +24,7 @@
#include "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
#include "Base.xcconfig"
-VALID_ARCHS[sdk=macosx*] = $(ARCHS_STANDARD_64_BIT);
+ARCHS = $(ARCHS_STANDARD_32_64_BIT);
_ONLY_ACTIVE_ARCH_ = YES;
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -261,7 +261,7 @@
WKBundleSetPluginsEnabled(m_bundle, m_pageGroup, true);
WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
- WKBundlePageRemoveAllUserContent(page()->page());
+ WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates"));
m_testRunner->setUserStyleSheetEnabled(false);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -172,8 +172,10 @@
void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
+ WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
- WKBundlePageAddUserScript(InjectedBundle::singleton().page()->page(), sourceWK.get(),
+ auto& injectedBundle = InjectedBundle::singleton();
+ WKBundleAddUserScript(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
(runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd),
(allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
}
@@ -181,8 +183,10 @@
void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
+ WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
- WKBundlePageAddUserStyleSheet(InjectedBundle::singleton().page()->page(), sourceWK.get(),
+ auto& injectedBundle = InjectedBundle::singleton();
+ WKBundleAddUserStyleSheet(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
(allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
}
Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/PlatformWebView.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -29,14 +29,15 @@
#include "ViewOptions.h"
#include <WebKit/WKRetainPtr.h>
-#if PLATFORM(COCOA)
-OBJC_CLASS NSView;
-OBJC_CLASS UIView;
-OBJC_CLASS WKWebView;
-OBJC_CLASS WKWebViewConfiguration;
-OBJC_CLASS WebKitTestRunnerWindow;
-
-typedef WKWebView* PlatformWKView;
+#if defined(__APPLE__) && __APPLE__
+#ifdef __OBJC__
+@class WKView;
+@class WebKitTestRunnerWindow;
+#else
+class WKView;
+class WebKitTestRunnerWindow;
+#endif
+typedef WKView* PlatformWKView;
typedef WebKitTestRunnerWindow* PlatformWindow;
#elif defined(BUILDING_GTK__)
typedef struct _GtkWidget GtkWidget;
@@ -51,11 +52,7 @@
class PlatformWebView {
public:
-#if PLATFORM(COCOA)
- PlatformWebView(WKWebViewConfiguration*, const ViewOptions&);
-#else
PlatformWebView(WKPageConfigurationRef, const ViewOptions&);
-#endif
~PlatformWebView();
WKPageRef page();
@@ -64,6 +61,9 @@
void resizeTo(unsigned width, unsigned height);
void focus();
+ // Window snapshot is always enabled by default on all other platform.
+ static bool windowSnapshotEnabled() { return true; }
+
WKRect windowFrame();
void setWindowFrame(WKRect);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -197,11 +197,11 @@
TestController::singleton().handleUserMediaPermissionRequest(permissionRequest);
}
-WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
+WKPageRef TestController::createOtherPage(WKPageRef oldPpage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
{
PlatformWebView* parentView = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
- PlatformWebView* view = platformCreateOtherPage(parentView, configuration, parentView->options());
+ PlatformWebView* view = new PlatformWebView(configuration, parentView->options());
WKPageRef newPage = view->page();
view->resizeTo(800, 600);
@@ -310,6 +310,7 @@
return platformLibraryPathForTesting();
}
+
void TestController::initialize(int argc, const char* argv[])
{
platformInitialize();
@@ -371,8 +372,8 @@
WKContextConfigurationSetWebSQLDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + "Databases" + separator + "WebSQL").get());
WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "MediaKeys").get());
}
- m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration.get())).get(), configuration.get());
+ m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get()));
m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
#if PLATFORM(EFL)
@@ -434,7 +435,6 @@
m_configuration = adoptWK(WKPageConfigurationCreate());
WKPageConfigurationSetContext(m_configuration.get(), m_context.get());
WKPageConfigurationSetPageGroup(m_configuration.get(), m_pageGroup.get());
- WKPageConfigurationSetUserContentController(m_configuration.get(), adoptWK(WKUserContentControllerCreate()).get());
// Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
resetPreferencesToConsistentValues();
@@ -442,7 +442,7 @@
void TestController::createWebViewWithOptions(const ViewOptions& options)
{
- platformCreateWebView(m_configuration.get(), options);
+ m_mainWebView = std::make_unique<PlatformWebView>(m_configuration.get(), options);
WKPageUIClientV6 pageUIClient = {
{ 6, m_mainWebView.get() },
0, // createNewPage_deprecatedForUseWithV0
@@ -568,7 +568,7 @@
void TestController::resetPreferencesToConsistentValues()
{
// Reset preferences
- WKPreferencesRef preferences = platformPreferences();
+ WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
WKPreferencesResetTestRunnerOverrides(preferences);
WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(preferences, false);
WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
@@ -622,8 +622,6 @@
WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(preferences, false);
WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing);
- // FIXME: We should be testing the default.
- WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);
WKCookieManagerDeleteAllCookies(WKContextGetCookieManager(m_context.get()));
@@ -636,11 +634,6 @@
m_beforeUnloadReturnValue = true;
- // This setting differs between the antique and modern Mac WebKit2 API.
- // For now, maintain the antique behavior, because some tests depend on it!
- // FIXME: We should be testing the default.
- WKPageSetBackgroundExtendsBeyondPage(m_mainWebView->page(), false);
-
WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset"));
WKRetainPtr<WKMutableDictionaryRef> resetMessageBody = adoptWK(WKMutableDictionaryCreate());
@@ -675,7 +668,7 @@
WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
#endif
- // In the case that a test using the chrome input field failed, be sure to clean up for the next test.
+ // in the case that a test using the chrome input field failed, be sure to clean up for the next test
m_mainWebView->removeChromeInputField();
m_mainWebView->focus();
@@ -717,10 +710,10 @@
m_shouldLogHistoryClientCallbacks = false;
+ WKPageGroupRemoveAllUserContentFilters(WKPageGetPageGroup(m_mainWebView->page()));
+
setHidden(false);
- platformResetStateToConsistentValues();
-
// Reset main page back to about:blank
m_doneResetting = false;
@@ -1600,36 +1593,4 @@
m_currentInvocation->outputText(String::format("WebView updated the title for history URL \"%s\" to \"%s\".\n", toSTD(urlStringWK).c_str(), toSTD(title).c_str()));
}
-#if !PLATFORM(COCOA)
-void TestController::platformWillRunTest(const TestInvocation&)
-{
-}
-
-WKPreferencesRef TestController::platformPreferences()
-{
- WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageCopyPageConfiguration(m_mainWebView->page()));
- return WKPageConfigurationGetPreferences(configuration.get());
-}
-
-void TestController::platformCreateWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
-{
- m_mainWebView = std::make_unique<PlatformWebView>(configuration, options);
-}
-
-PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef configuration, const ViewOptions& options)
-{
- return new PlatformWebView(configuration, options);
-}
-
-WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
-{
- return context;
-}
-
-void TestController::platformResetStateToConsistentValues()
-{
-
-}
-#endif
-
} // namespace WTR
Modified: trunk/Tools/WebKitTestRunner/TestController.h (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/TestController.h 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2015-08-22 02:32:41 UTC (rev 188817)
@@ -34,8 +34,6 @@
#include <vector>
#include <wtf/Vector.h>
-OBJC_CLASS WKWebViewConfiguration;
-
namespace WTR {
class TestInvocation;
@@ -134,17 +132,12 @@
void platformInitialize();
void platformDestroy();
- WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
void platformInitializeContext();
- void platformCreateWebView(WKPageConfigurationRef, const ViewOptions&);
- static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&);
void platformResetPreferencesToConsistentValues();
- void platformResetStateToConsistentValues();
void platformConfigureViewForTest(const TestInvocation&);
void platformWillRunTest(const TestInvocation&);
void platformRunUntil(bool& done, double timeout);
void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef);
- WKPreferencesRef platformPreferences();
void initializeInjectedBundlePath();
void initializeTestPluginDirectory();
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -268,13 +268,15 @@
dumpAudio(m_audioResult.get());
if (m_dumpPixels && m_pixelResult) {
- m_gotRepaint = false;
- WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback);
- TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
- if (!m_gotRepaint) {
- m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n";
- m_webProcessIsUnresponsive = true;
- return;
+ if (PlatformWebView::windowSnapshotEnabled()) {
+ m_gotRepaint = false;
+ WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback);
+ TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
+ if (!m_gotRepaint) {
+ m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n";
+ m_webProcessIsUnresponsive = true;
+ return;
+ }
}
dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get());
}
Modified: trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj 2015-08-22 02:32:41 UTC (rev 188817)
@@ -40,8 +40,6 @@
29A8FCDD145F0337009045A6 /* JSAccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */; };
29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */; };
29A8FCE5145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */; };
- 2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };
- 2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };
2E34C90018B68808000067BB /* WebKitTestRunnerInjectedBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */; };
2E63ED8A1891AD7E002A7AFC /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */; };
2E63ED8B1891AD7E002A7AFC /* AccessibilityTextMarkerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED771891ACE9002A7AFC /* AccessibilityTextMarkerIOS.mm */; };
@@ -173,7 +171,6 @@
29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarkerRange.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; };
29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerRangeMac.mm; sourceTree = "<group>"; };
- 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestControllerCocoa.mm; path = cocoa/TestControllerCocoa.mm; sourceTree = "<group>"; };
2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityControllerIOS.mm; sourceTree = "<group>"; };
2E63ED761891ACE9002A7AFC /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityNotificationHandler.h; sourceTree = "<group>"; };
2E63ED771891ACE9002A7AFC /* AccessibilityTextMarkerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerIOS.mm; sourceTree = "<group>"; };
@@ -400,7 +397,6 @@
children = (
0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */,
0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */,
- 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */,
);
name = cocoa;
sourceTree = "<group>";
@@ -790,7 +786,6 @@
2E63ED971891ADC7002A7AFC /* PixelDumpSupport.cpp in Sources */,
2E63ED981891ADC7002A7AFC /* TestController.cpp in Sources */,
2E63ED921891ADAD002A7AFC /* TestControllerIOS.mm in Sources */,
- 2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */,
0FEB90A81905C537000FDBF3 /* CrashReporterInfo.mm in Sources */,
2E63ED991891ADC7002A7AFC /* TestInvocation.cpp in Sources */,
2E63EDA51891BD8E002A7AFC /* TestInvocationCG.cpp in Sources */,
@@ -810,7 +805,6 @@
E1C642C317CBCC7300D66A3C /* PoseAsClass.mm in Sources */,
E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */,
5670B8281386FCA5002EB355 /* EventSenderProxy.mm in Sources */,
- 2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */,
26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp in Sources */,
BC793400118F7C84005EA8E2 /* main.mm in Sources */,
5322FB4613FDA0EA0041ABCC /* PixelDumpSupport.cpp in Sources */,
Deleted: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "TestController.h"
-
-#import "CrashReporterInfo.h"
-#import "PlatformWebView.h"
-#import "TestInvocation.h"
-#import <Foundation/Foundation.h>
-#import <WebKit/WKContextConfigurationRef.h>
-#import <WebKit/WKPreferencesRefPrivate.h>
-#import <WebKit/WKProcessPoolPrivate.h>
-#import <WebKit/WKStringCF.h>
-#import <WebKit/WKUserContentControllerPrivate.h>
-#import <WebKit/WKWebView.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/WKWebViewConfigurationPrivate.h>
-#import <WebKit/_WKProcessPoolConfiguration.h>
-#import <WebKit/_WKUserContentExtensionStore.h>
-#import <WebKit/_WKUserContentExtensionStorePrivate.h>
-#import <wtf/MainThread.h>
-
-namespace WTR {
-
-static WKWebViewConfiguration *globalWebViewConfiguration;
-
-void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injectedBundlePath, WKContextRef context, WKContextConfigurationRef contextConfiguration)
-{
- ASSERT(!globalWebViewConfiguration);
- globalWebViewConfiguration = [[WKWebViewConfiguration alloc] init];
-
- globalWebViewConfiguration.processPool = [[WKProcessPool alloc] _initWithConfiguration:(_WKProcessPoolConfiguration *)contextConfiguration];
- globalWebViewConfiguration.websiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
-}
-
-WKPreferencesRef TestController::platformPreferences()
-{
- return (WKPreferencesRef)globalWebViewConfiguration.preferences;
-}
-
-void TestController::platformCreateWebView(WKPageConfigurationRef, const ViewOptions& options)
-{
- m_mainWebView = std::make_unique<PlatformWebView>(globalWebViewConfiguration, options);
-}
-
-PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions& options)
-{
- WKWebViewConfiguration *newConfiguration = [[globalWebViewConfiguration copy] autorelease];
- newConfiguration._relatedWebView = static_cast<WKWebView*>(parentView->platformView());
- return new PlatformWebView(newConfiguration, options);
-}
-
-WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
-{
- initializeWebViewConfiguration(libraryPathForTesting(), injectedBundlePath(), context, contextConfiguration);
- return (WKContextRef)globalWebViewConfiguration.processPool;
-}
-
-void TestController::platformRunUntil(bool& done, double timeout)
-{
- NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
-
- while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending)
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
-}
-
-void TestController::platformResetStateToConsistentValues()
-{
-#if WK_API_ENABLED
- __block bool doneRemoving = false;
- [[_WKUserContentExtensionStore defaultStore] removeContentExtensionForIdentifier:@"TestContentExtensions" completionHandler:^(NSError *error) {
- doneRemoving = true;
- }];
- platformRunUntil(doneRemoving, 0);
- [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions];
-#endif
-
- if (PlatformWebView* webView = mainWebView())
- [webView->platformView().configuration.userContentController _removeAllUserContentFilters];
-}
-
-void TestController::platformWillRunTest(const TestInvocation& testInvocation)
-{
- setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
-}
-
-} // namespace WTR
Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -64,6 +64,10 @@
{
}
+void TestController::platformWillRunTest(const TestInvocation&)
+{
+}
+
void TestController::platformRunUntil(bool& condition, double timeout)
{
if (timeout <= 0) {
Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp 2015-08-22 02:32:41 UTC (rev 188817)
@@ -52,6 +52,10 @@
{
}
+void TestController::platformWillRunTest(const TestInvocation&)
+{
+}
+
void TestController::platformRunUntil(bool&, double timeout)
{
if (timeout > 0) {
Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -28,15 +28,10 @@
#include "TestController.h"
#import <WebKit/WKImageCG.h>
+#import <WebKit/WKViewPrivate.h>
#import <WebKit/WKPreferencesPrivate.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/WKWebViewPrivate.h>
#import <wtf/RetainPtr.h>
-@interface WKWebView (Details)
-- (WKPageRef)_pageForTesting;
-@end
-
@interface WebKitTestRunnerWindow : UIWindow {
WTR::PlatformWebView* _platformWebView;
CGPoint _fakeOrigin;
@@ -45,6 +40,33 @@
@property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
@end
+@interface TestRunnerWKView : WKView {
+ BOOL _useTiledDrawing;
+}
+
+@property (nonatomic, assign) BOOL useTiledDrawing;
+@end
+
+@implementation TestRunnerWKView
+
+@synthesize useTiledDrawing = _useTiledDrawing;
+
+- (id)initWithFrame:(CGRect)frame configurationRef:(WKPageConfigurationRef)configuration useTiledDrawing:(BOOL)useTiledDrawing
+{
+ if (!(self = [super initWithFrame:frame configurationRef:configuration]))
+ return nil;
+
+ _useTiledDrawing = useTiledDrawing;
+ return self;
+}
+
+- (BOOL)_shouldUseTiledDrawingArea
+{
+ return _useTiledDrawing;
+}
+
+@end
+
@implementation WebKitTestRunnerWindow
@synthesize platformWebView = _platformWebView;
@@ -100,13 +122,18 @@
namespace WTR {
-PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
: m_windowIsKey(true)
, m_options(options)
{
CGRect rect = CGRectMake(0, 0, TestController::viewWidth, TestController::viewHeight);
- m_view = [[WKWebView alloc] initWithFrame:rect configuration:configuration];
+ m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useTiledDrawing:m_options.useTiledDrawing];
+ WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration);
+
+ WKPreferencesSetCompositingBordersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
+ WKPreferencesSetCompositingRepaintCountersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
+
CGRect windowRect = rect;
m_window = [[WebKitTestRunnerWindow alloc] initWithFrame:windowRect];
m_window.platformWebView = this;
@@ -126,18 +153,19 @@
PlatformWebView::~PlatformWebView()
{
m_window.platformWebView = 0;
+// [m_window close];
[m_view release];
[m_window release];
}
WKPageRef PlatformWebView::page()
{
- return [m_view _pageForTesting];
+ return [m_view pageRef];
}
void PlatformWebView::focus()
{
- makeWebViewFirstResponder();
+// [m_window makeFirstResponder:m_view]; // FIXME: iOS equivalent?
setWindowIsKey(true);
}
@@ -156,7 +184,7 @@
void PlatformWebView::setWindowFrame(WKRect frame)
{
[m_window setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)];
- [platformView() setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
+ [m_view setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
}
void PlatformWebView::didInitializeClients()
@@ -187,8 +215,7 @@
void PlatformWebView::makeWebViewFirstResponder()
{
- // FIXME: iOS equivalent?
- // [m_window makeFirstResponder:m_view];
+// [m_window makeFirstResponder:m_view];
}
void PlatformWebView::changeWindowScaleIfNeeded(float)
@@ -198,12 +225,14 @@
WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
{
- // FIXME: Need an implementation of this, or we're depending on software paints!
- return nullptr;
+ return 0; // FIXME for iOS?
}
bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const
{
+ if (m_options.useTiledDrawing != options.useTiledDrawing)
+ return false;
+
return true;
}
Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -26,16 +26,12 @@
#import "config.h"
#import "TestController.h"
+#import "CrashReporterInfo.h"
+#import <Foundation/Foundation.h>
#import "PlatformWebView.h"
#import "TestInvocation.h"
-#import <Foundation/Foundation.h>
#import <WebKit/WKPreferencesRefPrivate.h>
-#import <WebKit/WKProcessPoolPrivate.h>
#import <WebKit/WKStringCF.h>
-#import <WebKit/WKUserContentControllerPrivate.h>
-#import <WebKit/WKWebView.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/WKWebViewConfigurationPrivate.h>
#import <wtf/MainThread.h>
namespace WTR {
@@ -74,6 +70,11 @@
m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
}
+void TestController::platformWillRunTest(const TestInvocation& testInvocation)
+{
+ setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
+}
+
static bool shouldMakeViewportFlexible(const TestInvocation& test)
{
return test.urlContains("viewport/");
@@ -81,7 +82,7 @@
void TestController::platformResetPreferencesToConsistentValues()
{
- WKPreferencesRef preferences = platformPreferences();
+ WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
// Note that WKPreferencesSetTextAutosizingEnabled has no effect on iOS.
WKPreferencesSetMinimumZoomFontSize(preferences, 0);
}
@@ -101,6 +102,14 @@
{
}
+void TestController::platformRunUntil(bool& done, double timeout)
+{
+ NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
+
+ while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
+}
+
void TestController::platformInitializeContext()
{
}
Modified: trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -33,7 +33,6 @@
#import <Carbon/Carbon.h>
#import <WebKit/WKString.h>
#import <WebKit/WKPagePrivate.h>
-#import <WebKit/WKWebView.h>
#import <wtf/RetainPtr.h>
@interface NSApplication (Details)
@@ -269,17 +268,7 @@
// FIXME: Silly hack to teach WKTR to respect capturing mouse events outside the WKView.
// The right solution is just to use NSApplication's built-in event sending methods,
// instead of rolling our own algorithm for selecting an event target.
- // FIXME: This is even worse now, because we need to hit the WKWebView's inner WKView
- // when using the modern API, so the level of fakery and horror increases.
- if (!targetView) {
- targetView = m_testController->mainWebView()->platformView();
- for (NSView *wkWebViewChild in targetView.subviews) {
- if ([wkWebViewChild isKindOfClass:[WKView class]]) {
- targetView = wkWebViewChild;
- break;
- }
- }
- }
+ targetView = targetView ? targetView : m_testController->mainWebView()->platformView();
ASSERT(targetView);
[NSApp _setCurrentEvent:event];
[targetView mouseUp:event];
@@ -412,27 +401,28 @@
void EventSenderProxy::mouseMoveTo(double x, double y)
{
NSView *view = m_testController->mainWebView()->platformView();
- NSPoint position = [view convertPoint:NSMakePoint(x, view.frame.size.height - y) toView:nil];
+ NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil];
m_position.x = position.x;
m_position.y = position.y;
NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved)
location:position
modifierFlags:0
timestamp:absoluteTimeForEventTime(currentEventTime())
- windowNumber:view.window.windowNumber
+ windowNumber:[[view window] windowNumber]
context:[NSGraphicsContext currentContext]
eventNumber:++eventNumber
clickCount:(m_leftMouseButtonDown ? m_clickCount : 0)
- pressure:0];
+ pressure:0.0];
- NSPoint windowLocation = event.locationInWindow;
- NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:windowLocation];
+ NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]];
if (targetView) {
[NSApp _setCurrentEvent:event];
[targetView mouseMoved:event];
[NSApp _setCurrentEvent:nil];
- } else
+ } else {
+ NSPoint windowLocation = [event locationInWindow];
WTFLogAlways("mouseMoveTo failed to find a target view at %f,%f\n", windowLocation.x, windowLocation.y);
+ }
}
void EventSenderProxy::leapForward(int milliseconds)
Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -30,14 +30,9 @@
#import "WebKitTestRunnerDraggingInfo.h"
#import <WebKit/WKImageCG.h>
#import <WebKit/WKPreferencesPrivate.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKViewPrivate.h>
#import <wtf/RetainPtr.h>
-@interface WKWebView (Details)
-- (WKPageRef)_pageForTesting;
-@end
-
using namespace WTR;
enum {
@@ -51,11 +46,26 @@
@property (nonatomic, assign) PlatformWebView* platformWebView;
@end
-@interface TestRunnerWKWebView : WKWebView
+@interface TestRunnerWKView : WKView {
+ BOOL _useThreadedScrolling;
+}
+
+@property (nonatomic, assign) BOOL useThreadedScrolling;
@end
-@implementation TestRunnerWKWebView
+@implementation TestRunnerWKView
+@synthesize useThreadedScrolling = _useThreadedScrolling;
+
+- (id)initWithFrame:(NSRect)frame configurationRef:(WKPageConfigurationRef)configuration useThreadedScrolling:(BOOL)useThreadedScrolling
+{
+ if (!(self = [super initWithFrame:frame configurationRef:configuration]))
+ return nil;
+
+ _useThreadedScrolling = useThreadedScrolling;
+ return self;
+}
+
- (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag
{
RetainPtr<WebKitTestRunnerDraggingInfo> draggingInfo = adoptNS([[WebKitTestRunnerDraggingInfo alloc] initWithImage:anImage offset:initialOffset pasteboard:pboard source:sourceObj]);
@@ -110,20 +120,23 @@
namespace WTR {
-PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
: m_windowIsKey(true)
, m_options(options)
{
+ WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration);
+
+ // The tiled drawing specific tests also depend on threaded scrolling.
+ WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroupRef);
+ WKPreferencesSetThreadedScrollingEnabled(preferences, m_options.useThreadedScrolling);
+
// 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?
if (m_options.useRemoteLayerTree)
[[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"WebKit2UseRemoteLayerTreeDrawingArea"];
- RetainPtr<WKWebViewConfiguration> copiedConfiguration = adoptNS([configuration copy]);
- WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);
-
NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight);
- m_view = [[TestRunnerWKWebView alloc] initWithFrame:rect configuration:copiedConfiguration.get()];
- [m_view _setWindowOcclusionDetectionEnabled:NO];
+ m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useThreadedScrolling:options.useThreadedScrolling];
+ [m_view setWindowOcclusionDetectionEnabled:NO];
NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
NSRect windowRect = m_options.shouldShowWebView ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
@@ -157,12 +170,12 @@
WKPageRef PlatformWebView::page()
{
- return [m_view _pageForTesting];
+ return [m_view pageRef];
}
void PlatformWebView::focus()
{
- [m_window makeFirstResponder:platformView()];
+ [m_window makeFirstResponder:m_view];
setWindowIsKey(true);
}
@@ -181,7 +194,7 @@
void PlatformWebView::setWindowFrame(WKRect frame)
{
[m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
- [platformView() setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
+ [m_view setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
}
void PlatformWebView::didInitializeClients()
@@ -192,19 +205,18 @@
void PlatformWebView::addChromeInputField()
{
- NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
+ NSTextField* textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
textField.tag = 1;
[[m_window contentView] addSubview:textField];
[textField release];
- NSView *view = platformView();
- [textField setNextKeyView:view];
- [view setNextKeyView:textField];
+ [textField setNextKeyView:m_view];
+ [m_view setNextKeyView:textField];
}
void PlatformWebView::removeChromeInputField()
{
- NSView *textField = [[m_window contentView] viewWithTag:1];
+ NSView* textField = [[m_window contentView] viewWithTag:1];
if (textField) {
[textField removeFromSuperview];
makeWebViewFirstResponder();
@@ -213,12 +225,12 @@
void PlatformWebView::makeWebViewFirstResponder()
{
- [m_window makeFirstResponder:platformView()];
+ [m_window makeFirstResponder:m_view];
}
WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
{
- [platformView() display];
+ [m_view display];
CGWindowImageOption options = kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque;
if ([m_window backingScaleFactor] == 1)
Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (188816 => 188817)
--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2015-08-22 02:27:23 UTC (rev 188816)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2015-08-22 02:32:41 UTC (rev 188817)
@@ -26,19 +26,15 @@
#import "config.h"
#import "TestController.h"
+#import "CrashReporterInfo.h"
#import "PlatformWebView.h"
#import "PoseAsClass.h"
#import "TestInvocation.h"
#import "WebKitTestRunnerPasteboard.h"
#import <WebKit/WKContextPrivate.h>
#import <WebKit/WKPageGroup.h>
-#import <WebKit/WKProcessPoolPrivate.h>
#import <WebKit/WKStringCF.h>
#import <WebKit/WKURLCF.h>
-#import <WebKit/WKUserContentControllerPrivate.h>
-#import <WebKit/WKWebView.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/WKWebViewConfigurationPrivate.h>
#import <WebKit/_WKUserContentExtensionStore.h>
#import <WebKit/_WKUserContentExtensionStorePrivate.h>
#import <mach-o/dyld.h>
@@ -77,6 +73,11 @@
m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
}
+void TestController::platformWillRunTest(const TestInvocation& testInvocation)
+{
+ setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
+}
+
static bool shouldUseThreadedScrolling(const TestInvocation& test)
{
return test.urlContains("tiled-drawing/");
@@ -84,6 +85,15 @@
void TestController::platformResetPreferencesToConsistentValues()
{
+#if WK_API_ENABLED
+ __block bool doneRemoving = false;
+ [[_WKUserContentExtensionStore defaultStore] removeContentExtensionForIdentifier:@"TestContentExtensions" completionHandler:^(NSError *error)
+ {
+ doneRemoving = true;
+ }];
+ platformRunUntil(doneRemoving, 0);
+ [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions];
+#endif
}
void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions& viewOptions, const TestInvocation& test) const
@@ -111,7 +121,7 @@
[[_WKUserContentExtensionStore defaultStore] compileContentExtensionForIdentifier:@"TestContentExtensions" encodedContentExtension:contentExtensionString completionHandler:^(_WKUserContentFilter *filter, NSError *error)
{
if (!error)
- [mainWebView()->platformView().configuration.userContentController _addUserContentFilter:filter];
+ WKPageGroupAddUserContentFilter(WKPageGetPageGroup(TestController::singleton().mainWebView()->page()), (__bridge WKUserContentFilterRef)filter);
else
NSLog(@"%@", [error helpAnchor]);
doneCompiling = true;
@@ -120,6 +130,14 @@
#endif
}
+void TestController::platformRunUntil(bool& done, double timeout)
+{
+ NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
+
+ while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
+}
+
#if ENABLE(PLATFORM_FONT_LOOKUP)
static NSSet *allowedFontFamilySet()
{