OLD | NEW |
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 * @param {string} code | 1103 * @param {string} code |
1104 * @param {function(string)} callback | 1104 * @param {function(string)} callback |
1105 */ | 1105 */ |
1106 TestSuite.prototype.evaluateInConsole_ = function(code, callback) | 1106 TestSuite.prototype.evaluateInConsole_ = function(code, callback) |
1107 { | 1107 { |
1108 function innerEvaluate() | 1108 function innerEvaluate() |
1109 { | 1109 { |
1110 WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionCo
ntext, showConsoleAndEvaluate, this); | 1110 WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionCo
ntext, showConsoleAndEvaluate, this); |
1111 var consoleView = WebInspector.ConsoleView.instance(); | 1111 var consoleView = WebInspector.ConsoleView.instance(); |
1112 consoleView._prompt.setText(code); | 1112 consoleView._prompt.setText(code); |
1113 consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter
")); | 1113 consoleView._prompt.element.dispatchEvent(TestSuite.createKeyEvent("Ente
r")); |
1114 | 1114 |
1115 this.addSniffer(WebInspector.ConsoleView.prototype, "_consoleMessageAdde
dForTest", | 1115 this.addSniffer(WebInspector.ConsoleView.prototype, "_consoleMessageAdde
dForTest", |
1116 function(viewMessage) { | 1116 function(viewMessage) { |
1117 callback(viewMessage.toMessageElement().deepTextContent()); | 1117 callback(viewMessage.toMessageElement().deepTextContent()); |
1118 }.bind(this)); | 1118 }.bind(this)); |
1119 } | 1119 } |
1120 | 1120 |
1121 function showConsoleAndEvaluate() | 1121 function showConsoleAndEvaluate() |
1122 { | 1122 { |
1123 WebInspector.console.showPromise().then(innerEvaluate.bind(this)); | 1123 WebInspector.console.showPromise().then(innerEvaluate.bind(this)); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 /** | 1212 /** |
1213 * Key event with given key identifier. | 1213 * Key event with given key identifier. |
1214 */ | 1214 */ |
1215 TestSuite.createKeyEvent = function(key) | 1215 TestSuite.createKeyEvent = function(key) |
1216 { | 1216 { |
1217 return new KeyboardEvent("keydown", {bubbles: true, cancelable:true, key: ke
y}); | 1217 return new KeyboardEvent("keydown", {bubbles: true, cancelable:true, key: ke
y}); |
1218 }; | 1218 }; |
1219 | 1219 |
1220 window.uiTests = new TestSuite(window.domAutomationController); | 1220 window.uiTests = new TestSuite(window.domAutomationController); |
1221 })(window); | 1221 })(window); |
OLD | NEW |