browser/devtools/netmonitor/test/browser_net_cyrillic-02.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:6fe9024f0cc7
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Tests if cyrillic text is rendered correctly in the source editor
6 * when loaded directly from an HTML page.
7 */
8
9 function test() {
10 initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => {
11 info("Starting test... ");
12
13 let { document, Editor, NetMonitorView } = aMonitor.panelWin;
14 let { RequestsMenu } = NetMonitorView;
15
16 RequestsMenu.lazyUpdate = false;
17
18 waitForNetworkEvents(aMonitor, 1).then(() => {
19 verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0),
20 "GET", CYRILLIC_URL, {
21 status: 200,
22 statusText: "OK"
23 });
24
25 EventUtils.sendMouseEvent({ type: "mousedown" },
26 document.getElementById("details-pane-toggle"));
27 EventUtils.sendMouseEvent({ type: "mousedown" },
28 document.querySelectorAll("#details-pane tab")[3]);
29
30 let RESPONSE_BODY_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED;
31 waitFor(aMonitor.panelWin, RESPONSE_BODY_DISPLAYED).then(() =>
32 NetMonitorView.editor("#response-content-textarea")
33 ).then((aEditor) => {
34 is(aEditor.getText().indexOf("\u044F"), 302, // я
35 "The text shown in the source editor is incorrect.");
36 is(aEditor.getMode(), Editor.modes.html,
37 "The mode active in the source editor is incorrect.");
38
39 teardown(aMonitor).then(finish);
40 });
41 });
42
43 aDebuggee.location.reload();
44 });
45 }

mercurial