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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/Tests.js

Issue 1820393002: DevTools: [ux regression] There is no way to clear console history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 * Evaluates the code in the console as if user typed it manually and invokes 971 * Evaluates the code in the console as if user typed it manually and invokes
972 * the callback when the result message is received and added to the console. 972 * the callback when the result message is received and added to the console.
973 * @param {string} code 973 * @param {string} code
974 * @param {function(string)} callback 974 * @param {function(string)} callback
975 */ 975 */
976 TestSuite.prototype.evaluateInConsole_ = function(code, callback) 976 TestSuite.prototype.evaluateInConsole_ = function(code, callback)
977 { 977 {
978 function innerEvaluate() 978 function innerEvaluate()
979 { 979 {
980 WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionCo ntext, showConsoleAndEvaluate, this); 980 WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionCo ntext, showConsoleAndEvaluate, this);
981 var consoleView = WebInspector.ConsolePanel._view(); 981 var consoleView = WebInspector.ConsoleView.instance();
982 consoleView._prompt.setText(code); 982 consoleView._prompt.setText(code);
983 consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter ")); 983 consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter "));
984 984
985 this.addSniffer(WebInspector.ConsoleView.prototype, "_consoleMessageAdde dForTest", 985 this.addSniffer(WebInspector.ConsoleView.prototype, "_consoleMessageAdde dForTest",
986 function(viewMessage) { 986 function(viewMessage) {
987 callback(viewMessage.toMessageElement().deepTextContent()); 987 callback(viewMessage.toMessageElement().deepTextContent());
988 }.bind(this)); 988 }.bind(this));
989 } 989 }
990 990
991 function showConsoleAndEvaluate() 991 function showConsoleAndEvaluate()
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 */ 1070 */
1071 TestSuite.createKeyEvent = function(keyIdentifier) 1071 TestSuite.createKeyEvent = function(keyIdentifier)
1072 { 1072 {
1073 var evt = document.createEvent("KeyboardEvent"); 1073 var evt = document.createEvent("KeyboardEvent");
1074 evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel * /, null /* view */, keyIdentifier, ""); 1074 evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel * /, null /* view */, keyIdentifier, "");
1075 return evt; 1075 return evt;
1076 }; 1076 };
1077 1077
1078 window.uiTests = new TestSuite(window.domAutomationController); 1078 window.uiTests = new TestSuite(window.domAutomationController);
1079 })(window); 1079 })(window);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698