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

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: Rebase + fixed nits. Created 7 years, 1 month 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
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..eaf194a9d95f3c2aa225c0ad1b7d27cd0293c63c
--- /dev/null
+++ b/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js
@@ -0,0 +1,30 @@
+/*
+ * 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
miket_OOO 2013/12/03 17:20:27 semicolon
rsadam 2013/12/03 18:57:27 Done.
+ })[0];
+ key.down({pointerId: 1})
+ key.up({pointerId: 1})
+}
+
+if(kb.isReady()) {
+ type('a');
+} else {
+ kb.addKeysetChangedObserver(function() {
+ type('a');
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698