| 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.pm.ActivityInfo; | 8 import android.content.pm.ActivityInfo; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
| 10 import android.view.View; | 10 import android.view.View; |
| 11 import android.view.ViewConfiguration; | 11 import android.view.ViewConfiguration; |
| 12 | 12 |
| 13 import org.chromium.android_webview.AwContents; | 13 import org.chromium.android_webview.AwContents; |
| 14 import org.chromium.android_webview.AwSettings; | 14 import org.chromium.android_webview.AwSettings; |
| 15 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
| 16 import org.chromium.base.test.util.Feature; | 16 import org.chromium.base.test.util.Feature; |
| 17 | 17 |
| 18 import java.util.Locale; | 18 import java.util.Locale; |
| 19 import java.util.concurrent.Callable; | 19 import java.util.concurrent.Callable; |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * A test suite for zooming-related methods and settings. | 22 * A test suite for zooming-related methods and settings. |
| 23 */ | 23 */ |
| 24 public class AwZoomTest extends AwTestBase { | 24 public class AwZoomTest extends AwTestBase { |
| 25 private TestAwContentsClient mContentsClient; | 25 private TestAwContentsClient mContentsClient; |
| 26 private AwContents mAwContents; | 26 private AwContents mAwContents; |
| 27 private static float MAXIMUM_SCALE = 2.0f; | 27 private static final float MAXIMUM_SCALE = 2.0f; |
| 28 | 28 |
| 29 @Override | 29 @Override |
| 30 public void setUp() throws Exception { | 30 public void setUp() throws Exception { |
| 31 super.setUp(); | 31 super.setUp(); |
| 32 mContentsClient = new TestAwContentsClient(); | 32 mContentsClient = new TestAwContentsClient(); |
| 33 final AwTestContainerView testContainerView = | 33 final AwTestContainerView testContainerView = |
| 34 createAwTestContainerViewOnMainSync(mContentsClient); | 34 createAwTestContainerViewOnMainSync(mContentsClient); |
| 35 mAwContents = testContainerView.getAwContents(); | 35 mAwContents = testContainerView.getAwContents(); |
| 36 } | 36 } |
| 37 | 37 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 activity.setRequestedOrientation(orientation); | 291 activity.setRequestedOrientation(orientation); |
| 292 invokeZoomPickerOnUiThread(); | 292 invokeZoomPickerOnUiThread(); |
| 293 | 293 |
| 294 // We may crash shortly (as the zoom picker has a short delay in it befo
re | 294 // We may crash shortly (as the zoom picker has a short delay in it befo
re |
| 295 // it tries to register it's BroadcastReceiver), so sleep to verify we d
on't. | 295 // it tries to register it's BroadcastReceiver), so sleep to verify we d
on't. |
| 296 // The delay is encoded in ZoomButtonsController#ZOOM_CONTROLS_TIMEOUT, | 296 // The delay is encoded in ZoomButtonsController#ZOOM_CONTROLS_TIMEOUT, |
| 297 // if that changes we may need to update this test. | 297 // if that changes we may need to update this test. |
| 298 Thread.sleep(ViewConfiguration.getZoomControlsTimeout()); | 298 Thread.sleep(ViewConfiguration.getZoomControlsTimeout()); |
| 299 } | 299 } |
| 300 } | 300 } |
| OLD | NEW |