browser/devtools/webconsole/test/browser_webconsole_autocomplete_crossdomain_iframe.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 // Test that autocomplete doesn't break when trying to reach into objects from
     5 // a different domain, bug 989025.
     7 function test() {
     8   let hud;
    10   const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-989025-iframe-parent.html";
    12   Task.spawn(function*() {
    13     const {tab} = yield loadTab(TEST_URI);
    14     hud = yield openConsole(tab);
    16     hud.jsterm.execute('document.title');
    18     yield waitForMessages({
    19       webconsole: hud,
    20       messages: [{
    21         text: "989025 - iframe parent",
    22         category: CATEGORY_OUTPUT,
    23       }],
    24     });
    26     let autocompleteUpdated = hud.jsterm.once("autocomplete-updated");
    28     hud.jsterm.setInputValue("window[0].document");
    29     executeSoon(() => {
    30       EventUtils.synthesizeKey(".", {});
    31     });
    33     yield autocompleteUpdated;
    35     hud.jsterm.setInputValue("window[0].document.title");
    36     EventUtils.synthesizeKey("VK_RETURN", {});
    38     yield waitForMessages({
    39       webconsole: hud,
    40       messages: [{
    41         text: "Permission denied",
    42         category: CATEGORY_OUTPUT,
    43         severity: SEVERITY_ERROR,
    44       }],
    45     });
    47     hud.jsterm.execute("window.location");
    49     yield waitForMessages({
    50       webconsole: hud,
    51       messages: [{
    52         text: "test-bug-989025-iframe-parent.html",
    53         category: CATEGORY_OUTPUT,
    54       }],
    55     });
    57     yield closeConsole(tab);
    58   }).then(finishTest);
    59 }

mercurial