summaryrefslogtreecommitdiff
path: root/browser/devtools/netmonitor/test/browser_net_cyrillic-02.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/devtools/netmonitor/test/browser_net_cyrillic-02.js')
-rw-r--r--browser/devtools/netmonitor/test/browser_net_cyrillic-02.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/browser/devtools/netmonitor/test/browser_net_cyrillic-02.js b/browser/devtools/netmonitor/test/browser_net_cyrillic-02.js
new file mode 100644
index 000000000..d47d8e4af
--- /dev/null
+++ b/browser/devtools/netmonitor/test/browser_net_cyrillic-02.js
@@ -0,0 +1,42 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests if cyrillic text is rendered correctly in the source editor
+ * when loaded directly from an HTML page.
+ */
+
+function test() {
+ initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => {
+ info("Starting test... ");
+
+ let { document, SourceEditor, NetMonitorView } = aMonitor.panelWin;
+ let { RequestsMenu } = NetMonitorView;
+
+ RequestsMenu.lazyUpdate = false;
+
+ waitForNetworkEvents(aMonitor, 1).then(() => {
+ verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0),
+ "GET", CYRILLIC_URL, {
+ status: 200,
+ statusText: "OK"
+ });
+
+ EventUtils.sendMouseEvent({ type: "mousedown" },
+ document.getElementById("details-pane-toggle"));
+ EventUtils.sendMouseEvent({ type: "mousedown" },
+ document.querySelectorAll("#details-pane tab")[3]);
+
+ NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
+ is(aEditor.getText().indexOf("\u044F"), 189, // я
+ "The text shown in the source editor is incorrect.");
+ is(aEditor.getMode(), SourceEditor.MODES.HTML,
+ "The mode active in the source editor is incorrect.");
+
+ teardown(aMonitor).then(finish);
+ });
+ });
+
+ aDebuggee.location.reload();
+ });
+}