browser/devtools/styleeditor/test/browser_styleeditor_selectstylesheet.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 /* vim: set ts=2 et sw=2 tw=80: */
     2 /* Any copyright is dedicated to the Public Domain.
     3    http://creativecommons.org/publicdomain/zero/1.0/ */
     5 const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html";
     6 const NEW_URI = TEST_BASE_HTTPS + "media.html";
     8 const LINE_NO = 5;
     9 const COL_NO  = 0;
    11 let gContentWin;
    12 let gUI;
    14 function test()
    15 {
    16   waitForExplicitFinish();
    18   addTabAndOpenStyleEditors(2, function(panel) {
    19     gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
    20     gUI = panel.UI;
    21     gUI.editors[0].getSourceEditor().then(runTests);
    22   });
    24   content.location = TESTCASE_URI;
    25 }
    27 function runTests()
    28 {
    29   let count = 0;
    31   // Make sure Editor doesn't go into an infinite loop when
    32   // column isn't passed. See bug 941018.
    33   gUI.once("editor-selected", (event, editor) => {
    34     editor.getSourceEditor().then(() => {
    35       is(gUI.selectedEditor, gUI.editors[1], "second editor is selected");
    36       let {line, ch} = gUI.selectedEditor.sourceEditor.getCursor();
    38       is(line, LINE_NO, "correct line selected");
    39       is(ch, COL_NO, "correct column selected");
    41       gUI = null;
    42       finish();
    43     });
    44   });
    46   gUI.selectStyleSheet(gUI.editors[1].styleSheet.href, LINE_NO);
    47 }

mercurial