summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 03:23:50 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 03:23:50 +0000
commitff9ded65307d32a6d141a441ae342218eadfe910 (patch)
treed774066f13ad7c6c522d9383fcda997265cf0c5c /android_webview
parent557d0b9fc260031413aa035d7bf923aa54d97352 (diff)
downloadchromium_src-ff9ded65307d32a6d141a441ae342218eadfe910.zip
chromium_src-ff9ded65307d32a6d141a441ae342218eadfe910.tar.gz
chromium_src-ff9ded65307d32a6d141a441ae342218eadfe910.tar.bz2
Deflake testUnknownTypeUnrecognizedNode
This test seem to trigger the below DCHECK spuriously: [FATAL:gesture_event_filter.cc(142)] Check failed: deferred_tap_down_event_.type == WebInputEvent::Undefined (17 vs. -1) Seems like touch->gesture conversion code is getting confused about sending only ACTION_DOWN events in the test, so fix by sending both down and up. This also revealed a potential flake point in testUnknownTypeUnrecognizedNode that the hit test hits the previous page, which is fixed here by waiting for the title to update. BUG= Android/Java only change. Ran through android trybot. NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11415110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java
index 59bd7c1..6a650d8 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java
@@ -67,11 +67,14 @@ public class WebKitHitTestTest extends AndroidWebViewTestBase {
@Override
public void run() {
long eventTime = SystemClock.uptimeMillis();
+ float x = (float)(mTestView.getRight() - mTestView.getLeft()) / 2;
+ float y = (float)(mTestView.getBottom() - mTestView.getTop()) / 2;
mAwContents.onTouchEvent(MotionEvent.obtain(
eventTime, eventTime, MotionEvent.ACTION_DOWN,
- (float)(mTestView.getRight() - mTestView.getLeft()) / 2,
- (float)(mTestView.getBottom() - mTestView.getTop()) / 2,
- 0));
+ x, y, 0));
+ mAwContents.onTouchEvent(MotionEvent.obtain(
+ eventTime, eventTime, MotionEvent.ACTION_UP,
+ x, y, 0));
}
});
}
@@ -226,9 +229,20 @@ public class WebKitHitTestTest extends AndroidWebViewTestBase {
// this test to be valid.
testSrcAnchorType();
- String page = CommonResources.makeHtmlPageFrom("",
+ final String title = "UNKNOWN_TYPE title";
+
+ String page = CommonResources.makeHtmlPageFrom(
+ "<title>" + title + "</title>",
"<div class=\"full_view\">div text</div>");
setServerResponseAndLoad(page);
+
+ // Wait for the new page to be loaded before trying hit test.
+ pollOnUiThread(new Callable<Boolean>() {
+ @Override
+ public Boolean call() {
+ return mAwContents.getContentViewCore().getTitle().equals(title);
+ }
+ });
simulateTouchCenterOfWebViewOnUiThread();
assertTrue(pollForHitTestDataOnUiThread(HitTestResult.UNKNOWN_TYPE, null));
}