diff options
Diffstat (limited to 'Tools/WebKitTestRunner/InjectedBundle')
7 files changed, 25 insertions, 14 deletions
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl index 5e52ee8ba..819ea4600 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl @@ -54,6 +54,7 @@ module WTR { void setAllowUniversalAccessFromFileURLs(in boolean value); void setAllowFileAccessFromFileURLs(in boolean value); void setFrameFlatteningEnabled(in boolean value); + void setPluginsEnabled(in boolean value); void setGeolocationPermission(in boolean value); void setJavaScriptCanAccessClipboard(in boolean value); void setPrivateBrowsingEnabled(in boolean value); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 05d4ea687..c9c3fec3d 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -230,7 +230,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) m_layoutTestController->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); - page()->reset(); + page()->prepare(); WKBundleClearAllDatabases(m_bundle); WKBundleClearApplicationCache(m_bundle); @@ -260,7 +260,9 @@ void InjectedBundle::done() WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get()); closeOtherPages(); - + + page()->resetAfterTest(); + m_state = Idle; } diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index 57d2e1496..dc2ad3d39 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -330,7 +330,7 @@ void InjectedBundlePage::stopLoading() WKBundlePageStopLoading(m_page); } -void InjectedBundlePage::reset() +void InjectedBundlePage::prepare() { WKBundlePageClearMainFrameName(m_page); @@ -347,6 +347,17 @@ void InjectedBundlePage::reset() WKBundlePageSetTracksRepaints(m_page, false); } +void InjectedBundlePage::resetAfterTest() +{ + WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page); + JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame); +#if PLATFORM(QT) + DumpRenderTreeSupportQt::injectInternalsObject(context); +#else + WebCoreTestSupport::resetInternalsObject(context); +#endif +} + // Loader Client Callbacks // String output must be identical to -[WebFrame _drt_descriptionSuitableForTestResult]. diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h index bce8ac038..4e1fce171 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h @@ -42,7 +42,8 @@ public: void stopLoading(); - void reset(); + void prepare(); + void resetAfterTest(); void dumpBackForwardList(); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp index 250fa5c95..cca4de681 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp @@ -371,6 +371,11 @@ void LayoutTestController::setFrameFlatteningEnabled(bool enabled) WKBundleSetFrameFlatteningEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } +void LayoutTestController::setPluginsEnabled(bool enabled) +{ + WKBundleSetPluginsEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); +} + void LayoutTestController::setGeolocationPermission(bool enabled) { WKBundleSetGeolocationPermission(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); @@ -478,13 +483,6 @@ void LayoutTestController::evaluateInWebInspector(long callID, JSStringRef scrip #endif // ENABLE(INSPECTOR) } -void LayoutTestController::setJavaScriptProfilingEnabled(bool enabled) -{ -#if ENABLE(INSPECTOR) - WKBundleInspectorSetJavaScriptProfilingEnabled(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()), enabled); -#endif // ENABLE(INSPECTOR) -} - typedef WTF::HashMap<unsigned, WKRetainPtr<WKBundleScriptWorldRef> > WorldMap; static WorldMap& worldMap() { diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h index 8ca09f61a..945a6609e 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h @@ -88,6 +88,7 @@ public: void setAllowUniversalAccessFromFileURLs(bool); void setAllowFileAccessFromFileURLs(bool); void setFrameFlatteningEnabled(bool); + void setPluginsEnabled(bool); void setGeolocationPermission(bool); void setJavaScriptCanAccessClipboard(bool); void setPrivateBrowsingEnabled(bool); @@ -174,7 +175,6 @@ public: void showWebInspector(); void closeWebInspector(); void evaluateInWebInspector(long callId, JSStringRef script); - void setJavaScriptProfilingEnabled(bool); void setPOSIXLocale(JSStringRef); diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp index 72d04878a..5de8ae71a 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp @@ -64,9 +64,7 @@ void LayoutTestController::platformInitialize() // which makes the use of QFontDatabase unnecessary. // See https://bugs.webkit.org/show_bug.cgi?id=53427 QWebSettings::clearMemoryCaches(); -#if !(QT_VERSION <= QT_VERSION_CHECK(4, 6, 2)) QFontDatabase::removeAllApplicationFonts(); -#endif activateFonts(); QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired())); } |