| 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; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 resource.requestContent = function(callback) | 55 resource.requestContent = function(callback) |
| 56 { | 56 { |
| 57 callback(content, false, mimeType); | 57 callback(content, false, mimeType); |
| 58 } | 58 } |
| 59 return resource; | 59 return resource; |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 function cssUISourceCodeAdded(uiSourceCode) | 63 function cssUISourceCodeAdded(uiSourceCode) |
| 64 { | 64 { |
| 65 InspectorTest.addResult("Added CSS uiSourceCode: " + uiSourceCode.uri())
; | 65 InspectorTest.addResult("Added CSS uiSourceCode: " + uiSourceCode.url())
; |
| 66 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(scssUISourceCodeAdd
ed); | 66 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(scssUISourceCodeAdd
ed); |
| 67 } | 67 } |
| 68 | 68 |
| 69 function scssUISourceCodeAdded(uiSourceCode) | 69 function scssUISourceCodeAdded(uiSourceCode) |
| 70 { | 70 { |
| 71 InspectorTest.addResult("Added SCSS uiSourceCode: " + uiSourceCode.uri()
); | 71 InspectorTest.addResult("Added SCSS uiSourceCode: " + uiSourceCode.url()
); |
| 72 setImmediate(afterStyleSheetAdded); | 72 setImmediate(afterStyleSheetAdded); |
| 73 } | 73 } |
| 74 | 74 |
| 75 function rawLocationToUILocation(line, column) | 75 function rawLocationToUILocation(line, column) |
| 76 { | 76 { |
| 77 var header = cssModel.styleSheetHeaderForId(styleSheetId); | 77 var header = cssModel.styleSheetHeaderForId(styleSheetId); |
| 78 return InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new
WebInspector.CSSLocation(header, line, column)); | 78 return InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new
WebInspector.CSSLocation(header, line, column)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 function afterStyleSheetAdded() | 81 function afterStyleSheetAdded() |
| 82 { | 82 { |
| 83 var cssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForOriginU
RL(styleSheetURL); | 83 var cssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(sty
leSheetURL); |
| 84 var scssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForOrigin
URL("http://localhost:8000/inspector/resources/example.scss"); | 84 var scssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL("h
ttp://localhost:8000/inspector/resources/example.scss"); |
| 85 | 85 |
| 86 InspectorTest.checkUILocation(cssUISourceCode, 0, 3, rawLocationToUILoca
tion(0, 3)); | 86 InspectorTest.checkUILocation(cssUISourceCode, 0, 3, rawLocationToUILoca
tion(0, 3)); |
| 87 InspectorTest.checkUILocation(scssUISourceCode, 1, 0, rawLocationToUILoc
ation(1, 0)); | 87 InspectorTest.checkUILocation(scssUISourceCode, 1, 0, rawLocationToUILoc
ation(1, 0)); |
| 88 InspectorTest.checkUILocation(scssUISourceCode, 2, 2, rawLocationToUILoc
ation(2, 4)); | 88 InspectorTest.checkUILocation(scssUISourceCode, 2, 2, rawLocationToUILoc
ation(2, 4)); |
| 89 InspectorTest.checkUILocation(scssUISourceCode, 2, 5, rawLocationToUILoc
ation(2, 6)); | 89 InspectorTest.checkUILocation(scssUISourceCode, 2, 5, rawLocationToUILoc
ation(2, 6)); |
| 90 InspectorTest.checkUILocation(scssUISourceCode, 2, 7, rawLocationToUILoc
ation(2, 9)); | 90 InspectorTest.checkUILocation(scssUISourceCode, 2, 7, rawLocationToUILoc
ation(2, 9)); |
| 91 InspectorTest.checkUILocation(scssUISourceCode, 2, 10, rawLocationToUILo
cation(3, 7)); | 91 InspectorTest.checkUILocation(scssUISourceCode, 2, 10, rawLocationToUILo
cation(3, 7)); |
| 92 InspectorTest.checkUILocation(scssUISourceCode, 4, 2, rawLocationToUILoc
ation(4, 8)); | 92 InspectorTest.checkUILocation(scssUISourceCode, 4, 2, rawLocationToUILoc
ation(4, 8)); |
| 93 InspectorTest.checkUILocation(scssUISourceCode, 4, 2, rawLocationToUILoc
ation(4, 10)); | 93 InspectorTest.checkUILocation(scssUISourceCode, 4, 2, rawLocationToUILoc
ation(4, 10)); |
| 94 InspectorTest.checkUILocation(scssUISourceCode, 4, 11, rawLocationToUILo
cation(4, 11)); | 94 InspectorTest.checkUILocation(scssUISourceCode, 4, 11, rawLocationToUILo
cation(4, 11)); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 </script> | 116 </script> |
| 117 | 117 |
| 118 </head> | 118 </head> |
| 119 | 119 |
| 120 <body onload="runTest()"> | 120 <body onload="runTest()"> |
| 121 <p>Tests SourceMap and StyleSheetMapping.</p> | 121 <p>Tests SourceMap and StyleSheetMapping.</p> |
| 122 </body> | 122 </body> |
| 123 </html> | 123 </html> |
| OLD | NEW |