| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 | 3 |
| 4 <link rel="stylesheet" href="resources/test-mapping-good.css?rel=123412341234"> | 4 <link rel="stylesheet" href="resources/test-mapping-good.css?rel=123412341234"> |
| 5 | 5 |
| 6 <script src="../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../http/tests/inspector/debugger-test.js"></script> | 7 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 8 <script src="./sass-test.js"></script> | 8 <script src="./sass-test.js"></script> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| 11 function simulateBrowserSync() | 11 function simulateBrowserSync() |
| 12 { | 12 { |
| 13 var link = document.querySelector("link"); | 13 var link = document.querySelector("link"); |
| 14 // Simulate iNotify push of new CSS. | 14 // Simulate iNotify push of new CSS. |
| 15 link.href = "resources/test-mapping-good.css"; | 15 link.href = "resources/test-mapping-good.css"; |
| 16 // Simluate BrowserSync update styleSheet with a cache-busting URL. | 16 // Simluate BrowserSync update styleSheet with a cache-busting URL. |
| 17 setTimeout(() => link.href = "resources/test-mapping-good.css?rel=1234123412
34", 0); | 17 setTimeout(() => link.href = "resources/test-mapping-good.css?rel=1234123412
34", 0); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function test() | 20 function test() |
| 21 { | 21 { |
| 22 Runtime.experiments.enableForTest("liveSASS"); | 22 Runtime.experiments.enableForTest("liveSASS"); |
| 23 InspectorTest.evaluateInPage("simulateBrowserSync()", function() { }); | 23 InspectorTest.evaluateInPage("simulateBrowserSync()", function() { }); |
| 24 InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.SourceM
apAttached, onSourceMapAttached); | 24 InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttache
d, onSourceMapAttached); |
| 25 | 25 |
| 26 function onSourceMapAttached(event) | 26 function onSourceMapAttached(event) |
| 27 { | 27 { |
| 28 var header = event.data; | 28 var header = event.data; |
| 29 var sourceMap = InspectorTest.cssModel.sourceMapForHeader(header); | 29 var sourceMap = InspectorTest.cssModel.sourceMapForHeader(header); |
| 30 InspectorTest.addResult("SourceMap is editable: " + sourceMap.editable()
); | 30 InspectorTest.addResult("SourceMap is editable: " + sourceMap.editable()
); |
| 31 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 </script> | 35 </script> |
| 36 | 36 |
| 37 </head> | 37 </head> |
| 38 | 38 |
| 39 <body onload="runTest()"> | 39 <body onload="runTest()"> |
| 40 <p>Verifies that editable source map is created in case of race between iNotify
and BrowserSync.</p> | 40 <p>Verifies that editable source map is created in case of race between iNotify
and BrowserSync.</p> |
| 41 </body> | 41 </body> |
| 42 </html> | 42 </html> |
| OLD | NEW |