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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.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.
11 WebInspector.StylesSidebarPane.prototype.update = function() {}; 11 WebInspector.StylesSidebarPane.prototype.update = function() {};
12 WebInspector.MetricsSidebarPane.prototype.update = function() {}; 12 WebInspector.MetricsSidebarPane.prototype.update = function() {};
13 13
14 InspectorTest.runTestSuite([ 14 InspectorTest.runTestSuite([
15 function testSetUp(next) 15 function testSetUp(next)
16 { 16 {
17 InspectorTest.expandElementsTree(next); 17 InspectorTest.expandElementsTree(next);
18 }, 18 },
19 19
20 function testEditInvisibleCharsAsHTML(next) 20 function testEditInvisibleCharsAsHTML(next)
21 { 21 {
22 InspectorTest.domActionTestForNodeId("testEditInvisibleCharsAsHTML", "node-with-invisible-chars", testBody, next); 22 InspectorTest.domActionTestForNodeId("testEditInvisibleCharsAsHTML", "node-with-invisible-chars", testBody, next);
23 23
24 function testBody(node, done) 24 function testBody(node, done)
25 { 25 {
26 var treeOutline = InspectorTest.firstElementsTreeOutline(); 26 var treeOutline = InspectorTest.firstElementsTreeOutline();
27 var treeElement = treeOutline.findTreeElement(node); 27 var treeElement = treeOutline.findTreeElement(node);
28 treeOutline.toggleEditAsHTML(node); 28 treeOutline.toggleEditAsHTML(node);
29 InspectorTest.runAfterPendingDispatches(step2); 29 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
30 30
31 function step2() 31 function step2()
32 { 32 {
33 var codeMirror = treeElement._editing.codeMirror; 33 var codeMirror = treeElement._editing.codeMirror;
34 InspectorTest.addResult(codeMirror.getValue()); 34 InspectorTest.addResult(codeMirror.getValue());
35 codeMirror.setValue(codeMirror.getValue().replace(/&/g, '#') ); 35 codeMirror.setValue(codeMirror.getValue().replace(/&/g, '#') );
36 var event = InspectorTest.createKeyEvent("Enter"); 36 var event = InspectorTest.createKeyEvent("Enter");
37 event.isMetaOrCtrlForTest = true; 37 event.isMetaOrCtrlForTest = true;
38 treeElement._htmlEditElement.dispatchEvent(event); 38 treeElement._htmlEditElement.dispatchEvent(event);
39 InspectorTest.runAfterPendingDispatches(InspectorTest.expand ElementsTree.bind(InspectorTest, done)); 39 InspectorTest.deprecatedRunAfterPendingDispatches(InspectorT est.expandElementsTree.bind(InspectorTest, done));
40 } 40 }
41 } 41 }
42 }, 42 },
43 43
44 function testEditScript(next) 44 function testEditScript(next)
45 { 45 {
46 InspectorTest.domActionTestForNodeId("testEditScript", "node-to-edit -script", testBody, next); 46 InspectorTest.domActionTestForNodeId("testEditScript", "node-to-edit -script", testBody, next);
47 47
48 function testBody(node, done) 48 function testBody(node, done)
49 { 49 {
50 InspectorTest.editNodePartAndRun(node, "webkit-html-text-node", "var i = 0;\n var j = 0;\n", done); 50 InspectorTest.editNodePartAndRun(node, "webkit-html-text-node", "var i = 0;\n var j = 0;\n", done);
51 } 51 }
52 }, 52 },
53 53
54 function testEditSVGAttribute(next) 54 function testEditSVGAttribute(next)
55 { 55 {
56 InspectorTest.domActionTestForNodeId("testEditSVG", "node-to-edit-sv g-attribute", testBody, next); 56 InspectorTest.domActionTestForNodeId("testEditSVG", "node-to-edit-sv g-attribute", testBody, next);
57 57
58 function testBody(node, done) 58 function testBody(node, done)
59 { 59 {
60 var treeOutline = InspectorTest.firstElementsTreeOutline(); 60 var treeOutline = InspectorTest.firstElementsTreeOutline();
61 var treeElement = treeOutline.findTreeElement(node); 61 var treeElement = treeOutline.findTreeElement(node);
62 treeOutline.toggleEditAsHTML(node); 62 treeOutline.toggleEditAsHTML(node);
63 InspectorTest.runAfterPendingDispatches(step2); 63 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
64 64
65 function step2() 65 function step2()
66 { 66 {
67 var value = treeElement._editing.codeMirror.getValue(); 67 var value = treeElement._editing.codeMirror.getValue();
68 InspectorTest.addResult(value); 68 InspectorTest.addResult(value);
69 treeElement._editing.codeMirror.setValue(value.replace("100" , "110")); 69 treeElement._editing.codeMirror.setValue(value.replace("100" , "110"));
70 var event = InspectorTest.createKeyEvent("Enter"); 70 var event = InspectorTest.createKeyEvent("Enter");
71 event.isMetaOrCtrlForTest = true; 71 event.isMetaOrCtrlForTest = true;
72 treeElement._htmlEditElement.dispatchEvent(event); 72 treeElement._htmlEditElement.dispatchEvent(event);
73 InspectorTest.runAfterPendingDispatches(InspectorTest.expand ElementsTree.bind(InspectorTest, done)); 73 InspectorTest.deprecatedRunAfterPendingDispatches(InspectorT est.expandElementsTree.bind(InspectorTest, done));
74 } 74 }
75 } 75 }
76 } 76 }
77 ]); 77 ]);
78 } 78 }
79 79
80 </script> 80 </script>
81 </head> 81 </head>
82 82
83 <body onload="runTest()"> 83 <body onload="runTest()">
(...skipping 18 matching lines...) Expand all
102 </script> 102 </script>
103 </div> 103 </div>
104 104
105 <div id="testEditSVG"> 105 <div id="testEditSVG">
106 <svg id="node-to-edit-svg-attribute" xmlns:xlink="test" width="100"> 106 <svg id="node-to-edit-svg-attribute" xmlns:xlink="test" width="100">
107 </svg> 107 </svg>
108 </div> 108 </div>
109 </div> 109 </div>
110 </body> 110 </body>
111 </html> 111 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698