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

Side by Side Diff: test/inspector/runtime/es6-module.js

Issue 2663973002: [inspector] added experimental is_module flag for script parsed events (Closed)
Patch Set: rebased Created 3 years, 10 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/protocol-test.js ('k') | test/inspector/runtime/es6-module-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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 print('Checks basic ES6 modules support.'); 5 print('Checks basic ES6 modules support.');
6 6
7 var module1 = ` 7 var module1 = `
8 export function foo() { 8 export function foo() {
9 console.log('module1'); 9 console.log('module1');
10 return 42; 10 return 42;
(...skipping 14 matching lines...) Expand all
25 console.log(foo2()); 25 console.log(foo2());
26 import { a1 } from 'module1'; 26 import { a1 } from 'module1';
27 import { a2 } from 'module2'; 27 import { a2 } from 'module2';
28 debugger; 28 debugger;
29 `; 29 `;
30 30
31 var module4 = '}'; 31 var module4 = '}';
32 32
33 InspectorTest.setupScriptMap(); 33 InspectorTest.setupScriptMap();
34 // We get scriptParsed events for modules .. 34 // We get scriptParsed events for modules ..
35 Protocol.Debugger.onScriptParsed(message => { 35 Protocol.Debugger.onScriptParsed(InspectorTest.logMessage);
36 if (message.params.url === 'wait-pending-tasks.js') return;
37 InspectorTest.logMessage(message);
38 });
39 // .. scriptFailed to parse for modules with syntax error .. 36 // .. scriptFailed to parse for modules with syntax error ..
40 Protocol.Debugger.onScriptFailedToParse(InspectorTest.logMessage); 37 Protocol.Debugger.onScriptFailedToParse(InspectorTest.logMessage);
41 // .. API messages from modules contain correct stack trace .. 38 // .. API messages from modules contain correct stack trace ..
42 Protocol.Runtime.onConsoleAPICalled(message => { 39 Protocol.Runtime.onConsoleAPICalled(message => {
43 InspectorTest.log(`console.log(${message.params.args[0].value})`); 40 InspectorTest.log(`console.log(${message.params.args[0].value})`);
44 InspectorTest.logCallFrames(message.params.stackTrace.callFrames); 41 InspectorTest.logCallFrames(message.params.stackTrace.callFrames);
45 InspectorTest.log(''); 42 InspectorTest.log('');
46 }); 43 });
47 // .. we could break inside module and scope contains correct list of variables .. 44 // .. we could break inside module and scope contains correct list of variables ..
48 Protocol.Debugger.onPaused(message => { 45 Protocol.Debugger.onPaused(message => {
49 InspectorTest.logMessage(message); 46 InspectorTest.logMessage(message);
50 Protocol.Runtime.getProperties({ objectId: message.params.callFrames[0].scopeC hain[0].object.objectId}) 47 Protocol.Runtime.getProperties({ objectId: message.params.callFrames[0].scopeC hain[0].object.objectId})
51 .then(InspectorTest.logMessage) 48 .then(InspectorTest.logMessage)
52 .then(() => Protocol.Debugger.resume()); 49 .then(() => Protocol.Debugger.resume());
53 }); 50 });
54 // .. we process uncaught errors from modules correctly. 51 // .. we process uncaught errors from modules correctly.
55 Protocol.Runtime.onExceptionThrown(InspectorTest.logMessage); 52 Protocol.Runtime.onExceptionThrown(InspectorTest.logMessage);
56 53
57 Protocol.Runtime.enable(); 54 Protocol.Runtime.enable();
58 Protocol.Debugger.enable() 55 Protocol.Debugger.enable()
59 .then(() => InspectorTest.addModule(module1, "module1")) 56 .then(() => InspectorTest.addModule(module1, "module1"))
60 .then(() => InspectorTest.addModule(module2, "module2")) 57 .then(() => InspectorTest.addModule(module2, "module2"))
61 .then(() => InspectorTest.addModule(module3, "module3")) 58 .then(() => InspectorTest.addModule(module3, "module3"))
62 .then(() => InspectorTest.addModule(module4, "module4")) 59 .then(() => InspectorTest.addModule(module4, "module4"))
63 .then(() => InspectorTest.waitPendingTasks()) 60 .then(() => InspectorTest.waitPendingTasks())
64 .then(InspectorTest.completeTest); 61 .then(InspectorTest.completeTest);
OLDNEW
« no previous file with comments | « test/inspector/protocol-test.js ('k') | test/inspector/runtime/es6-module-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698