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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Tests if cyrillic text is rendered correctly in the source editor.
     6  */
     8 function test() {
     9   initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => {
    10     info("Starting test... ");
    12     let { document, Editor, NetMonitorView } = aMonitor.panelWin;
    13     let { RequestsMenu } = NetMonitorView;
    15     RequestsMenu.lazyUpdate = false;
    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         });
    24       EventUtils.sendMouseEvent({ type: "mousedown" },
    25         document.getElementById("details-pane-toggle"));
    26       EventUtils.sendMouseEvent({ type: "mousedown" },
    27         document.querySelectorAll("#details-pane tab")[3]);
    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.");
    38         teardown(aMonitor).then(finish);
    39       });
    40     });
    42     aDebuggee.performRequests();
    43   });
    44 }

mercurial