browser/devtools/styleeditor/test/browser_styleeditor_loading.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:b62f72266e11
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/ */
4
5 const TESTCASE_URI = TEST_BASE + "longload.html";
6
7
8 function test()
9 {
10 waitForExplicitFinish();
11
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.
16
17 addTabAndCheckOnStyleEditorAdded(function(panel) {
18 content.location = TESTCASE_URI;
19 }, testEditorAdded);
20 }
21
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");
27
28 let button = gPanelWindow.document.querySelector(".style-editor-newButton");
29 ok(!button.hasAttribute("disabled"),
30 "new style sheet button is enabled");
31
32 button = gPanelWindow.document.querySelector(".style-editor-importButton");
33 ok(!button.hasAttribute("disabled"),
34 "import button is enabled");
35
36 finish();
37 }

mercurial