browser/devtools/webconsole/test/browser_webconsole_output_dom_elements_01.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 /*
     2  * Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/publicdomain/zero/1.0/
     4  */
     6 // Test the webconsole output for various types of DOM Nodes.
     8 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-dom-elements.html";
    10 let inputTests = [
    11   {
    12     input: "testBodyNode()",
    13     output: '<body id="body-id" class="body-class">',
    14     printOutput: "[object HTMLBodyElement]",
    15     inspectable: true,
    16     noClick: true,
    17     inspectorIcon: true
    18   },
    20   {
    21     input: "testDocumentElement()",
    22     output: '<html lang="en-US" dir="ltr">',
    23     printOutput: "[object HTMLHtmlElement]",
    24     inspectable: true,
    25     noClick: true,
    26     inspectorIcon: true
    27   },
    29   {
    30     input: "testDocument()",
    31     output: 'HTMLDocument \u2192 ' + TEST_URI,
    32     printOutput: "[object HTMLDocument]",
    33     inspectable: true,
    34     noClick: true,
    35     inspectorIcon: false
    36   },
    38   {
    39     input: "testNode()",
    40     output: '<p some-attribute="some-value">',
    41     printOutput: "[object HTMLParagraphElement]",
    42     inspectable: true,
    43     noClick: true,
    44     inspectorIcon: true
    45   },
    47   {
    48     input: "testNodeList()",
    49     output: 'NodeList [ <html>, <head>, <meta>, <title>, <body#body-id.body-class>, <p>, <iframe>, <div.some.classname.here.with.more.classnames.here>, <script> ]',
    50     printOutput: "[object NodeList]",
    51     inspectable: true,
    52     noClick: true,
    53     inspectorIcon: true
    54   },
    56   {
    57     input: "testNodeInIframe()",
    58     output: '<p>',
    59     printOutput: "[object HTMLParagraphElement]",
    60     inspectable: true,
    61     noClick: true,
    62     inspectorIcon: true
    63   },
    65   {
    66     input: "testDocumentFragment()",
    67     output: 'DocumentFragment [ <span.foo>, <div#fragdiv> ]',
    68     printOutput: "[object DocumentFragment]",
    69     inspectable: true,
    70     noClick: true,
    71     inspectorIcon: false
    72   },
    74   {
    75     input: "testNodeInDocumentFragment()",
    76     output: '<span class="foo" data-lolz="hehe">',
    77     printOutput: "[object HTMLSpanElement]",
    78     inspectable: true,
    79     noClick: true,
    80     inspectorIcon: false
    81   },
    83   {
    84     input: "testUnattachedNode()",
    85     output: '<p class="such-class" data-data="such-data">',
    86     printOutput: "[object HTMLParagraphElement]",
    87     inspectable: true,
    88     noClick: true,
    89     inspectorIcon: false
    90   }
    91 ];
    93 function test() {
    94   Task.spawn(function*() {
    95     let {tab} = yield loadTab(TEST_URI);
    96     let hud = yield openConsole(tab);
    97     yield checkOutputForInputs(hud, inputTests);
    98   }).then(finishTest);
    99 }

mercurial