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

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

Issue 98853009: Fixing Java style issues in android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bo's nits Created 7 years 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: 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));
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698