| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 2 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 * @param {string} scriptName | 239 * @param {string} scriptName |
| 240 */ | 240 */ |
| 241 InspectorTest.importScript = function(scriptName) | 241 InspectorTest.importScript = function(scriptName) |
| 242 { | 242 { |
| 243 var xhr = new XMLHttpRequest(); | 243 var xhr = new XMLHttpRequest(); |
| 244 xhr.open("GET", scriptName, false); | 244 xhr.open("GET", scriptName, false); |
| 245 xhr.send(null); | 245 xhr.send(null); |
| 246 window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName); | 246 window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName); |
| 247 } | 247 } |
| 248 | 248 |
| 249 InspectorTest.runTestSuite = function(testSuite) |
| 250 { |
| 251 function nextTest() |
| 252 { |
| 253 if (!testSuite.length) { |
| 254 InspectorTest.completeTest(); |
| 255 return; |
| 256 } |
| 257 var fun = testSuite.shift(); |
| 258 InspectorTest.log("\nRunning test: " + fun.name); |
| 259 fun.call(null, nextTest); |
| 260 } |
| 261 |
| 262 nextTest(); |
| 263 } |
| 264 |
| 249 }; | 265 }; |
| 250 | 266 |
| 251 var outputElement; | 267 var outputElement; |
| 252 | 268 |
| 253 /** | 269 /** |
| 254 * Logs message to process stdout via alert (hopefully implemented with immediat
e flush). | 270 * Logs message to process stdout via alert (hopefully implemented with immediat
e flush). |
| 255 * @param {string} text | 271 * @param {string} text |
| 256 */ | 272 */ |
| 257 function debugLog(text) | 273 function debugLog(text) |
| 258 { | 274 { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 initializers += "(" + window[symbol].toString() + ")();\n"; | 346 initializers += "(" + window[symbol].toString() + ")();\n"; |
| 331 } | 347 } |
| 332 inspectorFrontend.postMessage(initializers + "(" + testFunction.toSt
ring() +")();", "*"); | 348 inspectorFrontend.postMessage(initializers + "(" + testFunction.toSt
ring() +")();", "*"); |
| 333 return; | 349 return; |
| 334 } | 350 } |
| 335 // Kill waiting process if failed to send. | 351 // Kill waiting process if failed to send. |
| 336 alert("Failed to send test function"); | 352 alert("Failed to send test function"); |
| 337 testRunner.notifyDone(); | 353 testRunner.notifyDone(); |
| 338 }); | 354 }); |
| 339 } | 355 } |
| OLD | NEW |