| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 |
| 4 <link rel="stylesheet" href="./resources/styles-do-not-detach-sourcemap-on-edits
.css"> |
| 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 6 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 7 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 8 <script> |
| 9 |
| 10 function test() |
| 11 { |
| 12 InspectorTest.waitForScriptSource("styles-do-not-detach-sourcemap-on-edits.s
css", onSourceMapLoaded); |
| 13 |
| 14 function onSourceMapLoaded() |
| 15 { |
| 16 InspectorTest.selectNodeAndWaitForStyles("container", onNodeSelected); |
| 17 } |
| 18 |
| 19 function onNodeSelected() |
| 20 { |
| 21 InspectorTest.runTestSuite(testSuite); |
| 22 } |
| 23 |
| 24 var testSuite = [ |
| 25 function editProperty(next) |
| 26 { |
| 27 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 28 |
| 29 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("color"
); |
| 30 treeItem.applyStyleText("NAME: VALUE", true); |
| 31 InspectorTest.waitForStyles("container", next); |
| 32 }, |
| 33 |
| 34 function editSelector(next) |
| 35 { |
| 36 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 37 |
| 38 var section = InspectorTest.firstMatchedStyleSection(); |
| 39 section.startEditingSelector(); |
| 40 section._selectorElement.textContent = "#container, SELECTOR"; |
| 41 InspectorTest.waitForSelectorCommitted(next); |
| 42 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent(
"Enter")); |
| 43 }, |
| 44 |
| 45 function editMedia(next) |
| 46 { |
| 47 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 48 |
| 49 var section = InspectorTest.firstMatchedStyleSection(); |
| 50 var mediaTextElement = InspectorTest.firstMediaTextElementInSection(
section); |
| 51 mediaTextElement.click(); |
| 52 mediaTextElement.textContent = "(max-width: 9999999px)"; |
| 53 InspectorTest.waitForMediaTextCommitted(next); |
| 54 mediaTextElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")
); |
| 55 }, |
| 56 |
| 57 function addRule(next) |
| 58 { |
| 59 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 60 |
| 61 var styleSheetHeader = InspectorTest.cssModel.styleSheetHeaders().fi
nd(header => header.resourceURL().indexOf("styles-do-not-detach-sourcemap-on-edi
ts.css") !== -1); |
| 62 if (!styleSheetHeader) { |
| 63 InspectorTest.addResult("ERROR: failed to find style sheet!"); |
| 64 InspectorTest.completeTest(); |
| 65 return; |
| 66 } |
| 67 InspectorTest.addNewRuleInStyleSheet(styleSheetHeader, "NEW-RULE", n
ext); |
| 68 }, |
| 69 |
| 70 function finish(next) |
| 71 { |
| 72 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 73 next(); |
| 74 }, |
| 75 ]; |
| 76 } |
| 77 |
| 78 </script> |
| 79 </head> |
| 80 |
| 81 <body onload="runTest()"> |
| 82 <p> |
| 83 Tests that source map is not detached on edits. crbug.com/257778 |
| 84 </p> |
| 85 |
| 86 <div id="container">container.</div> |
| 87 |
| 88 </body> |
| 89 </html> |
| OLD | NEW |