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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-3.html

Issue 1877223003: DevTools: deprecate InspectorTest.runAfterPendingDispatches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script> 4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script src="edit-dom-test.js"></script> 5 <script src="edit-dom-test.js"></script>
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 // Save time on style updates. 10 // Save time on style updates.
(...skipping 21 matching lines...) Expand all
32 InspectorTest.addResult("Comment node not found"); 32 InspectorTest.addResult("Comment node not found");
33 InspectorTest.completeTest(); 33 InspectorTest.completeTest();
34 } 34 }
35 InspectorTest.domActionTest("testEditCommentAsHTML", commentNodeSele ctionCallback, testBody, next); 35 InspectorTest.domActionTest("testEditCommentAsHTML", commentNodeSele ctionCallback, testBody, next);
36 36
37 function testBody(node, done) 37 function testBody(node, done)
38 { 38 {
39 var treeOutline = InspectorTest.firstElementsTreeOutline(); 39 var treeOutline = InspectorTest.firstElementsTreeOutline();
40 var treeElement = treeOutline.findTreeElement(node); 40 var treeElement = treeOutline.findTreeElement(node);
41 treeOutline.toggleEditAsHTML(node); 41 treeOutline.toggleEditAsHTML(node);
42 InspectorTest.runAfterPendingDispatches(step2); 42 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
43 43
44 function step2() 44 function step2()
45 { 45 {
46 InspectorTest.addResult(treeElement._editing.codeMirror.getV alue()); 46 InspectorTest.addResult(treeElement._editing.codeMirror.getV alue());
47 treeElement._editing.codeMirror.setValue("<div foo=\"bar-com ment\">Element</div>"); 47 treeElement._editing.codeMirror.setValue("<div foo=\"bar-com ment\">Element</div>");
48 var event = InspectorTest.createKeyEvent("Enter"); 48 var event = InspectorTest.createKeyEvent("Enter");
49 event.isMetaOrCtrlForTest = true; 49 event.isMetaOrCtrlForTest = true;
50 treeElement._htmlEditElement.dispatchEvent(event); 50 treeElement._htmlEditElement.dispatchEvent(event);
51 InspectorTest.runAfterPendingDispatches(done); 51 InspectorTest.deprecatedRunAfterPendingDispatches(done);
52 } 52 }
53 } 53 }
54 }, 54 },
55 55
56 function testEditAsHTML(next) 56 function testEditAsHTML(next)
57 { 57 {
58 InspectorTest.domActionTestForNodeId("testEditAsHTML", "node-to-edit -as-html", testBody, next); 58 InspectorTest.domActionTestForNodeId("testEditAsHTML", "node-to-edit -as-html", testBody, next);
59 59
60 function testBody(node, done) 60 function testBody(node, done)
61 { 61 {
62 var treeOutline = InspectorTest.firstElementsTreeOutline(); 62 var treeOutline = InspectorTest.firstElementsTreeOutline();
63 var treeElement = treeOutline.findTreeElement(node); 63 var treeElement = treeOutline.findTreeElement(node);
64 treeOutline.toggleEditAsHTML(node); 64 treeOutline.toggleEditAsHTML(node);
65 InspectorTest.runAfterPendingDispatches(step2); 65 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
66 66
67 function step2() 67 function step2()
68 { 68 {
69 InspectorTest.addResult(treeElement._editing.codeMirror.getV alue()); 69 InspectorTest.addResult(treeElement._editing.codeMirror.getV alue());
70 treeElement._editing.codeMirror.setValue("<span foo=\"bar\"> <span id=\"inner-span\">Span contents</span></span>"); 70 treeElement._editing.codeMirror.setValue("<span foo=\"bar\"> <span id=\"inner-span\">Span contents</span></span>");
71 var event = InspectorTest.createKeyEvent("Enter"); 71 var event = InspectorTest.createKeyEvent("Enter");
72 event.isMetaOrCtrlForTest = true; 72 event.isMetaOrCtrlForTest = true;
73 treeElement._htmlEditElement.dispatchEvent(event); 73 treeElement._htmlEditElement.dispatchEvent(event);
74 InspectorTest.runAfterPendingDispatches(InspectorTest.expand ElementsTree.bind(InspectorTest, done)); 74 InspectorTest.deprecatedRunAfterPendingDispatches(InspectorT est.expandElementsTree.bind(InspectorTest, done));
75 } 75 }
76 } 76 }
77 }, 77 },
78 ]); 78 ]);
79 } 79 }
80 80
81 </script> 81 </script>
82 </head> 82 </head>
83 83
84 <body onload="runTest()"> 84 <body onload="runTest()">
85 <p> 85 <p>
86 Tests that user can mutate DOM by means of elements panel. 86 Tests that user can mutate DOM by means of elements panel.
87 </p> 87 </p>
88 88
89 <div> 89 <div>
90 <div id="testEditCommentAsHTML"> 90 <div id="testEditCommentAsHTML">
91 <!-- Comment --> 91 <!-- Comment -->
92 </div> 92 </div>
93 93
94 <div id="testEditAsHTML"> 94 <div id="testEditAsHTML">
95 <div id="node-to-edit-as-html"><span id="span">Text</span></div> 95 <div id="node-to-edit-as-html"><span id="span">Text</span></div>
96 </div> 96 </div>
97 </div> 97 </div>
98 </body> 98 </body>
99 </html> 99 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698