Bug 979628 - Fix for intermittent browser_webconsole_output_01.js | This test exceeded the timeout threshold; r=me

This commit is contained in:
Mihai Sucan 2014-03-11 13:32:33 +02:00
parent 99003657a9
commit fecf79feba
3 changed files with 90 additions and 72 deletions

View File

@ -267,6 +267,7 @@ run-if = os == "mac"
[browser_webconsole_output_02.js]
[browser_webconsole_output_03.js]
[browser_webconsole_output_04.js]
[browser_webconsole_output_05.js]
[browser_webconsole_output_dom_elements_01.js]
[browser_webconsole_output_dom_elements_02.js]
[browser_webconsole_output_dom_elements_03.js]

View File

@ -7,7 +7,6 @@
const TEST_URI = "data:text/html;charset=utf8,test for console output - 01";
let dateNow = Date.now();
let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
let LONG_STRING_LENGTH = DebuggerServer.LONG_STRING_LENGTH;
@ -76,70 +75,6 @@ let inputTests = [
output: "/foobar/",
inspectable: true,
},
// 9
{
input: "/foo?b*\\s\"ar/igym",
output: "/foo?b*\\s\"ar/gimy",
printOutput: "/foo?b*\\s\"ar/gimy",
inspectable: true,
},
// 10
{
input: "null",
output: "null",
},
// 11
{
input: "undefined",
output: "undefined",
},
// 12
{
input: "true",
output: "true",
},
// 13
{
input: "new Boolean(false)",
output: "false",
inspectable: true,
},
// 14
{
input: "new Date(" + dateNow + ")",
output: "Date " + (new Date(dateNow)).toISOString(),
printOutput: (new Date(dateNow)).toString(),
inspectable: true,
},
// 15
{
input: "new Date('test')",
output: "Invalid Date",
printOutput: "Invalid Date",
inspectable: true,
variablesViewLabel: "Invalid Date",
},
// 16
{
input: "new Number(43)",
output: "43",
inspectable: true,
},
// 17
{
input: "new String('hello world')",
output: '"hello world"',
inspectable: true,
},
];
longString = initialString = null;
@ -150,11 +85,9 @@ function test() {
DebuggerServer.LONG_STRING_INITIAL_LENGTH = LONG_STRING_INITIAL_LENGTH;
});
addTab(TEST_URI);
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
openConsole().then((hud) => {
return checkOutputForInputs(hud, inputTests);
}).then(finishTest);
}, true);
Task.spawn(function*() {
let {tab} = yield loadTab(TEST_URI);
let hud = yield openConsole(tab);
return checkOutputForInputs(hud, inputTests);
}).then(finishTest);
}

View File

@ -0,0 +1,84 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Test the webconsole output for various types of objects.
const TEST_URI = "data:text/html;charset=utf8,test for console output - 05";
let dateNow = Date.now();
let inputTests = [
// 0
{
input: "/foo?b*\\s\"ar/igym",
output: "/foo?b*\\s\"ar/gimy",
printOutput: "/foo?b*\\s\"ar/gimy",
inspectable: true,
},
// 1
{
input: "null",
output: "null",
},
// 2
{
input: "undefined",
output: "undefined",
},
// 3
{
input: "true",
output: "true",
},
// 4
{
input: "new Boolean(false)",
output: "false",
inspectable: true,
},
// 5
{
input: "new Date(" + dateNow + ")",
output: "Date " + (new Date(dateNow)).toISOString(),
printOutput: (new Date(dateNow)).toString(),
inspectable: true,
},
// 6
{
input: "new Date('test')",
output: "Invalid Date",
printOutput: "Invalid Date",
inspectable: true,
variablesViewLabel: "Invalid Date",
},
// 7
{
input: "new Number(43)",
output: "43",
inspectable: true,
},
// 8
{
input: "new String('hello world')",
output: '"hello world"',
inspectable: true,
},
];
function test() {
Task.spawn(function*() {
let {tab} = yield loadTab(TEST_URI);
let hud = yield openConsole(tab);
return checkOutputForInputs(hud, inputTests);
}).then(finishTest);
}