OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.widget.OverScroller; | 10 import android.widget.OverScroller; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 0, overScrollDeltaY, | 531 0, overScrollDeltaY, |
532 oneStep, | 532 oneStep, |
533 null /* completionLatch */); | 533 null /* completionLatch */); |
534 overScrollByCallbackHelper.waitForCallback(overScrollCallCount); | 534 overScrollByCallbackHelper.waitForCallback(overScrollCallCount); |
535 assertEquals(0, overScrollByCallbackHelper.getDeltaX()); | 535 assertEquals(0, overScrollByCallbackHelper.getDeltaX()); |
536 assertTrue(0 > overScrollByCallbackHelper.getDeltaY()); | 536 assertTrue(0 > overScrollByCallbackHelper.getDeltaY()); |
537 | 537 |
538 assertScrollOnMainSync(testContainerView, 0, 0); | 538 assertScrollOnMainSync(testContainerView, 0, 0); |
539 } | 539 } |
540 | 540 |
541 @SmallTest | 541 /** |
| 542 * Temporarily disabled. |
| 543 * Disabled for pinch virtual viewport mode. In virtual viewport mode the wi
ndow.scrollTo() |
| 544 * method used to scroll the viewport applies scroll to the outer viewport,
which is unchanged |
| 545 * by the page scale. This test should be rewritten to account for this. |
| 546 */ |
| 547 @DisabledTest |
542 @Feature({"AndroidWebView"}) | 548 @Feature({"AndroidWebView"}) |
543 public void testScrollToBottomAtPageScaleX0dot5() throws Throwable { | 549 public void testScrollToBottomAtPageScaleX0dot5() throws Throwable { |
544 // The idea behind this test is to check that scrolling to the bottom on
ther renderer side | 550 // The idea behind this test is to check that scrolling to the bottom on
ther renderer side |
545 // results in the view also reporting as being scrolled to the bottom. | 551 // results in the view also reporting as being scrolled to the bottom. |
546 final TestAwContentsClient contentsClient = new TestAwContentsClient(); | 552 final TestAwContentsClient contentsClient = new TestAwContentsClient(); |
547 final ScrollTestContainerView testContainerView = | 553 final ScrollTestContainerView testContainerView = |
548 (ScrollTestContainerView) createAwTestContainerViewOnMainSync(co
ntentsClient); | 554 (ScrollTestContainerView) createAwTestContainerViewOnMainSync(co
ntentsClient); |
549 enableJavaScriptOnUiThread(testContainerView.getAwContents()); | 555 enableJavaScriptOnUiThread(testContainerView.getAwContents()); |
550 | 556 |
551 final int targetScrollXCss = 1000; | 557 final int targetScrollXCss = 1000; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 assertTrue(String.format(Locale.ENGLISH, | 841 assertTrue(String.format(Locale.ENGLISH, |
836 "Scroll range should increase after zoom (%d) > (%d)", | 842 "Scroll range should increase after zoom (%d) > (%d)", |
837 newScrollRange, oldScrollRange), newScrollRange > oldScr
ollRange); | 843 newScrollRange, oldScrollRange), newScrollRange > oldScr
ollRange); |
838 assertEquals(awContents.getContentHeightCss(), oldContentHeightA
pproximation); | 844 assertEquals(awContents.getContentHeightCss(), oldContentHeightA
pproximation); |
839 assertEquals(awContents.getContentHeightCss(), newContentHeightA
pproximation); | 845 assertEquals(awContents.getContentHeightCss(), newContentHeightA
pproximation); |
840 } | 846 } |
841 }); | 847 }); |
842 | 848 |
843 } | 849 } |
844 } | 850 } |
OLD | NEW |