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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java

Issue 2089763002: Fix android webview unit tests to dispatch correct click event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
index 2e053969c5e160f57a387d255bc54aea0255879b..306be04687e7d03ee9ff5eaba1d10aae9d851bd6 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
@@ -48,8 +48,7 @@ public class JSUtils {
@Override
public void run() {
awContents.getWebContents().evaluateJavaScriptForTests(
- "var evObj = document.createEvent('Events'); "
- + "evObj.initEvent('click', true, false); "
+ "var evObj = new MouseEvent('click', {bubbles: true});"
+ "document.getElementById('" + linkId + "').dispatchEvent(evObj);"
+ "console.log('element with id [" + linkId + "] clicked');",
null);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698