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

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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  * when loaded directly from an HTML page.
     7  */
     9 function test() {
    10   initNetMonitor(CYRILLIC_URL).then(([aTab, aDebuggee, aMonitor]) => {
    11     info("Starting test... ");
    13     let { document, Editor, NetMonitorView } = aMonitor.panelWin;
    14     let { RequestsMenu } = NetMonitorView;
    16     RequestsMenu.lazyUpdate = false;
    18     waitForNetworkEvents(aMonitor, 1).then(() => {
    19       verifyRequestItemTarget(RequestsMenu.getItemAtIndex(0),
    20         "GET", CYRILLIC_URL, {
    21           status: 200,
    22           statusText: "OK"
    23         });
    25       EventUtils.sendMouseEvent({ type: "mousedown" },
    26         document.getElementById("details-pane-toggle"));
    27       EventUtils.sendMouseEvent({ type: "mousedown" },
    28         document.querySelectorAll("#details-pane tab")[3]);
    30       let RESPONSE_BODY_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED;
    31       waitFor(aMonitor.panelWin, RESPONSE_BODY_DISPLAYED).then(() =>
    32         NetMonitorView.editor("#response-content-textarea")
    33       ).then((aEditor) => {
    34         is(aEditor.getText().indexOf("\u044F"), 302, // я
    35           "The text shown in the source editor is incorrect.");
    36         is(aEditor.getMode(), Editor.modes.html,
    37           "The mode active in the source editor is incorrect.");
    39         teardown(aMonitor).then(finish);
    40       });
    41     });
    43     aDebuggee.location.reload();
    44   });
    45 }

mercurial