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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // experimental.input API test for Chrome
6 // browser_tests --gtest_filter=ExtensionApiTest.Input
7
8 chrome.test.runTests([
9 function sendKeyboardEvent() {
10 var e = { 'type': 'keydown', 'keyIdentifier': 'A' };
11 chrome.experimental.input.sendKeyboardEvent(e, function() {
12 if (chrome.extension.lastError) {
13 // this is expected for now: no one is handling keys yet
14 // chrome.test.fail();
15 }
16 // when the browser is listening to events, we should check that
17 // this event was delivered as we expected. For now, just succeed.
18 chrome.test.succeed();
19 });
20 },
21
22 function badKeyIdentifier() {
23 var e = { 'type': 'keydown', 'keyIdentifier': 'BogusId' };
24 chrome.experimental.input.sendKeyboardEvent(e, function() {
25 if (!chrome.extension.lastError) {
26 chrome.test.fail();
27 }
28 chrome.test.succeed();
29 });
30 },
31
32 function badEventType() {
33 var e = { 'type': 'BAD', 'keyIdentifier': 'A' };
34 chrome.experimental.input.sendKeyboardEvent(e, function() {
35 if (!chrome.extension.lastError) {
36 chrome.test.fail();
37 }
38 chrome.test.succeed();
39 });
40 },
41
42 function unmappedKeyIdentifier() {
43 var e = { 'type': 'keydown', 'keyIdentifier': 'Again' };
44 chrome.experimental.input.sendKeyboardEvent(e, function() {
45 if (!chrome.extension.lastError) {
46 chrome.test.fail();
47 }
48 chrome.test.succeed();
49 });
50 },
51 ]);
OLDNEW
« 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