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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:d9baf9d664f7
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 */
7
8 function test() {
9 initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => {
10 info("Starting test... ");
11
12 let { document, Editor, NetMonitorView } = aMonitor.panelWin;
13 let { RequestsMenu } = NetMonitorView;
14
15 RequestsMenu.lazyUpdate = false;
16
17 waitForNetworkEvents(aMonitor, 1).then(() => {
18 verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0),
19 "GET", CONTENT_TYPE_SJS + "?fmt=txt", {
20 status: 200,
21 statusText: "DA DA DA"
22 });
23
24 EventUtils.sendMouseEvent({ type: "mousedown" },
25 document.getElementById("details-pane-toggle"));
26 EventUtils.sendMouseEvent({ type: "mousedown" },
27 document.querySelectorAll("#details-pane tab")[3]);
28
29 let RESPONSE_BODY_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED;
30 waitFor(aMonitor.panelWin, RESPONSE_BODY_DISPLAYED).then(() =>
31 NetMonitorView.editor("#response-content-textarea")
32 ).then((aEditor) => {
33 is(aEditor.getText().indexOf("\u044F"), 26, // я
34 "The text shown in the source editor is incorrect.");
35 is(aEditor.getMode(), Editor.modes.text,
36 "The mode active in the source editor is incorrect.");
37
38 teardown(aMonitor).then(finish);
39 });
40 });
41
42 aDebuggee.performRequests();
43 });
44 }

mercurial