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 InspectorTest.evaluateInPage("simulateBrowserSync()", function() { }); | 22 InspectorTest.evaluateInPage("simulateBrowserSync()", function() { }); |
23 InspectorTest.cssModel.sourceMapManager().addEventListener(SDK.SourceMapMana
ger.Events.SourceMapAttached, onSourceMapAttached); | 23 InspectorTest.cssModel.sourceMapManager().addEventListener(SDK.SourceMapMana
ger.Events.SourceMapAttached, onSourceMapAttached); |
24 | 24 |
25 function onSourceMapAttached(event) | 25 function onSourceMapAttached(event) |
26 { | 26 { |
27 var header = event.data; | 27 var header = event.data.client; |
28 var sourceMap = InspectorTest.cssModel.sourceMapManager().sourceMapForCl
ient(header); | 28 var sourceMap = event.data.sourceMap; |
29 InspectorTest.addResult("SourceMap is editable: " + sourceMap.editable()
); | 29 InspectorTest.addResult("SourceMap is editable: " + sourceMap.editable()
); |
30 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 </script> | 34 </script> |
35 | 35 |
36 </head> | 36 </head> |
37 | 37 |
38 <body onload="runTest()"> | 38 <body onload="runTest()"> |
39 <p>Verifies that editable source map is created in case of race between iNotify
and BrowserSync.</p> | 39 <p>Verifies that editable source map is created in case of race between iNotify
and BrowserSync.</p> |
40 </body> | 40 </body> |
41 </html> | 41 </html> |
OLD | NEW |