Changeset 221240 in webkit


Ignore:
Timestamp:
Aug 28, 2017 4:46:14 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Ensure that the alert function is called in TestWebExtensions.
https://bugs.webkit.org/show_bug.cgi?id=175880

Patch by Ms2ger <Ms2ger@gmail.com> on 2017-08-28
Reviewed by Carlos Garcia Campos.

The test relied on a bug in the HTMLDocument JavaScript bindings: when calling
document.open() with three arguments, it would call any function set as the
"open" property on the window object, rather than just the real Window::open()
method. This bug was fixed by the removal of custom bindings for HTMLDocument
in r218437. As a result, the test no longer called alert(), which caused it to
fail.

Instead, call the window.open() function directly.

  • TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:

(testWebExtensionIsolatedWorld):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r221234 r221240  
     12017-08-28  Ms2ger  <Ms2ger@gmail.com>
     2
     3        Ensure that the alert function is called in TestWebExtensions.
     4        https://bugs.webkit.org/show_bug.cgi?id=175880
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        The test relied on a bug in the HTMLDocument JavaScript bindings: when calling
     9        document.open() with three arguments, it would call any function set as the
     10        "open" property on the window object, rather than just the real Window::open()
     11        method. This bug was fixed by the removal of custom bindings for HTMLDocument
     12        in r218437. As a result, the test no longer called alert(), which caused it to
     13        fail.
     14
     15        Instead, call the window.open() function directly.
     16
     17        * TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
     18        (testWebExtensionIsolatedWorld):
     19
    1202017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp

    r220403 r221240  
    149149        "document.getElementById('console').innerHTML = top.foo;\n"
    150150        "window.open = function () { alert('Main World'); }\n"
    151         "document.open(1, 2, 3);";
     151        "window.open();";
    152152    test->runJavaScriptAndWaitUntilFinished(mainWorldScript, 0);
    153153    g_assert_cmpstr(scriptDialogResult.get(), ==, "Main World");
     
    161161        "document.getElementById('console').innerHTML = top.foo;\n"
    162162        "window.open = function () { alert('Isolated World'); }\n"
    163         "document.open(1, 2, 3);";
     163        "window.open();";
    164164    GUniquePtr<char> extensionBusName(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", Test::s_webExtensionID));
    165165    GRefPtr<GDBusProxy> proxy = adoptGRef(bus->createProxy(extensionBusName.get(),
Note: See TracChangeset for help on using the changeset viewer.