1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.content.browser;
7 import android.test.suitebuilder.annotation.MediumTest;
9 import org.chromium.base.test.util.DisabledTest;
10 import org.chromium.base.test.util.Feature;
13 * Test suite for click listener validation in content detection.
15 public class ClickListenerTest extends ContentDetectionTestBase {
19 @Feature({"ContentDetection", "TabContents"})
20 http://crbug.com/172786
23 public void testClickContentOnLink() throws Throwable {
24 startActivityWithTestUrl("content/content_detection/click_listeners.html");
26 // Clicks on addresses in links should change the url.
27 scrollAndTapNavigatingOut("linktest");
28 assertTrue(isCurrentTestUrl("content/content_detection/empty.html"));
33 @Feature({"ContentDetection", "TabContents"})
34 http://crbug.com/172786
37 public void testClickContentOnJSListener1() throws Throwable {
38 startActivityWithTestUrl("content/content_detection/click_listeners.html");
40 // Clicks on addresses in elements listening to click events should be
41 // processed normally without address detection.
42 scrollAndTapNavigatingOut("clicktest1");
43 assertTrue(isCurrentTestUrl("content/content_detection/empty.html"));
48 @Feature({"ContentDetection", "TabContents"})
49 http://crbug.com/172786
52 public void testClickContentOnJSListener2() throws Throwable {
53 startActivityWithTestUrl("content/content_detection/click_listeners.html");
55 // Same as previous test, but using addEventListener instead of onclick.
56 scrollAndTapNavigatingOut("clicktest2");
57 assertTrue(isCurrentTestUrl("content/content_detection/empty.html"));