Diff
Modified: trunk/LayoutTests/ChangeLog (140143 => 140144)
--- trunk/LayoutTests/ChangeLog 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/LayoutTests/ChangeLog 2013-01-18 15:19:43 UTC (rev 140144)
@@ -1,3 +1,15 @@
+2013-01-18 Manuel Rego Casasnovas <[email protected]>
+
+ [GTK] Implement LayoutTestController::addUserScript
+ https://bugs.webkit.org/show_bug.cgi?id=107275
+
+ Reviewed by Philippe Normand.
+
+ * platform/gtk-wk2/TestExpectations: Remove
+ plugins/plugin-document-load-prevented-userscript.html.
+ * platform/gtk/TestExpectations: Remove
+ plugins/plugin-document-load-prevented-userscript.html.
+
2013-01-18 Dominik Röttsches <[email protected]>
[EFL] Unreviewed gardening.
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (140143 => 140144)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2013-01-18 15:19:43 UTC (rev 140144)
@@ -1042,9 +1042,6 @@
webkit.org/b/44316 platform/gtk/accessibility/object-attributes.html [ Failure ]
webkit.org/b/44316 platform/gtk/accessibility/title-and-alt.html [ Failure ]
-# LayoutTestController::addUserScript not implemented for gtk
-Bug(GTK) plugins/plugin-document-load-prevented-userscript.html [ Failure ]
-
# The following tests requires the DRT's dumpUserGestureInFrameLoadCallbacks
# method. But that method is not implemented in gtk port since gtk port can't
# not get user gesture in frameload callbacks.
Modified: trunk/LayoutTests/platform/gtk-wk2/TestExpectations (140143 => 140144)
--- trunk/LayoutTests/platform/gtk-wk2/TestExpectations 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/LayoutTests/platform/gtk-wk2/TestExpectations 2013-01-18 15:19:43 UTC (rev 140144)
@@ -552,7 +552,6 @@
Bug(GTK) http/tests/xmlhttprequest/origin-exact-matching.html [ Pass ]
Bug(GTK) plugins/form-value.html [ Pass ]
Bug(GTK) plugins/npruntime/delete-plugin-within-getProperty.html [ Pass ]
-Bug(GTK) plugins/plugin-document-load-prevented-userscript.html [ Pass ]
Bug(GTK) fullscreen/full-screen-keyboard-enabled.html [ Pass ]
# Will need rebaselining after bug 98527 fixed
Modified: trunk/Source/WebKit/gtk/ChangeLog (140143 => 140144)
--- trunk/Source/WebKit/gtk/ChangeLog 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/Source/WebKit/gtk/ChangeLog 2013-01-18 15:19:43 UTC (rev 140144)
@@ -1,3 +1,16 @@
+2013-01-18 Manuel Rego Casasnovas <[email protected]>
+
+ [GTK] Add new method to support addUserScript in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=107275
+
+ Reviewed by Philippe Normand.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ (DumpRenderTreeSupportGtk::addUserScript): Implement new method using
+ PageGroup::addUserScriptToWorld.
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+ (DumpRenderTreeSupportGtk): Define method header.
+
2013-01-17 Martin Robinson <[email protected]>
[GTK] Build with LevelDB when IndexedDB is enabled
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp (140143 => 140144)
--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp 2013-01-18 15:19:43 UTC (rev 140144)
@@ -194,6 +194,20 @@
return externalRepresentation(coreFrame).utf8();
}
+void DumpRenderTreeSupportGtk::addUserScript(WebKitWebFrame* frame, const char* sourceCode, bool runAtStart, bool allFrames)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
+
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ WebKitWebView* webView = getViewFromFrame(frame);
+ Page* page = core(webView);
+ page->group().addUserScriptToWorld(mainThreadNormalWorld(), sourceCode, KURL(), Vector<String>(), Vector<String>(),
+ runAtStart ? InjectAtDocumentStart : InjectAtDocumentEnd, allFrames ? InjectInAllFrames : InjectInTopFrameOnly);
+}
+
/**
* addUserStyleSheet
* @frame: a #WebKitWebFrame
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h (140143 => 140144)
--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h 2013-01-18 15:19:43 UTC (rev 140144)
@@ -60,6 +60,7 @@
static GSList* getFrameChildren(WebKitWebFrame*);
static WTF::CString getInnerText(WebKitWebFrame*);
static WTF::CString dumpRenderTree(WebKitWebFrame*);
+ static void addUserScript(WebKitWebFrame*, const char*, bool, bool);
static void addUserStyleSheet(WebKitWebFrame*, const char* sourceCode, bool allFrames);
static guint getPendingUnloadEventCount(WebKitWebFrame*);
static bool pauseAnimation(WebKitWebFrame*, const char* name, double time, const char* element);
Modified: trunk/Tools/ChangeLog (140143 => 140144)
--- trunk/Tools/ChangeLog 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/Tools/ChangeLog 2013-01-18 15:19:43 UTC (rev 140144)
@@ -1,3 +1,14 @@
+2013-01-18 Manuel Rego Casasnovas <[email protected]>
+
+ [GTK] Implement TestRunner::addUserScript
+ https://bugs.webkit.org/show_bug.cgi?id=107275
+
+ Reviewed by Philippe Normand.
+
+ * DumpRenderTree/gtk/TestRunnerGtk.cpp:
+ (TestRunner::addUserScript): Implement method using
+ DumpRenderTreeSupportGtk::addUserScript.
+
2013-01-18 Sudarsana Nagineni <[email protected]>
Unreviewed, add my secondary email address to the list.
Modified: trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp (140143 => 140144)
--- trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp 2013-01-18 15:13:52 UTC (rev 140143)
+++ trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp 2013-01-18 15:19:43 UTC (rev 140144)
@@ -823,7 +823,8 @@
void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
- printf("TestRunner::addUserScript not implemented.\n");
+ GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
+ DumpRenderTreeSupportGtk::addUserScript(mainFrame, sourceCode.get(), runAtStart, allFrames);
}
void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)