1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/styleeditor/test/browser_styleeditor_loading.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 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 + "longload.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 + content.location = TESTCASE_URI; 1.22 + }, testEditorAdded); 1.23 +} 1.24 + 1.25 +function testEditorAdded(event, editor) 1.26 +{ 1.27 + let root = gPanelWindow.document.querySelector(".splitview-root"); 1.28 + ok(!root.classList.contains("loading"), 1.29 + "style editor root element does not have 'loading' class name anymore"); 1.30 + 1.31 + let button = gPanelWindow.document.querySelector(".style-editor-newButton"); 1.32 + ok(!button.hasAttribute("disabled"), 1.33 + "new style sheet button is enabled"); 1.34 + 1.35 + button = gPanelWindow.document.querySelector(".style-editor-importButton"); 1.36 + ok(!button.hasAttribute("disabled"), 1.37 + "import button is enabled"); 1.38 + 1.39 + finish(); 1.40 +}