browser/devtools/webconsole/test/browser_webconsole_autocomplete_crossdomain_iframe.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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