Chromium Code Reviews| Index: LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js |
| diff --git a/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js b/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js |
| index c650ea176ea455b00c7668c6bd4e819417de2f2c..b494ae78030fba482a8096f35c0bb46718174bd0 100644 |
| --- a/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js |
| +++ b/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js |
| @@ -228,6 +228,20 @@ InspectorTest.importScript = function(scriptName) |
| window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName); |
| } |
| +InspectorTest.sendCommandAndBailOnError = function(command, properties, callback) { |
|
vsevik
2014/02/25 11:20:48
{ on the next line
lushnikov
2014/02/25 11:32:00
Done.
|
| + InspectorTest.sendCommand(command, properties || {}, commandCallback); |
| + function commandCallback(msg) |
| + { |
| + if (msg.error) { |
| + InspectorTest.log("ERROR: " + msg.error.message); |
| + InspectorTest.completeTest(); |
| + return; |
| + } |
| + if (callback) |
| + callback(msg.result); |
| + } |
| +} |
| + |
| window.addEventListener("message", function(event) { |
| try { |
| eval(event.data); |
| @@ -237,3 +251,19 @@ window.addEventListener("message", function(event) { |
| throw e; |
| } |
| }); |
| + |
| +InspectorTest.runTestSuite = function(testSuite) |
| +{ |
| + function nextTest() |
| + { |
| + if (!testSuite.length) { |
| + InspectorTest.completeTest(); |
| + return; |
| + } |
| + var fun = testSuite.shift(); |
| + InspectorTest.log("\nRunning test: " + fun.name); |
| + fun.call(null, nextTest); |
| + } |
| + |
| + nextTest(); |
| +} |