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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test and addressed comments. Created 4 years, 6 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
Index: chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js b/chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js
index c8c3c81045b7ce7aca4200ea35431b4925898b60..f2b6036d5e4b240c5d73b371f7c01fe325d07048 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js
@@ -47,6 +47,19 @@ var waitForFocus = function() {
inputElement.focus();
};
+var createInput = function() {
+ inputElement = document.createElement('input');
+ inputElement.addEventListener('click', function(e) {
+ sendMessage(['response-inputClicked']);
+ LOG('clicked: ' + JSON.stringify(e));
+ });
+ document.body.appendChild(inputElement);
+};
+
+var getInputValue = function() {
+ sendMessage(['response-inputValue', inputElement.value]);
+}
+
window.addEventListener('message', function(e) {
var data = JSON.parse(e.data);
if (data[0] == 'connect') {
@@ -59,6 +72,10 @@ window.addEventListener('message', function(e) {
waitForFocus();
} else if (data[0] == 'request-waitForBlurAfterFocus') {
waitForBlurAfterFocus();
+ } else if (data[0] == 'request-createInput') {
+ createInput();
+ } else if (data[0] == 'request-getInputValue') {
+ getInputValue();
}
});

Powered by Google App Engine
This is Rietveld 408576698