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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js

Issue 2331053002: DevTools: Implement the console prompt with CodeMirror (Closed)
Patch Set: Fix browser tests Created 4 years, 3 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 | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-auto-completion.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var initialize_ConsoleTest = function() { 1 var initialize_ConsoleTest = function() {
2 2
3 InspectorTest.preloadModule("source_frame"); 3 InspectorTest.preloadModule("source_frame");
4 InspectorTest.preloadPanel("console"); 4 InspectorTest.preloadPanel("console");
5 5
6 InspectorTest.selectMainExecutionContext = function() 6 InspectorTest.selectMainExecutionContext = function()
7 { 7 {
8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts(); 8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts();
9 for (var context of executionContexts) { 9 for (var context of executionContexts) {
10 if (context.isDefault) { 10 if (context.isDefault) {
11 WebInspector.context.setFlavor(WebInspector.ExecutionContext, contex t); 11 WebInspector.context.setFlavor(WebInspector.ExecutionContext, contex t);
12 return; 12 return;
13 } 13 }
14 } 14 }
15 } 15 }
16 16
17 InspectorTest.evaluateInConsole = function(code, callback, dontForceMainContext) 17 InspectorTest.evaluateInConsole = function(code, callback, dontForceMainContext)
18 { 18 {
19 if (!dontForceMainContext) 19 if (!dontForceMainContext)
20 InspectorTest.selectMainExecutionContext(); 20 InspectorTest.selectMainExecutionContext();
21 callback = InspectorTest.safeWrap(callback); 21 callback = InspectorTest.safeWrap(callback);
22 22
23 var consoleView = WebInspector.ConsoleView.instance(); 23 var consoleView = WebInspector.ConsoleView.instance();
24 consoleView.visible = true; 24 consoleView._appendCommand(code, true);
25 consoleView._prompt.setText(code);
26 var event = new KeyboardEvent("keydown", {
27 key: "Enter",
28 bubbles: true,
29 cancelable: true
30 });
31 consoleView._prompt.proxyElementForTests().dispatchEvent(event);
32 InspectorTest.addConsoleViewSniffer(function(commandResult) { 25 InspectorTest.addConsoleViewSniffer(function(commandResult) {
33 callback(commandResult.toMessageElement().deepTextContent()); 26 callback(commandResult.toMessageElement().deepTextContent());
34 }); 27 });
35 } 28 }
36 29
37 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky) 30 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky)
38 { 31 {
39 var sniffer = function (viewMessage) { 32 var sniffer = function (viewMessage) {
40 override(viewMessage); 33 override(viewMessage);
41 }; 34 };
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (consoleView._visibleViewMessages.length === expectedCount) { 402 if (consoleView._visibleViewMessages.length === expectedCount) {
410 InspectorTest.addResult("Message count: " + expectedCount); 403 InspectorTest.addResult("Message count: " + expectedCount);
411 callback(); 404 callback();
412 } else { 405 } else {
413 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 406 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
414 } 407 }
415 } 408 }
416 } 409 }
417 410
418 } 411 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-auto-completion.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698