| 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/extensions-test.js"></script> | 4 <script src="../../http/tests/inspector/extensions-test.js"></script> |
| 5 <script src="../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 6 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 6 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 7 <script type="text/javascript" src="resources/test-script.js"></script> | 7 <script type="text/javascript" src="resources/test-script.js"></script> |
| 8 | 8 |
| 9 <script type="text/javascript"> | 9 <script type="text/javascript"> |
| 10 function logMessage() | 10 function logMessage() |
| 11 { | 11 { |
| 12 console.log("don't panic!"); | 12 console.log("don't panic!"); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function initialize_ExtensionResourceTests() | 15 function initialize_ExtensionResourceTests() |
| 16 { | 16 { |
| 17 | 17 |
| 18 InspectorTest.clickOnURL = function() | 18 InspectorTest.clickOnURL = function() |
| 19 { | 19 { |
| 20 WebInspector.inspectorView.showPanel("console"); | 20 WebInspector.inspectorView.showPanel("console"); |
| 21 var xpathResult = document.evaluate("//a[starts-with(., 'extensions-resource
s.html')]", | 21 var xpathResult = document.evaluate("//a[starts-with(., 'extensions-resource
s.html')]", |
| 22 WebInspector.panels.console.element, nul
l, XPathResult.ANY_UNORDERED_NODE_TYPE, null); | 22 WebInspector.panels.console.element, nul
l, XPathResult.ANY_UNORDERED_NODE_TYPE, null); |
| 23 var click = document.createEvent("MouseEvent"); | 23 var click = document.createEvent("MouseEvent"); |
| 24 click.initMouseEvent("click", true, true); | 24 click.initMouseEvent("click", true, true); |
| 25 xpathResult.singleNodeValue.dispatchEvent(click); | 25 xpathResult.singleNodeValue.dispatchEvent(click); |
| 26 } | 26 } |
| 27 | 27 |
| 28 InspectorTest.waitForStyleSheetChangedEvent = function(reply) | 28 InspectorTest.waitForStyleSheetChangedEvent = function(reply) |
| 29 { | 29 { |
| 30 var oldUpdateTimeout = WebInspector.StyleFile.updateTimeout; | 30 var originalSetTimeout = WebInspector.Throttler.prototype._setTimeout; |
| 31 WebInspector.StyleFile.updateTimeout = 0; | 31 WebInspector.Throttler.prototype._setTimeout = innerSetTimeout; |
| 32 InspectorTest.addSniffer(WebInspector.CSSStyleModel.prototype, "_fireStyleSh
eetChanged", onStyleSheetChanged); | 32 InspectorTest.addSniffer(WebInspector.CSSStyleModel.prototype, "_fireStyleSh
eetChanged", onStyleSheetChanged); |
| 33 | 33 |
| 34 function onStyleSheetChanged() | 34 function onStyleSheetChanged() |
| 35 { | 35 { |
| 36 WebInspector.StyleFile.updateTimeout = oldUpdateTimeout; | 36 WebInspector.Throttler.prototype._setTimeout = originalSetTimeout; |
| 37 reply(); | 37 reply(); |
| 38 } | 38 } |
| 39 |
| 40 function innerSetTimeout(operation, timeout) |
| 41 { |
| 42 return originalSetTimeout.call(this, operation, 0); |
| 43 } |
| 39 } | 44 } |
| 40 | 45 |
| 41 } | 46 } |
| 42 | 47 |
| 43 function extension_testGetAllResources(nextTest) | 48 function extension_testGetAllResources(nextTest) |
| 44 { | 49 { |
| 45 function callback(resources) | 50 function callback(resources) |
| 46 { | 51 { |
| 47 // For some reason scripts from tests previously run in the same test sh
ell sometimes appear, so we need to filter them out. | 52 // For some reason scripts from tests previously run in the same test sh
ell sometimes appear, so we need to filter them out. |
| 48 var resourceURLsWhiteList = ["abe.png", "audits-style1.css", "extensions
-resources.html", "extensions-test.js", "inspector-test.js", "test-script.js"]; | 53 var resourceURLsWhiteList = ["abe.png", "audits-style1.css", "extensions
-resources.html", "extensions-test.js", "inspector-test.js", "test-script.js"]; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 194 } |
| 190 | 195 |
| 191 </script> | 196 </script> |
| 192 </head> | 197 </head> |
| 193 <body onload="runTest()"> | 198 <body onload="runTest()"> |
| 194 <p>Tests resource-related methods of WebInspector extension API</p> | 199 <p>Tests resource-related methods of WebInspector extension API</p> |
| 195 <img src="resources/abe.png"> | 200 <img src="resources/abe.png"> |
| 196 <div id="test-div" class="test"></div> | 201 <div id="test-div" class="test"></div> |
| 197 </body> | 202 </body> |
| 198 </html> | 203 </html> |
| OLD | NEW |