2010-10-11 09:57:56 -07:00
|
|
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
// Tests that the page's resources are displayed in the console as they're
|
|
|
|
// loaded
|
|
|
|
|
2012-01-17 06:04:23 -08:00
|
|
|
const TEST_NETWORK_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-network.html" + "?_date=" + Date.now();
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
function test() {
|
2012-03-24 04:34:42 -07:00
|
|
|
addTab("data:text/html;charset=utf-8,Web Console basic network logging test");
|
2010-10-20 10:39:44 -07:00
|
|
|
browser.addEventListener("load", onLoad, true);
|
2010-10-11 09:57:56 -07:00
|
|
|
}
|
|
|
|
|
2010-10-20 10:39:44 -07:00
|
|
|
function onLoad(aEvent) {
|
|
|
|
browser.removeEventListener(aEvent.type, arguments.callee, true);
|
2010-10-11 09:57:56 -07:00
|
|
|
openConsole();
|
2010-10-20 10:39:44 -07:00
|
|
|
|
|
|
|
browser.addEventListener("load", testBasicNetLogging, true);
|
|
|
|
content.location = TEST_NETWORK_URI;
|
2010-10-11 09:57:56 -07:00
|
|
|
}
|
|
|
|
|
2010-10-20 10:39:44 -07:00
|
|
|
function testBasicNetLogging(aEvent) {
|
|
|
|
browser.removeEventListener(aEvent.type, arguments.callee, true);
|
|
|
|
|
2011-07-07 04:06:06 -07:00
|
|
|
outputNode = HUDService.getHudByWindow(content).outputNode;
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2010-10-20 10:39:44 -07:00
|
|
|
executeSoon(function() {
|
2011-01-24 08:05:05 -08:00
|
|
|
findLogEntry("test-network.html");
|
|
|
|
findLogEntry("testscript.js");
|
|
|
|
findLogEntry("test-image.png");
|
|
|
|
findLogEntry("network console");
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
finishTest();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|