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

Unified Diff: chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js

Issue 83483004: End to End browser test for the virtual keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api-tests
Patch Set: Fixed nits. Created 7 years 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/chromeos/virtual_keyboard/end_to_end_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/chromeos/virtual_keyboard/end_to_end_test.js
diff --git a/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js b/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..6b268e9e92161c27a1215f48d84641e5f45415a8
--- /dev/null
+++ b/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2013 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.
+ */
+
+var kb = document.getElementById('keyboard');
+
+/**
+ * Finds the character specified and types it. Assumes that the default
+ * layout is qwerty, and the default keyset is lower.
+ * @param {{string}} char The character to type.
+ */
+var type = function(char) {
+ var keyset = kb.querySelector('#qwerty-lower');
+ var keys = Array.prototype.slice.call(keyset.querySelectorAll('kb-key'));
+ var key = keys.filter(function(key) {
+ return key.charValue == char;
+ })[0];
+ key.down({pointerId: 1});
+ key.up({pointerId: 1});
+}
+
+if (kb.isReady()) {
+ type('a');
+} else {
+ kb.addKeysetChangedObserver(function() {
+ if (kb.isReady())
+ type('a');
+ });
+}
« no previous file with comments | « chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698