Skip to content

Commit c01d495

Browse files
committed
Bug 1404382 - [devtools] Re-enable browser_webconsole_file_uri.js. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D240822
1 parent 060c1cd commit c01d495

File tree

2 files changed

+44
-52
lines changed

2 files changed

+44
-52
lines changed

devtools/client/webconsole/test/browser/_webconsole.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ skip-if = [
436436
["browser_webconsole_external_script_errors.js"]
437437

438438
["browser_webconsole_file_uri.js"]
439-
skip-if = ["true"] # Bug 1404382
440439

441440
["browser_webconsole_filter_buttons_overflow.js"]
442441

devtools/client/webconsole/test/browser/browser_webconsole_file_uri.js

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,75 +3,68 @@
33

44
"use strict";
55

6-
// XXX Remove this when the file is migrated to the new frontend.
7-
/* eslint-disable no-undef */
8-
96
// See Bug 595223.
107

11-
const PREF = "devtools.webconsole.persistlog";
128
const TEST_FILE = "test-network.html";
139

1410
var hud;
1511

1612
add_task(async function () {
17-
Services.prefs.setBoolPref(PREF, true);
13+
// Display network requests
14+
await pushPref("devtools.webconsole.filter.net", true);
15+
16+
await addTab("about:blank");
17+
hud = await openConsole();
18+
await clearOutput(hud);
1819

1920
const jar = getJar(getRootDirectory(gTestPath));
2021
const dir = jar
2122
? extractJarToTmp(jar)
2223
: getChromeDir(getResolvedURI(gTestPath));
23-
2424
dir.append(TEST_FILE);
2525
const uri = Services.io.newFileURI(dir);
2626

27-
// Open tab with correct remote type so we don't switch processes when we load
28-
// the file:// URI, otherwise we won't get the same web console.
29-
const remoteType = E10SUtils.getRemoteTypeForURI(
30-
uri.spec,
31-
gMultiProcessBrowser,
32-
gFissionBrowser
27+
const onConsoleMessage = waitForMessageByType(
28+
hud,
29+
"running network console logging tests",
30+
".console-api"
31+
);
32+
const onHTMLFileMessage = waitForMessageByType(
33+
hud,
34+
"test-network.html",
35+
".network"
36+
);
37+
const onImageFileMessage = waitForMessageByType(
38+
hud,
39+
"test-image.png",
40+
".network"
41+
);
42+
const onJSFileMessage = waitForMessageByType(
43+
hud,
44+
"testscript.js?foo",
45+
".network"
3346
);
34-
await loadTab("about:blank", remoteType);
3547

36-
hud = await openConsole();
37-
await clearOutput(hud);
48+
navigateTo(uri.spec);
3849

39-
await navigateTo(uri.spec);
50+
await onConsoleMessage;
51+
ok(true, "console message is displayed");
4052

41-
await testMessages();
53+
let message = await onHTMLFileMessage;
54+
ok(
55+
message.node.querySelector(".url").innerText.startsWith("file://"),
56+
"HTML file request is displayed"
57+
);
4258

43-
Services.prefs.clearUserPref(PREF);
44-
hud = null;
45-
});
59+
message = await onImageFileMessage;
60+
ok(
61+
message.node.querySelector(".url").innerText.startsWith("file://"),
62+
"image file request is displayed"
63+
);
4664

47-
function testMessages() {
48-
return waitForMessagesByType({
49-
webconsole: hud,
50-
messages: [
51-
{
52-
text: "running network console logging tests",
53-
typeSelector: ".console-api",
54-
category: CATEGORY_WEBDEV,
55-
severity: SEVERITY_LOG,
56-
},
57-
{
58-
text: "test-network.html",
59-
typeSelector: ".network",
60-
category: CATEGORY_NETWORK,
61-
severity: SEVERITY_LOG,
62-
},
63-
{
64-
text: "test-image.png",
65-
typeSelector: ".network",
66-
category: CATEGORY_NETWORK,
67-
severity: SEVERITY_LOG,
68-
},
69-
{
70-
text: "testscript.js",
71-
typeSelector: ".network",
72-
category: CATEGORY_NETWORK,
73-
severity: SEVERITY_LOG,
74-
},
75-
],
76-
});
77-
}
65+
message = await onJSFileMessage;
66+
ok(
67+
message.node.querySelector(".url").innerText.startsWith("file://"),
68+
"JS file request is displayed"
69+
);
70+
});

0 commit comments

Comments
 (0)