browser/devtools/inspector/test/browser_inspector_bug_665880.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 function test() {
     5   waitForExplicitFinish();
     6   ignoreAllUncaughtExceptions();
     8   let doc;
     9   let objectNode;
    11   gBrowser.selectedTab = gBrowser.addTab();
    12   gBrowser.selectedBrowser.addEventListener("load", function() {
    13     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    14     doc = content.document;
    15     waitForFocus(setupObjectInspectionTest, content);
    16   }, true);
    18   content.location = "data:text/html,<object style='padding: 100px'><p>foobar</p></object>";
    20   function setupObjectInspectionTest() {
    21     objectNode = doc.querySelector("object");
    22     ok(objectNode, "we have the object node");
    23     openInspector(runObjectInspectionTest);
    24   }
    26   function runObjectInspectionTest(inspector) {
    27     inspector.once("inspector-updated", performTestComparison);
    28     inspector.selection.setNode(objectNode, "");
    29   }
    31   function performTestComparison() {
    32     is(getActiveInspector().selection.node, objectNode, "selection matches node");
    33     let target = TargetFactory.forTab(gBrowser.selectedTab);
    34     executeSoon(function() {
    35       gDevTools.closeToolbox(target);
    36       finishUp();
    37     });
    38   }
    40   function finishUp() {
    41     doc = objectNode = null;
    42     gBrowser.removeCurrentTab();
    43     finish();
    44   }
    45 }

mercurial