browser/devtools/styleeditor/test/browser_styleeditor_nostyle.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.

michael@0 1 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 const TESTCASE_URI = TEST_BASE + "nostyle.html";
michael@0 6
michael@0 7
michael@0 8 function test()
michael@0 9 {
michael@0 10 waitForExplicitFinish();
michael@0 11
michael@0 12 // launch Style Editor right when the tab is created (before load)
michael@0 13 // this checks that the Style Editor still launches correctly when it is opened
michael@0 14 // *while* the page is still loading. The Style Editor should not signal that
michael@0 15 // it is loaded until the accompanying content page is loaded.
michael@0 16
michael@0 17 addTabAndCheckOnStyleEditorAdded(function(panel) {
michael@0 18 panel.UI.once("stylesheets-reset", testDocumentLoad);
michael@0 19
michael@0 20 content.location = TESTCASE_URI;
michael@0 21 }, () => {});
michael@0 22 }
michael@0 23
michael@0 24 function testDocumentLoad(event)
michael@0 25 {
michael@0 26 let root = gPanelWindow.document.querySelector(".splitview-root");
michael@0 27 ok(!root.classList.contains("loading"),
michael@0 28 "style editor root element does not have 'loading' class name anymore");
michael@0 29
michael@0 30 ok(root.querySelector(".empty.placeholder"), "showing 'no style' indicator");
michael@0 31
michael@0 32 let button = gPanelWindow.document.querySelector(".style-editor-newButton");
michael@0 33 ok(!button.hasAttribute("disabled"),
michael@0 34 "new style sheet button is enabled");
michael@0 35
michael@0 36 button = gPanelWindow.document.querySelector(".style-editor-importButton");
michael@0 37 ok(!button.hasAttribute("disabled"),
michael@0 38 "import button is enabled");
michael@0 39
michael@0 40 finish();
michael@0 41 }

mercurial