| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
| 8 | 8 |
| 9 import junit.framework.Assert; | 9 import junit.framework.Assert; |
| 10 | 10 |
| 11 import org.chromium.base.test.util.DisabledTest; | 11 import org.chromium.base.test.util.DisabledTest; |
| 12 import org.chromium.base.test.util.UrlUtils; | 12 import org.chromium.base.test.util.UrlUtils; |
| 13 import org.chromium.content.browser.test.util.Criteria; | 13 import org.chromium.content.browser.test.util.Criteria; |
| 14 import org.chromium.content.browser.test.util.CriteriaHelper; | 14 import org.chromium.content.browser.test.util.CriteriaHelper; |
| 15 import org.chromium.content.browser.test.util.DOMUtils; | 15 import org.chromium.content.browser.test.util.DOMUtils; |
| 16 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 16 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
| 17 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPage
FinishedHelper; | 17 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPage
FinishedHelper; |
| 18 import org.chromium.content_public.browser.LoadUrlParams; |
| 18 import org.chromium.content_shell_apk.ContentShellTestBase; | 19 import org.chromium.content_shell_apk.ContentShellTestBase; |
| 19 | 20 |
| 20 import java.util.concurrent.TimeUnit; | 21 import java.util.concurrent.TimeUnit; |
| 21 | 22 |
| 23 /** |
| 24 * Provides test environment for Gesture Detector Reset for Content Shell. |
| 25 * This is a helper class for Content Shell tests. |
| 26 */ |
| 22 public class GestureDetectorResetTest extends ContentShellTestBase { | 27 public class GestureDetectorResetTest extends ContentShellTestBase { |
| 23 private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(2); | 28 private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(2); |
| 24 private static final String CLICK_TEST_URL = UrlUtils.encodeHtmlDataUri( | 29 private static final String CLICK_TEST_URL = UrlUtils.encodeHtmlDataUri( |
| 25 "<html><body>" + | 30 "<html><body>" + |
| 26 "<button id=\"button\" " + | 31 "<button id=\"button\" " + |
| 27 " onclick=\"document.getElementById('test').textContent = 'clicked'
;\">" + | 32 " onclick=\"document.getElementById('test').textContent = 'clicked'
;\">" + |
| 28 "Button" + | 33 "Button" + |
| 29 "</button><br/>" + | 34 "</button><br/>" + |
| 30 "<div id=\"test\">not clicked</div><br/>" + | 35 "<div id=\"test\">not clicked</div><br/>" + |
| 31 "</body></html>"); | 36 "</body></html>"); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 new LoadUrlParams(CLICK_TEST_URL)); | 129 new LoadUrlParams(CLICK_TEST_URL)); |
| 125 } | 130 } |
| 126 }); | 131 }); |
| 127 onPageFinishedHelper.waitForCallback(currentCallCount, 1, | 132 onPageFinishedHelper.waitForCallback(currentCallCount, 1, |
| 128 WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS); | 133 WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS); |
| 129 | 134 |
| 130 // Test that the button click still works. | 135 // Test that the button click still works. |
| 131 verifyClicksAreRegistered("after direct navigation", viewCore); | 136 verifyClicksAreRegistered("after direct navigation", viewCore); |
| 132 } | 137 } |
| 133 } | 138 } |
| OLD | NEW |