Changeset 140144 in webkit


Ignore:
Timestamp:
Jan 18, 2013 7:19:43 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebKit/gtk: [GTK] Add new method to support addUserScript in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=107275

Patch by Manuel Rego Casasnovas <Manuel Rego Casasnovas> on 2013-01-18
Reviewed by Philippe Normand.

  • WebCoreSupport/DumpRenderTreeSupportGtk.cpp:

(DumpRenderTreeSupportGtk::addUserScript): Implement new method using
PageGroup::addUserScriptToWorld.

  • WebCoreSupport/DumpRenderTreeSupportGtk.h:

(DumpRenderTreeSupportGtk): Define method header.

Tools: [GTK] Implement TestRunner::addUserScript
https://bugs.webkit.org/show_bug.cgi?id=107275

Patch by Manuel Rego Casasnovas <Manuel Rego Casasnovas> on 2013-01-18
Reviewed by Philippe Normand.

  • DumpRenderTree/gtk/TestRunnerGtk.cpp:

(TestRunner::addUserScript): Implement method using
DumpRenderTreeSupportGtk::addUserScript.

LayoutTests: [GTK] Implement LayoutTestController::addUserScript
https://bugs.webkit.org/show_bug.cgi?id=107275

Patch by Manuel Rego Casasnovas <Manuel Rego Casasnovas> on 2013-01-18
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.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140143 r140144  
     12013-01-18  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [GTK] Implement LayoutTestController::addUserScript
     4        https://bugs.webkit.org/show_bug.cgi?id=107275
     5
     6        Reviewed by Philippe Normand.
     7
     8        * platform/gtk-wk2/TestExpectations: Remove
     9        plugins/plugin-document-load-prevented-userscript.html.
     10        * platform/gtk/TestExpectations: Remove
     11        plugins/plugin-document-load-prevented-userscript.html.
     12
    1132013-01-18  Dominik Röttsches  <dominik.rottsches@intel.com>
    214
  • trunk/LayoutTests/platform/gtk-wk2/TestExpectations

    r139979 r140144  
    553553Bug(GTK) plugins/form-value.html [ Pass ]
    554554Bug(GTK) plugins/npruntime/delete-plugin-within-getProperty.html [ Pass ]
    555 Bug(GTK) plugins/plugin-document-load-prevented-userscript.html [ Pass ]
    556555Bug(GTK) fullscreen/full-screen-keyboard-enabled.html [ Pass ]
    557556
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r140125 r140144  
    10431043webkit.org/b/44316 platform/gtk/accessibility/title-and-alt.html [ Failure ]
    10441044
    1045 # LayoutTestController::addUserScript not implemented for gtk
    1046 Bug(GTK) plugins/plugin-document-load-prevented-userscript.html [ Failure ]
    1047 
    10481045# The following tests requires the DRT's dumpUserGestureInFrameLoadCallbacks
    10491046# method. But that method is not implemented in gtk port since gtk port can't
  • trunk/Source/WebKit/gtk/ChangeLog

    r140021 r140144  
     12013-01-18  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [GTK] Add new method to support addUserScript in DumpRenderTree
     4        https://bugs.webkit.org/show_bug.cgi?id=107275
     5
     6        Reviewed by Philippe Normand.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     9        (DumpRenderTreeSupportGtk::addUserScript): Implement new method using
     10        PageGroup::addUserScriptToWorld.
     11        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
     12        (DumpRenderTreeSupportGtk): Define method header.
     13
    1142013-01-17  Martin Robinson  <mrobinson@igalia.com>
    215
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r138983 r140144  
    195195}
    196196
     197void DumpRenderTreeSupportGtk::addUserScript(WebKitWebFrame* frame, const char* sourceCode, bool runAtStart, bool allFrames)
     198{
     199    g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
     200
     201    Frame* coreFrame = core(frame);
     202    if (!coreFrame)
     203        return;
     204
     205    WebKitWebView* webView = getViewFromFrame(frame);
     206    Page* page = core(webView);
     207    page->group().addUserScriptToWorld(mainThreadNormalWorld(), sourceCode, KURL(), Vector<String>(), Vector<String>(),
     208        runAtStart ? InjectAtDocumentStart : InjectAtDocumentEnd, allFrames ? InjectInAllFrames : InjectInTopFrameOnly);
     209}
     210
    197211/**
    198212 * addUserStyleSheet
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

    r138983 r140144  
    6161    static WTF::CString getInnerText(WebKitWebFrame*);
    6262    static WTF::CString dumpRenderTree(WebKitWebFrame*);
     63    static void addUserScript(WebKitWebFrame*, const char*, bool, bool);
    6364    static void addUserStyleSheet(WebKitWebFrame*, const char* sourceCode, bool allFrames);
    6465    static guint getPendingUnloadEventCount(WebKitWebFrame*);
  • trunk/Tools/ChangeLog

    r140131 r140144  
     12013-01-18  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [GTK] Implement TestRunner::addUserScript
     4        https://bugs.webkit.org/show_bug.cgi?id=107275
     5
     6        Reviewed by Philippe Normand.
     7
     8        * DumpRenderTree/gtk/TestRunnerGtk.cpp:
     9        (TestRunner::addUserScript): Implement method using
     10        DumpRenderTreeSupportGtk::addUserScript.
     11
    1122013-01-18  Sudarsana Nagineni  <sudarsana.nagineni@intel.com>
    213
  • trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp

    r137487 r140144  
    824824void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
    825825{
    826     printf("TestRunner::addUserScript not implemented.\n");
     826    GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
     827    DumpRenderTreeSupportGtk::addUserScript(mainFrame, sourceCode.get(), runAtStart, allFrames);
    827828}
    828829
Note: See TracChangeset for help on using the changeset viewer.