Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: test/inspector/protocol-test.js

Issue 2651043004: [wasm] Add inspector test for stepping (Closed)
Patch Set: Beautification Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/inspector/debugger/wasm-stepping-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 InspectorTest = {}; 5 InspectorTest = {};
6 InspectorTest._dispatchTable = new Map(); 6 InspectorTest._dispatchTable = new Map();
7 InspectorTest._requestId = 0; 7 InspectorTest._requestId = 0;
8 InspectorTest._dumpInspectorProtocolMessages = false; 8 InspectorTest._dumpInspectorProtocolMessages = false;
9 InspectorTest._eventHandler = {}; 9 InspectorTest._eventHandler = {};
10 10
11 Protocol = new Proxy({}, { 11 Protocol = new Proxy({}, {
12 get: function(target, agentName, receiver) { 12 get: function(target, agentName, receiver) {
13 return new Proxy({}, { 13 return new Proxy({}, {
14 get: function(target, methodName, receiver) { 14 get: function(target, methodName, receiver) {
15 const eventPattern = /^on(ce)?([A-Z][A-Za-z0-9]+)/; 15 const eventPattern = /^on(ce)?([A-Z][A-Za-z0-9]+)/;
16 var match = eventPattern.exec(methodName); 16 var match = eventPattern.exec(methodName);
17 if (!match) { 17 if (!match) {
18 return (args) => InspectorTest._sendCommandPromise(`${agentName}.${met hodName}`, args || {}); 18 return (args) => InspectorTest._sendCommandPromise(`${agentName}.${met hodName}`, args || {});
19 } else { 19 } else {
20 var eventName = match[2]; 20 var eventName = match[2];
21 eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1); 21 eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1);
22 if (match[1]) 22 if (match[1])
23 return (args) => InspectorTest._waitForEventPromise(`${agentName}.${ eventName}`, args || {}); 23 return () => InspectorTest._waitForEventPromise(
24 `${agentName}.${eventName}`);
24 else 25 else
25 return (listener) => { InspectorTest._eventHandler[`${agentName}.${e ventName}`] = listener }; 26 return (listener) => { InspectorTest._eventHandler[`${agentName}.${e ventName}`] = listener };
26 } 27 }
27 } 28 }
28 }); 29 });
29 } 30 }
30 }); 31 });
31 32
32 InspectorTest.log = print.bind(null); 33 InspectorTest.log = print.bind(null);
33 34
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 if (InspectorTest._scriptMap && eventName === "Debugger.scriptParsed") 215 if (InspectorTest._scriptMap && eventName === "Debugger.scriptParsed")
215 InspectorTest._scriptMap.set(messageObject.params.scriptId, JSON.parse(J SON.stringify(messageObject.params))); 216 InspectorTest._scriptMap.set(messageObject.params.scriptId, JSON.parse(J SON.stringify(messageObject.params)));
216 if (eventHandler) 217 if (eventHandler)
217 eventHandler(messageObject); 218 eventHandler(messageObject);
218 } 219 }
219 } catch (e) { 220 } catch (e) {
220 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac k + "\n message = " + JSON.stringify(messageObject, null, 2)); 221 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac k + "\n message = " + JSON.stringify(messageObject, null, 2));
221 InspectorTest.completeTest(); 222 InspectorTest.completeTest();
222 } 223 }
223 } 224 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/wasm-stepping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698