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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 title: "", | 45 title: "", |
46 disabled: false | 46 disabled: false |
47 }; | 47 }; |
48 } | 48 } |
49 | 49 |
50 function createMockStyleSheetResource(url, mimeType, content) | 50 function createMockStyleSheetResource(url, mimeType, content) |
51 { | 51 { |
52 const documentURL = "http://localhost:8000/inspector/stylesheet-source-m
apping.html"; | 52 const documentURL = "http://localhost:8000/inspector/stylesheet-source-m
apping.html"; |
53 const frame = InspectorTest.resourceTreeModel.mainFrame; | 53 const frame = InspectorTest.resourceTreeModel.mainFrame; |
54 var resource = new WebInspector.Resource(target, null, url, documentURL,
frame.id, frame.loaderId, WebInspector.resourceTypes.Stylesheet, mimeType); | 54 var resource = new WebInspector.Resource(target, null, url, documentURL,
frame.id, frame.loaderId, WebInspector.resourceTypes.Stylesheet, mimeType); |
55 resource.requestContent = function(callback) | 55 resource.requestContent = function() |
56 { | 56 { |
57 callback(content, false, mimeType); | 57 return Promise.resolve(content); |
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.url())
; | 65 InspectorTest.addResult("Added CSS uiSourceCode: " + uiSourceCode.url())
; |
66 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(scssUISourceCodeAdd
ed); | 66 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(scssUISourceCodeAdd
ed); |
67 } | 67 } |
(...skipping 19 matching lines...) Expand all Loading... |
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)); |
95 InspectorTest.checkUILocation(scssUISourceCode, 4, 13, rawLocationToUILo
cation(4, 15)); | 95 InspectorTest.checkUILocation(scssUISourceCode, 4, 13, rawLocationToUILo
cation(4, 15)); |
96 InspectorTest.checkUILocation(scssUISourceCode, 4, 17, rawLocationToUILo
cation(4, 20)); | 96 InspectorTest.checkUILocation(scssUISourceCode, 4, 17, rawLocationToUILo
cation(4, 20)); |
97 scssUISourceCode.requestContent(didRequestContent); | 97 scssUISourceCode.requestContent().then(didRequestContent); |
98 | 98 |
99 function didRequestContent(content, contentEncoded, mimeType) | 99 function didRequestContent(content, contentEncoded, mimeType) |
100 { | 100 { |
101 InspectorTest.assertEquals(0, content.indexOf("/* Comment */")); | 101 InspectorTest.assertEquals(0, content.indexOf("/* Comment */")); |
102 contentReceived = true; | 102 contentReceived = true; |
103 join(); | 103 join(); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 function join() | 107 function join() |
108 { | 108 { |
109 if (!contentReceived || !finalMappedLocation) | 109 if (!contentReceived || !finalMappedLocation) |
110 return; | 110 return; |
111 InspectorTest.addResult("UILocation upon LiveLocation update: " + finalM
appedLocation); | 111 InspectorTest.addResult("UILocation upon LiveLocation update: " + finalM
appedLocation); |
112 InspectorTest.completeTest(); | 112 InspectorTest.completeTest(); |
113 } | 113 } |
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 |