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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-test.js

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 function initialize_EditDOMTests() 1 function initialize_EditDOMTests()
2 { 2 {
3 3
4 // Preload codemirror which is used for "Edit as HTML". 4 // Preload codemirror which is used for "Edit as HTML".
5 InspectorTest.preloadPanel("sources"); 5 InspectorTest.preloadPanel("sources");
6 6
7 InspectorTest.doAddAttribute = function(testName, dataNodeId, attributeText, nex t) 7 InspectorTest.doAddAttribute = function(testName, dataNodeId, attributeText, nex t)
8 { 8 {
9 InspectorTest.domActionTestForNodeId(testName, dataNodeId, testBody, next); 9 InspectorTest.domActionTestForNodeId(testName, dataNodeId, testBody, next);
10 10
11 function testBody(node, done) 11 function testBody(node, done)
12 { 12 {
13 var editorElement = InspectorTest.editNodePart(node, "webkit-html-attrib ute"); 13 var editorElement = InspectorTest.editNodePart(node, "webkit-html-attrib ute");
14 editorElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009")); // Tab 14 editorElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009")); // Tab
15 15
16 InspectorTest.runAfterPendingDispatches(testContinuation); 16 InspectorTest.deprecatedRunAfterPendingDispatches(testContinuation);
17 17
18 function testContinuation() 18 function testContinuation()
19 { 19 {
20 var editorElement = WebInspector.panels.elements._treeOutlines[0]._s hadowRoot.getSelection().anchorNode.parentElement; 20 var editorElement = WebInspector.panels.elements._treeOutlines[0]._s hadowRoot.getSelection().anchorNode.parentElement;
21 editorElement.textContent = attributeText; 21 editorElement.textContent = attributeText;
22 editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); 22 editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
23 InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", done); 23 InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", done);
24 } 24 }
25 } 25 }
26 } 26 }
(...skipping 10 matching lines...) Expand all
37 InspectorTest.domActionTest = function(testName, dataNodeSelectionCallback, test Body, next) 37 InspectorTest.domActionTest = function(testName, dataNodeSelectionCallback, test Body, next)
38 { 38 {
39 var testNode = InspectorTest.expandedNodeWithId(testName); 39 var testNode = InspectorTest.expandedNodeWithId(testName);
40 InspectorTest.addResult("==== before ===="); 40 InspectorTest.addResult("==== before ====");
41 InspectorTest.dumpElementsTree(testNode); 41 InspectorTest.dumpElementsTree(testNode);
42 42
43 dataNodeSelectionCallback(testNode, step0); 43 dataNodeSelectionCallback(testNode, step0);
44 44
45 function step0(node) 45 function step0(node)
46 { 46 {
47 InspectorTest.runAfterPendingDispatches(step1.bind(null, node)); 47 InspectorTest.deprecatedRunAfterPendingDispatches(step1.bind(null, node) );
48 } 48 }
49 49
50 function step1(node) 50 function step1(node)
51 { 51 {
52 testBody(node, step2); 52 testBody(node, step2);
53 } 53 }
54 54
55 function step2() 55 function step2()
56 { 56 {
57 InspectorTest.addResult("==== after ===="); 57 InspectorTest.addResult("==== after ====");
(...skipping 13 matching lines...) Expand all
71 } 71 }
72 72
73 InspectorTest.editNodePartAndRun = function(node, className, newValue, step2, us eSniffer) 73 InspectorTest.editNodePartAndRun = function(node, className, newValue, step2, us eSniffer)
74 { 74 {
75 var editorElement = InspectorTest.editNodePart(node, className); 75 var editorElement = InspectorTest.editNodePart(node, className);
76 editorElement.textContent = newValue; 76 editorElement.textContent = newValue;
77 editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); 77 editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
78 if (useSniffer) 78 if (useSniffer)
79 InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_u pdateModifiedNodes", step2); 79 InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_u pdateModifiedNodes", step2);
80 else 80 else
81 InspectorTest.runAfterPendingDispatches(step2); 81 InspectorTest.deprecatedRunAfterPendingDispatches(step2);
82 } 82 }
83 83
84 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698