1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webconsole/test/browser_webconsole_basic_net_logging.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* vim:set ts=2 sw=2 sts=2 et: */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +// Tests that the page's resources are displayed in the console as they're 1.10 +// loaded 1.11 + 1.12 +const TEST_NETWORK_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-network.html" + "?_date=" + Date.now(); 1.13 + 1.14 +function test() { 1.15 + addTab("data:text/html;charset=utf-8,Web Console basic network logging test"); 1.16 + browser.addEventListener("load", onLoad, true); 1.17 + 1.18 + function onLoad() { 1.19 + browser.removeEventListener("load", onLoad, true); 1.20 + openConsole(null, function(hud) { 1.21 + content.location = TEST_NETWORK_URI; 1.22 + waitForMessages({ 1.23 + webconsole: hud, 1.24 + messages: [{ 1.25 + text: "running network console", 1.26 + category: CATEGORY_WEBDEV, 1.27 + severity: SEVERITY_LOG, 1.28 + }, 1.29 + { 1.30 + text: "test-network.html", 1.31 + category: CATEGORY_NETWORK, 1.32 + severity: SEVERITY_LOG, 1.33 + }, 1.34 + { 1.35 + text: "testscript.js", 1.36 + category: CATEGORY_NETWORK, 1.37 + severity: SEVERITY_LOG, 1.38 + }, 1.39 + { 1.40 + text: "test-image.png", 1.41 + category: CATEGORY_NETWORK, 1.42 + severity: SEVERITY_LOG, 1.43 + }], 1.44 + }).then(finishTest); 1.45 + }); 1.46 + } 1.47 +}