browser/devtools/webconsole/test/browser_webconsole_output_05.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 objects.
     8 const TEST_URI = "data:text/html;charset=utf8,test for console output - 05";
    10 let dateNow = Date.now();
    12 let inputTests = [
    13   // 0
    14   {
    15     input: "/foo?b*\\s\"ar/igym",
    16     output: "/foo?b*\\s\"ar/gimy",
    17     printOutput: "/foo?b*\\s\"ar/gimy",
    18     inspectable: true,
    19   },
    21   // 1
    22   {
    23     input: "null",
    24     output: "null",
    25   },
    27   // 2
    28   {
    29     input: "undefined",
    30     output: "undefined",
    31   },
    33   // 3
    34   {
    35     input: "true",
    36     output: "true",
    37   },
    39   // 4
    40   {
    41     input: "new Boolean(false)",
    42     output: "false",
    43     inspectable: true,
    44   },
    46   // 5
    47   {
    48     input: "new Date(" + dateNow + ")",
    49     output: "Date " + (new Date(dateNow)).toISOString(),
    50     printOutput: (new Date(dateNow)).toString(),
    51     inspectable: true,
    52   },
    54   // 6
    55   {
    56     input: "new Date('test')",
    57     output: "Invalid Date",
    58     printOutput: "Invalid Date",
    59     inspectable: true,
    60     variablesViewLabel: "Invalid Date",
    61   },
    63   // 7
    64   {
    65     input: "new Number(43)",
    66     output: "43",
    67     inspectable: true,
    68   },
    70   // 8
    71   {
    72     input: "new String('hello world')",
    73     output: '"hello world"',
    74     inspectable: true,
    75   },
    76 ];
    78 function test() {
    79   Task.spawn(function*() {
    80     let {tab} = yield loadTab(TEST_URI);
    81     let hud = yield openConsole(tab);
    82     return checkOutputForInputs(hud, inputTests);
    83   }).then(finishUp);
    84 }
    86 function finishUp() {
    87   inputTests = null;
    88   finishTest();
    89 }

mercurial