Chromium Code Reviews| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 * @param {string} scriptName | 221 * @param {string} scriptName |
| 222 */ | 222 */ |
| 223 InspectorTest.importScript = function(scriptName) | 223 InspectorTest.importScript = function(scriptName) |
| 224 { | 224 { |
| 225 var xhr = new XMLHttpRequest(); | 225 var xhr = new XMLHttpRequest(); |
| 226 xhr.open("GET", scriptName, false); | 226 xhr.open("GET", scriptName, false); |
| 227 xhr.send(null); | 227 xhr.send(null); |
| 228 window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName); | 228 window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName); |
| 229 } | 229 } |
| 230 | 230 |
| 231 InspectorTest.sendCommandOrDie = function(command, properties, callback) { | |
|
apavlov
2014/02/20 09:58:14
The name does not clearly describe the functionali
lushnikov
2014/02/20 14:17:04
Done.
| |
| 232 InspectorTest.sendCommand(command, properties || {}, commandCallback); | |
| 233 function commandCallback(msg) | |
| 234 { | |
| 235 if (msg.error) { | |
| 236 InspectorTest.log(msg.error.message); | |
|
apavlov
2014/02/20 09:58:14
I'd vote for ("ERROR: " + msg.error.message), sinc
lushnikov
2014/02/20 14:17:04
Done.
| |
| 237 InspectorTest.completeTest(); | |
| 238 return; | |
| 239 } | |
| 240 if (callback) | |
| 241 callback(msg.result); | |
| 242 } | |
| 243 } | |
| 244 | |
| 231 window.addEventListener("message", function(event) { | 245 window.addEventListener("message", function(event) { |
| 232 try { | 246 try { |
| 233 eval(event.data); | 247 eval(event.data); |
| 234 } catch (e) { | 248 } catch (e) { |
| 235 alert(e.stack); | 249 alert(e.stack); |
| 236 InspectorTest.completeTest(); | 250 InspectorTest.completeTest(); |
| 237 throw e; | 251 throw e; |
| 238 } | 252 } |
| 239 }); | 253 }); |
| OLD | NEW |