Index: content/public/android/javatests/src/org/chromium/content/browser/ClickListenerTest.java |
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ClickListenerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ClickListenerTest.java |
index c16cb9a8e899e353314e4dd288b392d0ee0dd6e2..e5f0d49bfa1583ad41df76d3b6e9196d796116e0 100644 |
--- a/content/public/android/javatests/src/org/chromium/content/browser/ClickListenerTest.java |
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ClickListenerTest.java |
@@ -1,4 +1,4 @@ |
-// Copyright 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2017 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. |
@@ -10,45 +10,58 @@ import org.chromium.base.test.util.CommandLineFlags; |
import org.chromium.base.test.util.Feature; |
import org.chromium.base.test.util.RetryOnFailure; |
import org.chromium.content.common.ContentSwitches; |
+import org.junit.Rule; |
+import org.junit.Test; |
+import org.chromium.base.test.BaseJUnit4ClassRunner; |
+import org.junit.runner.RunWith; |
+import org.junit.Assert; |
+import org.chromium.content.browser.ContentDetectionActivityTestRule; |
/** |
* Test suite for click listener validation in content detection. |
*/ |
+@RunWith(BaseJUnit4ClassRunner.class) |
@CommandLineFlags.Add({ContentSwitches.ENABLE_CONTENT_INTENT_DETECTION}) |
-public class ClickListenerTest extends ContentDetectionTestBase { |
+public class ClickListenerTest { |
+ @Rule |
+ public ContentDetectionActivityTestRule mActivityTestRule = new ContentDetectionActivityTestRule(); |
+ |
+ @Test |
@MediumTest |
@Feature({"ContentDetection", "TabContents"}) |
@RetryOnFailure |
public void testClickContentOnLink() throws Throwable { |
- startActivityWithTestUrl( |
+ mActivityTestRule.launchContentShellWithUrlSync( |
"content/test/data/android/content_detection/click_listeners.html"); |
// Clicks on addresses in links should change the url. |
- scrollAndTapNavigatingOut("linktest"); |
- assertTrue(isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
+ mActivityTestRule.scrollAndTapNavigatingOut("linktest"); |
+ Assert.assertTrue(mActivityTestRule.isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
} |
+ @Test |
@MediumTest |
@Feature({"ContentDetection", "TabContents"}) |
public void testClickContentOnJSListener1() throws Throwable { |
- startActivityWithTestUrl( |
+ mActivityTestRule.launchContentShellWithUrlSync( |
"content/test/data/android/content_detection/click_listeners.html"); |
// Clicks on addresses in elements listening to click events should be |
// processed normally without address detection. |
- scrollAndTapNavigatingOut("clicktest1"); |
- assertTrue(isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
+ mActivityTestRule.scrollAndTapNavigatingOut("clicktest1"); |
+ Assert.assertTrue(mActivityTestRule.isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
} |
+ @Test |
@MediumTest |
@Feature({"ContentDetection", "TabContents"}) |
public void testClickContentOnJSListener2() throws Throwable { |
- startActivityWithTestUrl( |
+ mActivityTestRule.launchContentShellWithUrlSync( |
"content/test/data/android/content_detection/click_listeners.html"); |
// Same as previous test, but using addEventListener instead of onclick. |
- scrollAndTapNavigatingOut("clicktest2"); |
- assertTrue(isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
+ mActivityTestRule.scrollAndTapNavigatingOut("clicktest2"); |
+ Assert.assertTrue(mActivityTestRule.isCurrentTestUrl("content/test/data/android/content_detection/empty.html")); |
} |
} |