Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-2 / page-reload-update-sidebar.html
blob6d7d9b83528fef98d495fa2e9a96c7df1adc54e5
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>
7 function removeInspectedNode()
9 document.querySelector("#inspected").remove();
12 function test()
14 var stylesSidebarPane = WebInspector.panels.elements.sidebarPanes.styles;
15 InspectorTest.runTestSuite([
16 function selectInspectedNode(next)
18 InspectorTest.selectNodeAndWaitForStyles("inspected", next);
21 function startEditingAndReloadPage(next)
23 var treeElement = InspectorTest.getElementStylePropertyTreeItem("color");
24 var currentDocumentId = stylesSidebarPane.node().ownerDocument.id;
25 treeElement.startEditing(treeElement.valueElement);
26 var nodeRebuiltHappened = false;
27 var pageReloadHappened = false;
28 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_nodeStylesUpdatedForTest", onNodeRebuilt);
29 InspectorTest.reloadPage(reloadedCallback);
31 function onNodeRebuilt(node, rebuild)
33 if (!node || node.ownerDocument.id === currentDocumentId) {
34 InspectorTest.addResult("ERROR: A rebuild update happened for the same node.");
35 InspectorTest.completeTest();
36 return;
38 nodeRebuiltHappened = true;
39 maybeNext();
42 function reloadedCallback()
44 pageReloadHappened = true;
45 maybeNext();
48 function maybeNext()
50 if (nodeRebuiltHappened && pageReloadHappened)
51 next();
55 function onPageReloaded(next)
57 if (stylesSidebarPane._isEditingStyle) {
58 InspectorTest.addResult("StylesSidebarPane should not be locked in editing on page reload.");
59 InspectorTest.completeTest();
60 return;
62 next();
64 ]);
67 </script>
68 </head>
70 <body onload="runTest()">
71 <p>
72 Tests that reloading page during styles sidebar pane editing cancels editing and re-renders the
73 sidebar pane.
74 </p>
75 <div id="inspected" style="color: blue">Text</div>
76 </body>
77 </html>