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

Unified Diff: test/inspector/debugger/es6-module-set-script-source.js

Issue 2669713002: [inspector] return meaningful error on Debug.setScriptSource for ES module (Closed)
Patch Set: addressed comments 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/debugger/es6-module-set-script-source.js
diff --git a/test/inspector/debugger/es6-module-set-script-source.js b/test/inspector/debugger/es6-module-set-script-source.js
new file mode 100644
index 0000000000000000000000000000000000000000..747c189f5aed2d11590b5e8269c0c96f121d04d4
--- /dev/null
+++ b/test/inspector/debugger/es6-module-set-script-source.js
@@ -0,0 +1,33 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print('Checks that Debugger.setScriptSource doesn\'t crash with modules');
+
+var module1 = `
+export function foo() {
+ return 42;
+}`;
+
+var editedModule1 = `
+export function foo() {
+ return 239;
+}`;
+
+var module2 = `
+import { foo } from 'module1';
+console.log(foo());
+`;
+
+var module1Id;
+Protocol.Debugger.onScriptParsed(message => {
+ if (message.params.url === 'module1')
+ module1Id = message.params.scriptId;
+});
+Protocol.Debugger.enable()
+ .then(() => InspectorTest.addModule(module1, 'module1'))
+ .then(() => InspectorTest.addModule(module2, 'module2'))
+ .then(() => InspectorTest.waitPendingTasks())
+ .then(() => Protocol.Debugger.setScriptSource({ scriptId: module1Id, scriptSource: editedModule1 }))
+ .then(InspectorTest.logMessage)
+ .then(InspectorTest.completeTest);
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/es6-module-set-script-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698