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

Unified Diff: chrome/test/data/extensions/api_test/input/test.js

Issue 3130029: Lands http://codereview.chromium.org/3153008 for bryeung: (Closed)
Patch Set: YAM Created 10 years, 4 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
« no previous file with comments | « chrome/test/data/extensions/api_test/input/test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/input/test.js
diff --git a/chrome/test/data/extensions/api_test/input/test.js b/chrome/test/data/extensions/api_test/input/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..2506400d4370eba7904a9ea6c1d8f634e7e9e1ba
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/input/test.js
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// experimental.input API test for Chrome
+// browser_tests --gtest_filter=ExtensionApiTest.Input
+
+chrome.test.runTests([
+ function sendKeyboardEvent() {
+ var e = { 'type': 'keydown', 'keyIdentifier': 'A' };
+ chrome.experimental.input.sendKeyboardEvent(e, function() {
+ if (chrome.extension.lastError) {
+ // this is expected for now: no one is handling keys yet
+ // chrome.test.fail();
+ }
+ // when the browser is listening to events, we should check that
+ // this event was delivered as we expected. For now, just succeed.
+ chrome.test.succeed();
+ });
+ },
+
+ function badKeyIdentifier() {
+ var e = { 'type': 'keydown', 'keyIdentifier': 'BogusId' };
+ chrome.experimental.input.sendKeyboardEvent(e, function() {
+ if (!chrome.extension.lastError) {
+ chrome.test.fail();
+ }
+ chrome.test.succeed();
+ });
+ },
+
+ function badEventType() {
+ var e = { 'type': 'BAD', 'keyIdentifier': 'A' };
+ chrome.experimental.input.sendKeyboardEvent(e, function() {
+ if (!chrome.extension.lastError) {
+ chrome.test.fail();
+ }
+ chrome.test.succeed();
+ });
+ },
+
+ function unmappedKeyIdentifier() {
+ var e = { 'type': 'keydown', 'keyIdentifier': 'Again' };
+ chrome.experimental.input.sendKeyboardEvent(e, function() {
+ if (!chrome.extension.lastError) {
+ chrome.test.fail();
+ }
+ chrome.test.succeed();
+ });
+ },
+]);
« no previous file with comments | « chrome/test/data/extensions/api_test/input/test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698