Index: android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java |
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 baa29c21508c48992b3f7b63e352199cdbd56018..1304002ec1b795a76724b23d7903761eb9fdf583 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 |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2012 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. |
@@ -63,8 +63,8 @@ public class WebKitHitTestTest extends AwTestBase { |
@Override |
public void run() { |
long eventTime = SystemClock.uptimeMillis(); |
- float x = (float)(mTestView.getRight() - mTestView.getLeft()) / 2; |
- float y = (float)(mTestView.getBottom() - mTestView.getTop()) / 2; |
+ 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, |
x, y, 0)); |
@@ -200,7 +200,7 @@ public class WebKitHitTestTest extends AwTestBase { |
setServerResponseAndLoad(page); |
simulateInput(byTouch); |
assertTrue(pollForHitTestDataOnUiThread(HitTestResult.EMAIL_TYPE, email)); |
- assertTrue(pollForHrefAndImageSrcOnUiThread(prefix+ email, ANCHOR_TEXT, null)); |
+ assertTrue(pollForHrefAndImageSrcOnUiThread(prefix + email, ANCHOR_TEXT, null)); |
} |
@SmallTest |
@@ -371,39 +371,39 @@ public class WebKitHitTestTest extends AwTestBase { |
@LargeTest |
@Feature({"AndroidWebView", "WebKitHitTest"}) |
public void testUnfocusedNodeAndTouchRace() throws Throwable { |
- // Test when the touch and focus paths racing with setting different |
- // results. |
- |
- String relImageSrc = "/nonexistent3.jpg"; |
- String fullImageSrc = mWebServer.getResponseUrl(relImageSrc); |
- String html = CommonResources.makeHtmlPageFrom( |
- "<meta name=\"viewport\" content=\"width=device-width,height=device-height\" />" + |
- "<style type=\"text/css\">" + |
- ".full_width { width:100%; position:absolute; }" + |
- "</style>", |
- "<form><input class=\"full_width\" style=\"height:25%;\" " + |
- "type=\"text\" name=\"test\"></form>" + |
- "<img class=\"full_width\" style=\"height:50%;top:25%;\" " + |
- "src=\"" + relImageSrc + "\">"); |
- setServerResponseAndLoad(html); |
- |
- // Focus on input element and check the hit test results. |
- simulateTabDownUpOnUiThread(); |
- assertTrue(pollForHitTestDataOnUiThread( |
- HitTestResult.EDIT_TEXT_TYPE, null)); |
- assertTrue(pollForHrefAndImageSrcOnUiThread(null, null, null)); |
- |
- // Touch image. Now the focus based hit test path will try to null out |
- // the results and the touch based path will update with the result of |
- // the image. |
- simulateTouchCenterOfWebViewOnUiThread(); |
- |
- // Make sure the result of image sticks. |
- for (int i = 0; i < 2; ++i) { |
- Thread.sleep(500); |
+ // Test when the touch and focus paths racing with setting different |
+ // results. |
+ |
+ String relImageSrc = "/nonexistent3.jpg"; |
+ String fullImageSrc = mWebServer.getResponseUrl(relImageSrc); |
+ String html = CommonResources.makeHtmlPageFrom( |
+ "<meta name=\"viewport\" content=\"width=device-width,height=device-height\" />" + |
+ "<style type=\"text/css\">" + |
+ ".full_width { width:100%; position:absolute; }" + |
+ "</style>", |
+ "<form><input class=\"full_width\" style=\"height:25%;\" " + |
+ "type=\"text\" name=\"test\"></form>" + |
+ "<img class=\"full_width\" style=\"height:50%;top:25%;\" " + |
+ "src=\"" + relImageSrc + "\">"); |
+ setServerResponseAndLoad(html); |
+ |
+ // Focus on input element and check the hit test results. |
+ simulateTabDownUpOnUiThread(); |
assertTrue(pollForHitTestDataOnUiThread( |
- HitTestResult.IMAGE_TYPE, fullImageSrc)); |
- assertTrue(pollForHrefAndImageSrcOnUiThread(null, null, fullImageSrc)); |
- } |
+ HitTestResult.EDIT_TEXT_TYPE, null)); |
+ assertTrue(pollForHrefAndImageSrcOnUiThread(null, null, null)); |
+ |
+ // Touch image. Now the focus based hit test path will try to null out |
+ // the results and the touch based path will update with the result of |
+ // the image. |
+ simulateTouchCenterOfWebViewOnUiThread(); |
+ |
+ // Make sure the result of image sticks. |
+ for (int i = 0; i < 2; ++i) { |
+ Thread.sleep(500); |
+ assertTrue(pollForHitTestDataOnUiThread( |
+ HitTestResult.IMAGE_TYPE, fullImageSrc)); |
+ assertTrue(pollForHrefAndImageSrcOnUiThread(null, null, fullImageSrc)); |
+ } |
} |
} |