| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 function testEditShadowDOMAsHTML(next) | 22 function testEditShadowDOMAsHTML(next) |
| 23 { | 23 { |
| 24 InspectorTest.domActionTestForNodeId("testEditAuthorShadowDOMAsHTML"
, "authorShadowDOMElement", testBody, next); | 24 InspectorTest.domActionTestForNodeId("testEditAuthorShadowDOMAsHTML"
, "authorShadowDOMElement", testBody, next); |
| 25 | 25 |
| 26 function testBody(node, done) | 26 function testBody(node, done) |
| 27 { | 27 { |
| 28 var treeOutline = InspectorTest.firstElementsTreeOutline(); | 28 var treeOutline = InspectorTest.firstElementsTreeOutline(); |
| 29 var treeElement = treeOutline.findTreeElement(node); | 29 var treeElement = treeOutline.findTreeElement(node); |
| 30 treeOutline.toggleEditAsHTML(node); | 30 treeOutline.toggleEditAsHTML(node); |
| 31 InspectorTest.runAfterPendingDispatches(step2); | 31 InspectorTest.deprecatedRunAfterPendingDispatches(step2); |
| 32 | 32 |
| 33 function step2() | 33 function step2() |
| 34 { | 34 { |
| 35 InspectorTest.addResult(treeElement._editing.codeMirror.getV
alue()); | 35 InspectorTest.addResult(treeElement._editing.codeMirror.getV
alue()); |
| 36 treeElement._editing.codeMirror.setValue("<span foo=\"shadow
-span\"><span id=\"inner-shadow-span\">Shadow span contents</span></span>"); | 36 treeElement._editing.codeMirror.setValue("<span foo=\"shadow
-span\"><span id=\"inner-shadow-span\">Shadow span contents</span></span>"); |
| 37 var event = InspectorTest.createKeyEvent("Enter"); | 37 var event = InspectorTest.createKeyEvent("Enter"); |
| 38 event.isMetaOrCtrlForTest = true; | 38 event.isMetaOrCtrlForTest = true; |
| 39 treeElement._htmlEditElement.dispatchEvent(event); | 39 treeElement._htmlEditElement.dispatchEvent(event); |
| 40 InspectorTest.runAfterPendingDispatches(InspectorTest.expand
ElementsTree.bind(InspectorTest, done)); | 40 InspectorTest.deprecatedRunAfterPendingDispatches(InspectorT
est.expandElementsTree.bind(InspectorTest, done)); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 ]); | 44 ]); |
| 45 } | 45 } |
| 46 | 46 |
| 47 </script> | 47 </script> |
| 48 </head> | 48 </head> |
| 49 | 49 |
| 50 <body onload="runTest()"> | 50 <body onload="runTest()"> |
| 51 <p> | 51 <p> |
| 52 Tests that user can mutate author shadow DOM by means of elements panel. | 52 Tests that user can mutate author shadow DOM by means of elements panel. |
| 53 </p> | 53 </p> |
| 54 | 54 |
| 55 <div> | 55 <div> |
| 56 <div id="testEditAuthorShadowDOMAsHTML"></div> | 56 <div id="testEditAuthorShadowDOMAsHTML"></div> |
| 57 </div> | 57 </div> |
| 58 <script> | 58 <script> |
| 59 function createRootWithContents(id, html) | 59 function createRootWithContents(id, html) |
| 60 { | 60 { |
| 61 var container = document.getElementById(id); | 61 var container = document.getElementById(id); |
| 62 var root = container.createShadowRoot(); | 62 var root = container.createShadowRoot(); |
| 63 root.innerHTML = html; | 63 root.innerHTML = html; |
| 64 } | 64 } |
| 65 | 65 |
| 66 createRootWithContents("testEditAuthorShadowDOMAsHTML", "<div id='authorShadowDO
MElement'></div>"); | 66 createRootWithContents("testEditAuthorShadowDOMAsHTML", "<div id='authorShadowDO
MElement'></div>"); |
| 67 </script> | 67 </script> |
| 68 </body> | 68 </body> |
| 69 </html> | 69 </html> |
| OLD | NEW |