browser/devtools/styleeditor/test/browser_styleeditor_loading.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 + "longload.html";
     8 function test()
     9 {
    10   waitForExplicitFinish();
    12   // launch Style Editor right when the tab is created (before load)
    13   // this checks that the Style Editor still launches correctly when it is opened
    14   // *while* the page is still loading. The Style Editor should not signal that
    15   // it is loaded until the accompanying content page is loaded.
    17   addTabAndCheckOnStyleEditorAdded(function(panel) {
    18     content.location = TESTCASE_URI;
    19   }, testEditorAdded);
    20 }
    22 function testEditorAdded(event, editor)
    23 {
    24   let root = gPanelWindow.document.querySelector(".splitview-root");
    25   ok(!root.classList.contains("loading"),
    26      "style editor root element does not have 'loading' class name anymore");
    28   let button = gPanelWindow.document.querySelector(".style-editor-newButton");
    29   ok(!button.hasAttribute("disabled"),
    30      "new style sheet button is enabled");
    32   button = gPanelWindow.document.querySelector(".style-editor-importButton");
    33   ok(!button.hasAttribute("disabled"),
    34      "import button is enabled");
    36   finish();
    37 }

mercurial