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

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: Updated test name. 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..06efa181dc0dc37fb753c4c2780910feaada06b0
--- /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 char The character to type.
kevers 2013/11/22 18:50:50 nit: Missing param type.
rsadam 2013/11/25 15:21:02 Done.
+ */
+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() {
+ type('a');
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698