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 |
11 notice, this list of conditions and the following disclaimer in the | 11 notice, this list of conditions and the following disclaimer in the |
12 documentation and/or other materials provided with the distribution. | 12 documentation and/or other materials provided with the distribution. |
13 | 13 |
14 THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 --> | 24 --> |
25 <html> | 25 <html> |
26 <head> | 26 <head> |
27 <script> | 27 <script> |
28 | 28 |
29 InspectorFrontendAPI = {}; | 29 DevToolsAPI = {}; |
| 30 |
| 31 // FIXME: remove once embedders switch to new API. |
| 32 InspectorFrontendAPI = DevToolsAPI; |
30 | 33 |
31 InspectorTest = {}; | 34 InspectorTest = {}; |
32 InspectorTest._dispatchTable = []; | 35 InspectorTest._dispatchTable = []; |
33 InspectorTest._requestId = -1; | 36 InspectorTest._requestId = -1; |
34 InspectorTest._dumpInspectorProtocolMessages = false; | 37 InspectorTest._dumpInspectorProtocolMessages = false; |
35 InspectorTest.eventHandler = {}; | 38 InspectorTest.eventHandler = {}; |
36 | 39 |
37 InspectorTest.startDumpingProtocolMessages = function() | 40 InspectorTest.startDumpingProtocolMessages = function() |
38 { | 41 { |
39 InspectorTest._dumpInspectorProtocolMessages = true; | 42 InspectorTest._dumpInspectorProtocolMessages = true; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 InspectorTest.sendRawCommand = function(command, handler) | 156 InspectorTest.sendRawCommand = function(command, handler) |
154 { | 157 { |
155 this._dispatchTable[++this._requestId] = handler; | 158 this._dispatchTable[++this._requestId] = handler; |
156 InspectorFrontendHost.sendMessageToBackend(command); | 159 InspectorFrontendHost.sendMessageToBackend(command); |
157 return this._requestId; | 160 return this._requestId; |
158 } | 161 } |
159 | 162 |
160 /** | 163 /** |
161 * @param {string|!Object} messageOrObject | 164 * @param {string|!Object} messageOrObject |
162 */ | 165 */ |
163 InspectorFrontendAPI.dispatchMessage = function(messageOrObject) | 166 DevToolsAPI.dispatchMessage = function(messageOrObject) |
164 { | 167 { |
165 var messageObject = (typeof messageOrObject === "string" ? JSON.parse(messag
eOrObject) : messageOrObject); | 168 var messageObject = (typeof messageOrObject === "string" ? JSON.parse(messag
eOrObject) : messageOrObject); |
166 if (InspectorTest._collectProtocolMessages) | 169 if (InspectorTest._collectProtocolMessages) |
167 InspectorTest._collectedMessages.push({"side": "backend", "message": JSO
N.stringify(messageObject)}); | 170 InspectorTest._collectedMessages.push({"side": "backend", "message": JSO
N.stringify(messageObject)}); |
168 if (InspectorTest._dumpInspectorProtocolMessages) | 171 if (InspectorTest._dumpInspectorProtocolMessages) |
169 testRunner.logToStderr("backend: " + JSON.stringify(messageObject)); | 172 testRunner.logToStderr("backend: " + JSON.stringify(messageObject)); |
170 var messageId = messageObject["id"]; | 173 var messageId = messageObject["id"]; |
171 try { | 174 try { |
172 if (typeof messageId === "number") { | 175 if (typeof messageId === "number") { |
173 var handler = InspectorTest._dispatchTable[messageId]; | 176 var handler = InspectorTest._dispatchTable[messageId]; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 function enableInspectorAgent() | 344 function enableInspectorAgent() |
342 { | 345 { |
343 InspectorTest.sendCommand("Inspector.enable", { }); | 346 InspectorTest.sendCommand("Inspector.enable", { }); |
344 } | 347 } |
345 | 348 |
346 window.addEventListener("load", enableInspectorAgent, false); | 349 window.addEventListener("load", enableInspectorAgent, false); |
347 | 350 |
348 </script> | 351 </script> |
349 </head> | 352 </head> |
350 </html> | 353 </html> |
OLD | NEW |