diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 03:01:50 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 03:01:50 +0000 |
commit | 3c5f0b34b61ce1e33646931bd148605b862ceed6 (patch) | |
tree | 047ebd9fb055b4fb0a5d42fb48aaf088478aad16 | |
parent | 96cc0e0b937574512d3ddf35b6039ddd630d48fd (diff) | |
download | chromium_src-3c5f0b34b61ce1e33646931bd148605b862ceed6.zip chromium_src-3c5f0b34b61ce1e33646931bd148605b862ceed6.tar.gz chromium_src-3c5f0b34b61ce1e33646931bd148605b862ceed6.tar.bz2 |
This test was almost copied from CTS, as the test explicitly set the width, it seemed that it wanted the page still wider than screen after it scaled 50%.
1000 worked at time the code written, as high resolution device came out, 1000 is too small now.
Use screen resolution will work for all devices.
BUG=230186
Review URL: https://chromiumcodereview.appspot.com/18711008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211911 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java index c445324..3732649 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java @@ -5,6 +5,7 @@ package org.chromium.android_webview.test; import android.content.Context; +import android.graphics.Point; import android.os.Build; import android.os.SystemClock; import android.test.suitebuilder.annotation.LargeTest; @@ -12,6 +13,7 @@ import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; import android.util.Pair; import android.view.MotionEvent; +import android.view.WindowManager; import android.webkit.WebSettings; import org.apache.http.Header; @@ -2346,12 +2348,8 @@ public class AwSettingsTest extends AwTestBase { views.getContents1(), views.getClient1(), true)); } - /* @SmallTest @Feature({"AndroidWebView", "Preferences"}) - This is triggering a DCHECK on Nexus 7. See crbug.com/230186. - */ - @DisabledTest public void testSetInitialScale() throws Throwable { final TestAwContentsClient contentClient = new TestAwContentsClient(); final AwTestContainerView testContainerView = @@ -2360,9 +2358,16 @@ public class AwSettingsTest extends AwTestBase { final AwSettings awSettings = getAwSettingsOnUiThread(awContents); CallbackHelper onPageFinishedHelper = contentClient.getOnPageFinishedHelper(); + WindowManager wm = (WindowManager) getInstrumentation().getTargetContext() + .getSystemService(Context.WINDOW_SERVICE); + Point screenSize = new Point(); + wm.getDefaultDisplay().getSize(screenSize); + // Make sure after 50% scale, page width still larger than screen. + int height = screenSize.y * 2 + 1; + int width = screenSize.x * 2 + 1; final String page = "<html><body>" + - "<p style='height:1000px;width:1000px'>testSetInitialScale</p>" + - "</body></html>"; + "<p style='height:"+ height + "px;width:" + width + "px'>" + + "testSetInitialScale</p></body></html>"; final float defaultScale = getInstrumentation().getTargetContext().getResources().getDisplayMetrics().density; |