diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:35:54 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:35:54 +0000 |
commit | 060d4d8b30d19a4b5113ee4ceeefd49df0407967 (patch) | |
tree | eef6cce7c096188821f2a5d6f5dec3d3789e467b /webkit/glue/devtools | |
parent | 4fab4ace59c209a4f77ea39b1ad6e1d213b778f4 (diff) | |
download | chromium_src-060d4d8b30d19a4b5113ee4ceeefd49df0407967.zip chromium_src-060d4d8b30d19a4b5113ee4ceeefd49df0407967.tar.gz chromium_src-060d4d8b30d19a4b5113ee4ceeefd49df0407967.tar.bz2 |
DevTools: Restore sanity tests tests.
BUG=30418
Review URL: http://codereview.chromium.org/505005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools')
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 0eb2a42..59de44d 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -842,8 +842,8 @@ TestSuite.prototype.showMainPageScriptSource_ = function(scriptName, callback) { TestSuite.prototype.evaluateInConsole_ = function(code, callback) { WebInspector.console.visible = true; WebInspector.console.prompt.text = code; - WebInspector.console.promptElement.handleKeyEvent( - new TestSuite.KeyEvent('Enter')); + WebInspector.console.promptElement.dispatchEvent( + TestSuite.createKeyEvent('Enter')); this.addSniffer(WebInspector.ConsoleView.prototype, 'addMessage', function(commandResult) { @@ -1782,11 +1782,12 @@ TestSuite.prototype.testPauseInEval = function() { /** * Key event with given key identifier. */ -TestSuite.KeyEvent = function(key) { - this.keyIdentifier = key; +TestSuite.createKeyEvent = function(keyIdentifier) { + var evt = document.createEvent('KeyboardEvent'); + evt.initKeyboardEvent('keydown', true /* can bubble */, true /* can cancel */, + null /* view */, keyIdentifier, ""); + return evt; }; -TestSuite.KeyEvent.prototype.preventDefault = function() {}; -TestSuite.KeyEvent.prototype.stopPropagation = function() {}; /** @@ -1861,8 +1862,8 @@ TestSuite.prototype.testEvalGlobal = function() { // Do not change code below - simply add inputs and expectations above. var initEval = function(input) { WebInspector.console.prompt.text = input; - WebInspector.console.promptElement.handleKeyEvent( - new TestSuite.KeyEvent('Enter')); + WebInspector.console.promptElement.dispatchEvent( + TestSuite.createKeyEvent('Enter')); }; var test = this; var messagesCount = 0; |