gecko/browser/devtools/webconsole/test/browser_webconsole_consoleonpage.js
Joe Walker 2831a551ce Bug 720641 - Integrate GCLI into developer tools global toolbar; r=dcamp,dão,robcee,zpao
--HG--
rename : browser/devtools/webconsole/test/browser_gcli_break.html => browser/devtools/shared/test/browser_gcli_break.html
rename : browser/devtools/webconsole/test/browser_gcli_commands.js => browser/devtools/shared/test/browser_gcli_commands.js
rename : browser/devtools/webconsole/test/browser_gcli_inspect.html => browser/devtools/shared/test/browser_gcli_inspect.html
rename : browser/devtools/webconsole/test/browser_gcli_inspect.js => browser/devtools/shared/test/browser_gcli_inspect.js
rename : browser/devtools/webconsole/test/browser_gcli_integrate.js => browser/devtools/shared/test/browser_gcli_integrate.js
rename : browser/devtools/webconsole/test/browser_gcli_require.js => browser/devtools/shared/test/browser_gcli_require.js
rename : browser/devtools/webconsole/test/browser_gcli_web.js => browser/devtools/shared/test/browser_gcli_web.js
2012-04-25 10:12:06 +01:00

50 lines
1.3 KiB
JavaScript

/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** BEGIN LICENSE BLOCK *****
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* Contributor(s):
* Julian Viereck <jviereck@mozilla.com>
* Mihai Șucan <mihai.sucan@gmail.com>
*
* ***** END LICENSE BLOCK ***** */
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-own-console.html";
function test()
{
addTab(TEST_URI);
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
testOpenWebConsole();
}, true);
}
function testOpenWebConsole()
{
openConsole();
hud = HUDService.getHudByWindow(content);
ok(hud, "WebConsole was opened");
testOwnConsole();
}
function testConsoleOnPage(console) {
isnot(console, undefined, "Console object defined on page");
is(console.foo, "bar", "Custom console is not overwritten");
}
function testOwnConsole()
{
let console = browser.contentWindow.wrappedJSObject.console;
// Test console on the page. There is already one so it shouldn't be
// overwritten by the WebConsole's console.
testConsoleOnPage(console);
// Check that the console object is set on the jsterm object although there
// is no console object added to the page.
ok(hud.jsterm.console, "JSTerm console is defined");
finishTest();
}