browser/devtools/styleeditor/test/browser_styleeditor_nostyle.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/styleeditor/test/browser_styleeditor_nostyle.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +/* vim: set ts=2 et sw=2 tw=80: */
     1.5 +/* Any copyright is dedicated to the Public Domain.
     1.6 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.7 +
     1.8 +const TESTCASE_URI = TEST_BASE + "nostyle.html";
     1.9 +
    1.10 +
    1.11 +function test()
    1.12 +{
    1.13 +  waitForExplicitFinish();
    1.14 +
    1.15 +  // launch Style Editor right when the tab is created (before load)
    1.16 +  // this checks that the Style Editor still launches correctly when it is opened
    1.17 +  // *while* the page is still loading. The Style Editor should not signal that
    1.18 +  // it is loaded until the accompanying content page is loaded.
    1.19 +
    1.20 +  addTabAndCheckOnStyleEditorAdded(function(panel) {
    1.21 +    panel.UI.once("stylesheets-reset", testDocumentLoad);
    1.22 +
    1.23 +    content.location = TESTCASE_URI;
    1.24 +  }, () => {});
    1.25 +}
    1.26 +
    1.27 +function testDocumentLoad(event)
    1.28 +{
    1.29 +  let root = gPanelWindow.document.querySelector(".splitview-root");
    1.30 +  ok(!root.classList.contains("loading"),
    1.31 +     "style editor root element does not have 'loading' class name anymore");
    1.32 +
    1.33 +  ok(root.querySelector(".empty.placeholder"), "showing 'no style' indicator");
    1.34 +
    1.35 +  let button = gPanelWindow.document.querySelector(".style-editor-newButton");
    1.36 +  ok(!button.hasAttribute("disabled"),
    1.37 +     "new style sheet button is enabled");
    1.38 +
    1.39 +  button = gPanelWindow.document.querySelector(".style-editor-importButton");
    1.40 +  ok(!button.hasAttribute("disabled"),
    1.41 +     "import button is enabled");
    1.42 +
    1.43 +  finish();
    1.44 +}

mercurial