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 13 matching lines...) Expand all Loading... | |
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 var initialize_InspectorTest = function() { | 27 var initialize_InspectorTest = function() { |
28 | 28 |
29 InspectorTest.evaluateInInspectedPage = function(expression, callback) | 29 InspectorTest.evaluateInInspectedPage = function(expression, callback) |
30 { | 30 { |
31 InspectorTest.sendCommand("Runtime.evaluate", { expression: expression }, ca llback); | 31 InspectorTest.sendCommand("Runtime.evaluate", { expression: expression }, ca llback); |
32 } | 32 } |
33 | 33 |
34 InspectorTest.parseURL = function(url) | |
35 { | |
36 var result = {}; | |
37 var match = url.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(. *))?)?$/i); | |
38 if (!match) | |
39 return result; | |
40 result.scheme = match[1].toLowerCase(); | |
41 result.host = match[2]; | |
42 result.port = match[3]; | |
43 result.path = match[4] || "/"; | |
44 result.fragment = match[5]; | |
45 return result; | |
46 } | |
tyoshino (SeeGerritForStatus)
2017/01/10 05:21:39
can't we use the URL API for this? not available i
allada
2017/01/10 07:14:16
Sadly no, to keep protocol tests fast we load very
tyoshino (SeeGerritForStatus)
2017/01/10 10:36:29
Acknowledged.
| |
47 | |
34 } | 48 } |
35 | 49 |
36 var outputElement; | 50 var outputElement; |
37 | 51 |
38 /** | 52 /** |
39 * Logs message to process stdout via alert (hopefully implemented with immediat e flush). | 53 * Logs message to process stdout via alert (hopefully implemented with immediat e flush). |
40 * @param {string} text | 54 * @param {string} text |
41 */ | 55 */ |
42 function debugLog(text) | 56 function debugLog(text) |
43 { | 57 { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 continue; | 155 continue; |
142 initializers += "(" + window[symbol].toString() + ")();\n"; | 156 initializers += "(" + window[symbol].toString() + ")();\n"; |
143 } | 157 } |
144 evaluateInFrontend(initializers + "(" + testFunction.toString() +")();") ; | 158 evaluateInFrontend(initializers + "(" + testFunction.toString() +")();") ; |
145 return; | 159 return; |
146 } | 160 } |
147 // Kill waiting process if failed to send. | 161 // Kill waiting process if failed to send. |
148 alert("Failed to send test function"); | 162 alert("Failed to send test function"); |
149 testRunner.notifyDone(); | 163 testRunner.notifyDone(); |
150 } | 164 } |
OLD | NEW |