|
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 + "nostyle.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 panel.UI.once("stylesheets-reset", testDocumentLoad); |
|
19 |
|
20 content.location = TESTCASE_URI; |
|
21 }, () => {}); |
|
22 } |
|
23 |
|
24 function testDocumentLoad(event) |
|
25 { |
|
26 let root = gPanelWindow.document.querySelector(".splitview-root"); |
|
27 ok(!root.classList.contains("loading"), |
|
28 "style editor root element does not have 'loading' class name anymore"); |
|
29 |
|
30 ok(root.querySelector(".empty.placeholder"), "showing 'no style' indicator"); |
|
31 |
|
32 let button = gPanelWindow.document.querySelector(".style-editor-newButton"); |
|
33 ok(!button.hasAttribute("disabled"), |
|
34 "new style sheet button is enabled"); |
|
35 |
|
36 button = gPanelWindow.document.querySelector(".style-editor-importButton"); |
|
37 ok(!button.hasAttribute("disabled"), |
|
38 "import button is enabled"); |
|
39 |
|
40 finish(); |
|
41 } |