ClickListenerTest.java revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
1// Copyright 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. 4 5package org.chromium.content.browser; 6 7import org.chromium.base.test.util.DisabledTest; 8 9/** 10 * Test suite for click listener validation in content detection. 11 */ 12public class ClickListenerTest extends ContentDetectionTestBase { 13 14 /* 15 @MediumTest 16 @Feature({"ContentDetection", "TabContents"}) 17 http://crbug.com/172786 18 */ 19 @DisabledTest 20 public void testClickContentOnLink() throws Throwable { 21 startActivityWithTestUrl("content/content_detection/click_listeners.html"); 22 23 // Clicks on addresses in links should change the url. 24 scrollAndTapNavigatingOut("linktest"); 25 assertTrue(isCurrentTestUrl("content/content_detection/empty.html")); 26 } 27 28 /* 29 @MediumTest 30 @Feature({"ContentDetection", "TabContents"}) 31 http://crbug.com/172786 32 */ 33 @DisabledTest 34 public void testClickContentOnJSListener1() throws Throwable { 35 startActivityWithTestUrl("content/content_detection/click_listeners.html"); 36 37 // Clicks on addresses in elements listening to click events should be 38 // processed normally without address detection. 39 scrollAndTapNavigatingOut("clicktest1"); 40 assertTrue(isCurrentTestUrl("content/content_detection/empty.html")); 41 } 42 43 /* 44 @MediumTest 45 @Feature({"ContentDetection", "TabContents"}) 46 http://crbug.com/172786 47 */ 48 @DisabledTest 49 public void testClickContentOnJSListener2() throws Throwable { 50 startActivityWithTestUrl("content/content_detection/click_listeners.html"); 51 52 // Same as previous test, but using addEventListener instead of onclick. 53 scrollAndTapNavigatingOut("clicktest2"); 54 assertTrue(isCurrentTestUrl("content/content_detection/empty.html")); 55 } 56} 57