OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="inspector-test.js"></script> | 3 <script src="inspector-test.js"></script> |
4 <script src="debugger-test.js"></script> | 4 <script src="debugger-test.js"></script> |
5 <script src="workspace-test.js"></script> | 5 <script src="workspace-test.js"></script> |
6 | 6 |
7 <script> | 7 <script> |
8 function test() | 8 function test() |
9 { | 9 { |
10 var contentReceived; | 10 var contentReceived; |
11 var finalMappedLocation; | 11 var finalMappedLocation; |
12 var target = InspectorTest.createWorkspaceWithTarget(); | 12 var target = InspectorTest.createWorkspaceWithTarget(); |
13 var cssModel = WebInspector.CSSModel.fromTarget(target); | 13 var cssModel = WebInspector.CSSModel.fromTarget(target); |
14 WebInspector.cssWorkspaceBinding = InspectorTest.testCSSWorkspaceBinding; | 14 WebInspector.cssWorkspaceBinding = InspectorTest.testCSSWorkspaceBinding; |
15 | 15 |
16 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(cssUISourceCodeAdded); | 16 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(cssUISourceCodeAdded); |
17 const styleSheetURL = "http://localhost:8000/inspector/resources/example.css
"; | 17 const styleSheetURL = "http://localhost:8000/inspector/resources/example.css
"; |
18 const sourceMapURL = "example.css.map"; | 18 const sourceMapURL = "example.css.map"; |
19 const styleSheetId = "1"; | 19 const styleSheetId = "1"; |
20 | 20 |
21 InspectorTest.addSniffer(WebInspector.CSSWorkspaceBinding.HeaderInfo.prototy
pe, "_updateLocations", locationsUpdated, true); | 21 InspectorTest.addSniffer(WebInspector.CSSWorkspaceBinding.TargetInfo.prototy
pe, "_updateLocations", locationsUpdated, true); |
22 cssModel._styleSheetAdded(createMockStyleSheetHeader(styleSheetURL, sourceMa
pURL)); | 22 cssModel._styleSheetAdded(createMockStyleSheetHeader(styleSheetURL, sourceMa
pURL)); |
23 | 23 |
24 function locationsUpdated() | 24 function locationsUpdated() |
25 { | 25 { |
26 var header = cssModel.styleSheetHeaderForId(styleSheetId); | 26 var header = cssModel.styleSheetHeaderForId(styleSheetId); |
27 var uiLocation = InspectorTest.testCSSWorkspaceBinding.rawLocationToUILo
cation(new WebInspector.CSSLocation(header, 2, 3)); | 27 var uiLocation = InspectorTest.testCSSWorkspaceBinding.rawLocationToUILo
cation(new WebInspector.CSSLocation(header, 2, 3)); |
28 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiLocation.
uiSourceCode); | 28 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiLocation.
uiSourceCode); |
29 if (networkURL.indexOf(".scss") === -1) | 29 if (networkURL.indexOf(".scss") === -1) |
30 return; | 30 return; |
31 finalMappedLocation = networkURL + ":" + uiLocation.lineNumber + ":" + u
iLocation.columnNumber; | 31 finalMappedLocation = networkURL + ":" + uiLocation.lineNumber + ":" + u
iLocation.columnNumber; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 </script> | 110 </script> |
111 | 111 |
112 </head> | 112 </head> |
113 | 113 |
114 <body onload="runTest()"> | 114 <body onload="runTest()"> |
115 <p>Tests SourceMap and StyleSheetMapping.</p> | 115 <p>Tests SourceMap and StyleSheetMapping.</p> |
116 </body> | 116 </body> |
117 </html> | 117 </html> |
OLD | NEW |