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) {
|
2012-06-02 03:45:32 -07:00
|
|
|
browser.removeEventListener(aEvent.type, onLoad, true);
|
|
|
|
openConsole(null, function() {
|
|
|
|
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) {
|
2012-06-02 03:45:32 -07:00
|
|
|
browser.removeEventListener(aEvent.type, testBasicNetLogging, true);
|
2010-10-20 10:39:44 -07:00
|
|
|
|
2011-07-07 04:06:06 -07:00
|
|
|
outputNode = HUDService.getHudByWindow(content).outputNode;
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-06-02 03:45:32 -07:00
|
|
|
waitForSuccess({
|
|
|
|
name: "network console message",
|
|
|
|
validatorFn: function()
|
|
|
|
{
|
|
|
|
return outputNode.textContent.indexOf("running network console") > -1;
|
|
|
|
},
|
|
|
|
successFn: function()
|
|
|
|
{
|
|
|
|
findLogEntry("test-network.html");
|
|
|
|
findLogEntry("testscript.js");
|
|
|
|
findLogEntry("test-image.png");
|
|
|
|
finishTest();
|
|
|
|
},
|
|
|
|
failureFn: finishTest,
|
2010-10-11 09:57:56 -07:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|