michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const TEST_FILE = "test-network.html"; michael@0: michael@0: function tabReload(aEvent) { michael@0: browser.removeEventListener(aEvent.type, tabReload, true); michael@0: michael@0: waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "running network console logging tests", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: }, michael@0: { michael@0: text: "test-network.html", michael@0: category: CATEGORY_NETWORK, michael@0: severity: SEVERITY_LOG, michael@0: }, michael@0: { michael@0: text: "test-image.png", michael@0: category: CATEGORY_NETWORK, michael@0: severity: SEVERITY_LOG, michael@0: }, michael@0: { michael@0: text: "testscript.js", michael@0: category: CATEGORY_NETWORK, michael@0: severity: SEVERITY_LOG, michael@0: }], michael@0: }).then(finishTest); michael@0: } michael@0: michael@0: function test() { michael@0: let jar = getJar(getRootDirectory(gTestPath)); michael@0: let dir = jar ? michael@0: extractJarToTmp(jar) : michael@0: getChromeDir(getResolvedURI(gTestPath)); michael@0: dir.append(TEST_FILE); michael@0: michael@0: let uri = Services.io.newFileURI(dir); michael@0: michael@0: const PREF = "devtools.webconsole.persistlog"; michael@0: Services.prefs.setBoolPref(PREF, true); michael@0: registerCleanupFunction(() => Services.prefs.clearUserPref(PREF)); michael@0: michael@0: addTab("data:text/html;charset=utf8,

test file URI"); michael@0: browser.addEventListener("load", function tabLoad() { michael@0: browser.removeEventListener("load", tabLoad, true); michael@0: openConsole(null, function(aHud) { michael@0: hud = aHud; michael@0: hud.jsterm.clearOutput(); michael@0: browser.addEventListener("load", tabReload, true); michael@0: content.location = uri.spec; michael@0: }); michael@0: }, true); michael@0: }