| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 | 3 |
| 4 <link rel="stylesheet" href="resources/styles-history.css"> | 4 <link rel="stylesheet" href="resources/styles-history.css"> |
| 5 | 5 |
| 6 <script src="../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../http/tests/inspector/elements-test.js"></script> | 7 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 8 <script src="../../http/tests/inspector/resources-test.js"></script> | 8 <script src="../../http/tests/inspector/resources-test.js"></script> |
| 9 <script src="./styles-test.js"></script> |
| 9 <script> | 10 <script> |
| 10 | 11 |
| 11 function test() | 12 function test() |
| 12 { | 13 { |
| 13 InspectorTest.runAfterCachedResourcesProcessed(runTestSuite); | 14 InspectorTest.runAfterCachedResourcesProcessed(runTestSuite); |
| 14 | 15 |
| 15 var uiSourceCode; | 16 var uiSourceCode; |
| 16 | 17 |
| 17 function runTestSuite() | 18 function runTestSuite() |
| 18 { | 19 { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 var property = style.getLiveProperty("margin"); | 80 var property = style.getLiveProperty("margin"); |
| 80 property.setText("margin:30px;", true, true); | 81 property.setText("margin:30px;", true, true); |
| 81 InspectorTest.runAfterPendingDispatches(dumpHistory(next)); | 82 InspectorTest.runAfterPendingDispatches(dumpHistory(next)); |
| 82 } | 83 } |
| 83 } | 84 } |
| 84 ]); | 85 ]); |
| 85 } | 86 } |
| 86 | 87 |
| 87 function styleSheetForResource(callback) | 88 function styleSheetForResource(callback) |
| 88 { | 89 { |
| 89 CSSAgent.getAllStyleSheets(didGetAllStyleSheets.bind(this)); | 90 InspectorTest.waitForStylesheetsOnFrontend(1, didGetAllStyleSheets.bind(
this)); |
| 90 | 91 |
| 91 function didGetAllStyleSheets(error, infos) | 92 function didGetAllStyleSheets(styleSheets) |
| 92 { | 93 { |
| 93 if (error) { | 94 for (var i = 0; i < styleSheets.length; ++i) { |
| 94 InspectorTest.addResult("Error:" + error); | 95 var styleSheet = styleSheets[i]; |
| 95 callback(null); | 96 if (styleSheet.sourceURL.indexOf("styles-history.css") === -1) |
| 96 return; | |
| 97 } | |
| 98 | |
| 99 for (var i = 0; i < infos.length; ++i) { | |
| 100 var info = infos[i]; | |
| 101 if (info.sourceURL.indexOf("styles-history.css") === -1) | |
| 102 continue; | 97 continue; |
| 103 WebInspector.CSSStyleSheet.createForId(info.styleSheetId, callba
ck); | 98 WebInspector.CSSStyleSheet.createForId(styleSheet.id, callback); |
| 104 return; | 99 return; |
| 105 } | 100 } |
| 106 callback(null); | 101 callback(null); |
| 107 } | 102 } |
| 108 } | 103 } |
| 109 | 104 |
| 110 function dumpHistory(next) | 105 function dumpHistory(next) |
| 111 { | 106 { |
| 112 function result() | 107 function result() |
| 113 { | 108 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 124 | 119 |
| 125 </script> | 120 </script> |
| 126 </head> | 121 </head> |
| 127 | 122 |
| 128 <body onload="runTest()"> | 123 <body onload="runTest()"> |
| 129 <p> | 124 <p> |
| 130 Tests resources panel history. | 125 Tests resources panel history. |
| 131 </p> | 126 </p> |
| 132 </body> | 127 </body> |
| 133 </html> | 128 </html> |
| OLD | NEW |