OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | |
5 <script> | |
6 | |
7 function removeInspectedNode() | |
8 { | |
9 document.querySelector("#inspected").remove(); | |
10 } | |
11 | |
12 function test() | |
13 { | |
14 var stylesSidebarPane = WebInspector.panels.elements.sidebarPanes.styles; | |
15 InspectorTest.runTestSuite([ | |
16 function selectInspectedNode(next) | |
17 { | |
18 InspectorTest.selectNodeAndWaitForStyles("inspected", next); | |
19 }, | |
20 | |
21 function startEditingAndReloadPage(next) | |
22 { | |
23 var treeElement = InspectorTest.getElementStylePropertyTreeItem("col
or"); | |
24 var currentDocumentId = stylesSidebarPane.node().ownerDocument.id; | |
25 treeElement.startEditing(treeElement.valueElement); | |
26 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "
_nodeStylesUpdatedForTest", onNodeRebuilt); | |
27 InspectorTest.reloadPage(); | |
28 | |
29 function onNodeRebuilt(node, rebuild) | |
30 { | |
31 if (!node || node.ownerDocument.id === currentDocumentId) { | |
32 InspectorTest.addResult("ERROR: A rebuild update happened fo
r the same node."); | |
33 InspectorTest.completeTest(); | |
34 return; | |
35 } | |
36 next(); | |
37 } | |
38 }, | |
39 | |
40 function onPageReloaded(next) | |
41 { | |
42 if (stylesSidebarPane._isEditingStyle) { | |
43 InspectorTest.addResult("StylesSidebarPane should not be locked
in editing on page reload."); | |
44 InspectorTest.completeTest(); | |
45 return; | |
46 } | |
47 next(); | |
48 }, | |
49 ]); | |
50 } | |
51 | |
52 </script> | |
53 </head> | |
54 | |
55 <body onload="runTest()"> | |
56 <p> | |
57 Tests that reloading page during styles sidebar pane editing cancels editing and
re-renders the | |
58 sidebar pane. | |
59 </p> | |
60 <div id="inspected" style="color: blue">Text</div> | |
61 </body> | |
62 </html> | |
OLD | NEW |