michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if cyrillic text is rendered correctly in the source editor. michael@0: */ michael@0: michael@0: function test() { michael@0: initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => { michael@0: info("Starting test... "); michael@0: michael@0: let { document, Editor, NetMonitorView } = aMonitor.panelWin; michael@0: let { RequestsMenu } = NetMonitorView; michael@0: michael@0: RequestsMenu.lazyUpdate = false; michael@0: michael@0: waitForNetworkEvents(aMonitor, 1).then(() => { michael@0: verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0), michael@0: "GET", CONTENT_TYPE_SJS + "?fmt=txt", { michael@0: status: 200, michael@0: statusText: "DA DA DA" michael@0: }); michael@0: michael@0: EventUtils.sendMouseEvent({ type: "mousedown" }, michael@0: document.getElementById("details-pane-toggle")); michael@0: EventUtils.sendMouseEvent({ type: "mousedown" }, michael@0: document.querySelectorAll("#details-pane tab")[3]); michael@0: michael@0: let RESPONSE_BODY_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED; michael@0: waitFor(aMonitor.panelWin, RESPONSE_BODY_DISPLAYED).then(() => michael@0: NetMonitorView.editor("#response-content-textarea") michael@0: ).then((aEditor) => { michael@0: is(aEditor.getText().indexOf("\u044F"), 26, // я michael@0: "The text shown in the source editor is incorrect."); michael@0: is(aEditor.getMode(), Editor.modes.text, michael@0: "The mode active in the source editor is incorrect."); michael@0: michael@0: teardown(aMonitor).then(finish); michael@0: }); michael@0: }); michael@0: michael@0: aDebuggee.performRequests(); michael@0: }); michael@0: }