Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: LayoutTests/inspector/elements/styles/remove-node-during-editing.html

Issue 1158883003: DevTools: shard inspector/elements tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 originalNode;
15 var treeElement;
16 var stylesSidebarPane = WebInspector.panels.elements.sidebarPanes.styles;
17 InspectorTest.runTestSuite([
18 function selectInspectedNode(next)
19 {
20 InspectorTest.selectNodeAndWaitForStyles("inspected", next);
21 },
22
23 function startEditingAndRemoveNode(next)
24 {
25 originalNode = stylesSidebarPane.node();
26 treeElement = InspectorTest.getElementStylePropertyTreeItem("color") ;
27 treeElement.startEditing(treeElement.valueElement);
28
29 InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "_sel ectedNodeChangedForTest", next);
30 InspectorTest.evaluateInPage("removeInspectedNode();");
31 },
32
33 function verifySelectedNodeDidNotChange(next)
34 {
35 var currentNode = stylesSidebarPane.node();
36 if (currentNode !== originalNode) {
37 InspectorTest.addResult("StylesSidebarPane changed node!");
38 InspectorTest.completeTest();
39 return;
40 }
41 next();
42 },
43
44 function finishNodeEditing(next)
45 {
46 InspectorTest.addSniffer(WebInspector.StylePropertyTreeElement.proto type, "editingEnded", next);
47 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent( "U+001B")); // Escape
48 },
49
50 function verifySidebarPaneNodeChanged(next)
51 {
52 var currentNode = stylesSidebarPane.node();
53 if (currentNode === originalNode) {
54 InspectorTest.addResult("StylesSidebarPane should have changed n ode");
55 InspectorTest.completeTest();
56 return;
57 }
58 next();
59 },
60 ]);
61 }
62
63 </script>
64 </head>
65
66 <body onload="runTest()">
67 <p>
68 Tests that removing node while editing its styles does not cause styles sidebar pane to refresh.
69 </p>
70 <div id="inspected" style="color: blue">Text</div>
71 </body>
72 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698