Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../../http/tests/inspector/workspace-test.js"></script> | 5 <script src="../../../http/tests/inspector/workspace-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var mockContentsMap = {}; | 9 var mockContentsMap = {}; |
| 10 var target; | 10 var target; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); | 80 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); |
| 81 createResourceMock(WebInspector.resourceTypes.Document, "<document r esource content>"); | 81 createResourceMock(WebInspector.resourceTypes.Document, "<document r esource content>"); |
| 82 | 82 |
| 83 function uiSourceCodeAdded(uiSourceCode) | 83 function uiSourceCodeAdded(uiSourceCode) |
| 84 { | 84 { |
| 85 // setTimeouts are necessary since same event finalizes uiSource Code creation. | 85 // setTimeouts are necessary since same event finalizes uiSource Code creation. |
| 86 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); | 86 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); |
| 87 } | 87 } |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 function testScriptResource(next) | 90 function testScriptResourceAndVMScript(next) |
| 91 { | 91 { |
| 92 createNetworkUISourceCodeProvider(); | 92 createNetworkUISourceCodeProvider(); |
| 93 InspectorTest.addResult("Creating resource."); | |
| 94 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); | 93 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); |
| 94 InspectorTest.addResult("Creating script resource."); | |
| 95 createResourceMock(WebInspector.resourceTypes.Script, "<script resou rce content>"); | 95 createResourceMock(WebInspector.resourceTypes.Script, "<script resou rce content>"); |
| 96 | |
| 97 function uiSourceCodeAdded(uiSourceCode) | |
| 98 { | |
| 99 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); | |
| 100 } | |
| 101 }, | |
| 102 | |
| 103 function testVMScript(next) | |
| 104 { | |
| 105 createNetworkUISourceCodeProvider(); | |
| 106 InspectorTest.addResult("Creating script."); | 96 InspectorTest.addResult("Creating script."); |
| 107 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); | |
| 108 createScriptMock("<script content>"); | 97 createScriptMock("<script content>"); |
| 109 | 98 |
| 110 function uiSourceCodeAdded(uiSourceCode) | 99 function uiSourceCodeAdded(uiSourceCode) |
| 111 { | 100 { |
| 112 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); | 101 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); |
| 113 } | 102 } |
| 114 }, | 103 }, |
| 115 | 104 |
| 116 function testStylesheetResource(next) | |
|
pfeldman
2015/08/12 23:38:42
Why is this removed?
dgozman
2015/08/13 18:27:26
Because adding stylesheet resource does not affect
pfeldman
2015/08/13 19:22:33
Does this mean that we no longer show stylesheets
| |
| 117 { | |
| 118 createNetworkUISourceCodeProvider(); | |
| 119 InspectorTest.addResult("Creating resource."); | |
| 120 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed); | |
| 121 createResourceMock(WebInspector.resourceTypes.Stylesheet, "<styleshe et resource content>"); | |
| 122 | |
| 123 function uiSourceCodeAdded(uiSourceCode) | |
| 124 { | |
| 125 setTimeout(function() { InspectorTest.dumpUISourceCode(uiSourceC ode, next); }); | |
| 126 } | |
| 127 }, | |
| 128 | |
| 129 function testRemoveStyleSheetFromModelWithComplexURL(next) | 105 function testRemoveStyleSheetFromModelWithComplexURL(next) |
| 130 { | 106 { |
| 131 var mockStyleSheetHeader = createMockStyleSheetHeader("http://exampl e.com/foo.css"); | 107 var mockStyleSheetHeader = createMockStyleSheetHeader("http://exampl e.com/foo.css"); |
| 132 testRemoveStyleSheetFromModel(mockStyleSheetHeader, next); | 108 testRemoveStyleSheetFromModel(mockStyleSheetHeader, next); |
| 133 }, | 109 }, |
| 134 | 110 |
| 135 function testRemoveStyleSheetFromModelWithSimpleURL(next) | 111 function testRemoveStyleSheetFromModelWithSimpleURL(next) |
| 136 { | 112 { |
| 137 var mockStyleSheetHeader = createMockStyleSheetHeader("foo.css"); | 113 var mockStyleSheetHeader = createMockStyleSheetHeader("foo.css"); |
| 138 testRemoveStyleSheetFromModel(mockStyleSheetHeader, next); | 114 testRemoveStyleSheetFromModel(mockStyleSheetHeader, next); |
| 139 } | 115 } |
| 140 ]); | 116 ]); |
| 141 | 117 |
| 142 function testRemoveStyleSheetFromModel(mockStyleSheetHeader, callback) | 118 function testRemoveStyleSheetFromModel(mockStyleSheetHeader, callback) |
| 143 { | 119 { |
| 144 createNetworkUISourceCodeProvider(); | 120 createNetworkUISourceCodeProvider(); |
| 145 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); | 121 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); |
| 122 InspectorTest.addResult("Creating stylesheet resource."); | |
| 123 createResourceMock(WebInspector.resourceTypes.Stylesheet, "<stylesheet r esource content>"); | |
| 124 | |
| 146 WebInspector.CSSStyleModel.fromTarget(target)._styleSheetAdded(mockStyle SheetHeader); | 125 WebInspector.CSSStyleModel.fromTarget(target)._styleSheetAdded(mockStyle SheetHeader); |
| 147 | 126 |
| 148 function uiSourceCodeAdded(uiSourceCode) | 127 function uiSourceCodeAdded(uiSourceCode) |
| 149 { | 128 { |
| 150 InspectorTest.addResult("Added uiSourceCode: " + InspectorTest.uiSou rceCodeURL(uiSourceCode)); | 129 InspectorTest.addResult("Added uiSourceCode: " + InspectorTest.uiSou rceCodeURL(uiSourceCode)); |
| 151 InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent(uiSourceCodeR emoved); | 130 InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent(uiSourceCodeR emoved); |
| 152 WebInspector.CSSStyleModel.fromTarget(target)._styleSheetRemoved(moc kStyleSheetHeader.styleSheetId); | 131 WebInspector.CSSStyleModel.fromTarget(target)._styleSheetRemoved(moc kStyleSheetHeader.styleSheetId); |
| 153 } | 132 } |
| 154 | 133 |
| 155 function uiSourceCodeRemoved(uiSourceCode) | 134 function uiSourceCodeRemoved(uiSourceCode) |
| 156 { | 135 { |
| 157 InspectorTest.addResult("Removed uiSourceCode: " + InspectorTest.uiS ourceCodeURL(uiSourceCode)); | 136 InspectorTest.addResult("Removed uiSourceCode: " + InspectorTest.uiS ourceCodeURL(uiSourceCode)); |
| 158 callback(); | 137 callback(); |
| 159 } | 138 } |
| 160 } | 139 } |
| 161 }; | 140 }; |
| 162 </script> | 141 </script> |
| 163 </head> | 142 </head> |
| 164 <body onload="runTest()"> | 143 <body onload="runTest()"> |
| 165 <p>Tests NetworkUISourceCodeProvider class.</p> | 144 <p>Tests NetworkUISourceCodeProvider class.</p> |
| 166 </body> | 145 </body> |
| 167 </html> | 146 </html> |
| OLD | NEW |