| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright (C) 2012 Samsung Electronics. All rights reserved. | 2 Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 3 | 3 |
| 4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
| 5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
| 6 are met: | 6 are met: |
| 7 | 7 |
| 8 1. Redistributions of source code must retain the above copyright | 8 1. Redistributions of source code must retain the above copyright |
| 9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
| 10 2. Redistributions in binary form must reproduce the above copyright | 10 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 InspectorTest.evaluateInPage = function(string, callback) | 291 InspectorTest.evaluateInPage = function(string, callback) |
| 292 { | 292 { |
| 293 this.sendCommand("Runtime.evaluate", { "expression": string }, function(mess
age) { | 293 this.sendCommand("Runtime.evaluate", { "expression": string }, function(mess
age) { |
| 294 if (message.error) | 294 if (message.error) |
| 295 InspectorTest.log("Error while executing '" + string + "': " + messa
ge.error.message); | 295 InspectorTest.log("Error while executing '" + string + "': " + messa
ge.error.message); |
| 296 else if (callback) | 296 else if (callback) |
| 297 callback(message.result.result.value); | 297 callback(message.result.result.value); |
| 298 }); | 298 }); |
| 299 }; | 299 }; |
| 300 | 300 |
| 301 /** |
| 302 * Evaluates expression in page. |
| 303 * @param {string} expression |
| 304 * @return {!Promise<?>} |
| 305 */ |
| 306 InspectorTest.evaluateInPagePromise = function(expression) |
| 307 { |
| 308 return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression":
expression, awaitPromise: false, returnByValue: true }); |
| 309 }; |
| 310 |
| 301 InspectorTest.evaluateInPageAsync = function(expression) | 311 InspectorTest.evaluateInPageAsync = function(expression) |
| 302 { | 312 { |
| 303 return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression":
expression, awaitPromise: true, returnByValue: true }).then((message) => message
.result.result.value); | 313 return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression":
expression, awaitPromise: true, returnByValue: true }).then((message) => message
.result.result.value); |
| 304 } | 314 } |
| 305 | 315 |
| 306 InspectorTest.completeTestIfError = function(messageObject) | 316 InspectorTest.completeTestIfError = function(messageObject) |
| 307 { | 317 { |
| 308 if (messageObject.error) { | 318 if (messageObject.error) { |
| 309 InspectorTest.log(messageObject.error.message); | 319 InspectorTest.log(messageObject.error.message); |
| 310 InspectorTest.completeTest(); | 320 InspectorTest.completeTest(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 callback(); | 435 callback(); |
| 426 } | 436 } |
| 427 } | 437 } |
| 428 } | 438 } |
| 429 | 439 |
| 430 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest),
false); | 440 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest),
false); |
| 431 | 441 |
| 432 </script> | 442 </script> |
| 433 </head> | 443 </head> |
| 434 </html> | 444 </html> |
| OLD | NEW |