1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/netmonitor/test/browser_net_cyrillic-01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Tests if cyrillic text is rendered correctly in the source editor. 1.9 + */ 1.10 + 1.11 +function test() { 1.12 + initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => { 1.13 + info("Starting test... "); 1.14 + 1.15 + let { document, Editor, NetMonitorView } = aMonitor.panelWin; 1.16 + let { RequestsMenu } = NetMonitorView; 1.17 + 1.18 + RequestsMenu.lazyUpdate = false; 1.19 + 1.20 + waitForNetworkEvents(aMonitor, 1).then(() => { 1.21 + verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0), 1.22 + "GET", CONTENT_TYPE_SJS + "?fmt=txt", { 1.23 + status: 200, 1.24 + statusText: "DA DA DA" 1.25 + }); 1.26 + 1.27 + EventUtils.sendMouseEvent({ type: "mousedown" }, 1.28 + document.getElementById("details-pane-toggle")); 1.29 + EventUtils.sendMouseEvent({ type: "mousedown" }, 1.30 + document.querySelectorAll("#details-pane tab")[3]); 1.31 + 1.32 + let RESPONSE_BODY_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED; 1.33 + waitFor(aMonitor.panelWin, RESPONSE_BODY_DISPLAYED).then(() => 1.34 + NetMonitorView.editor("#response-content-textarea") 1.35 + ).then((aEditor) => { 1.36 + is(aEditor.getText().indexOf("\u044F"), 26, // я 1.37 + "The text shown in the source editor is incorrect."); 1.38 + is(aEditor.getMode(), Editor.modes.text, 1.39 + "The mode active in the source editor is incorrect."); 1.40 + 1.41 + teardown(aMonitor).then(finish); 1.42 + }); 1.43 + }); 1.44 + 1.45 + aDebuggee.performRequests(); 1.46 + }); 1.47 +}