This source file includes following definitions.
- setUp
- tearDown
- testScaleUp
package org.chromium.android_webview.test;
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.content.browser.ContentViewCore;
public class AwContentsClientOnScaleChangedTest extends AwTestBase {
private TestAwContentsClient mContentsClient;
private AwContents mAwContents;
@Override
protected void setUp() throws Exception {
super.setUp();
mContentsClient = new TestAwContentsClient();
AwTestContainerView testContainerView =
createAwTestContainerViewOnMainSync(mContentsClient);
mAwContents = testContainerView.getAwContents();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
@DisabledTest
public void testScaleUp() throws Throwable {
getAwSettingsOnUiThread(mAwContents).setUseWideViewPort(true);
loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
CommonResources.ABOUT_HTML, "text/html", false);
ContentViewCore core = mAwContents.getContentViewCore();
int callCount = mContentsClient.getOnScaleChangedHelper().getCallCount();
core.onSizeChanged(
core.getViewportWidthPix() / 2, core.getViewportHeightPix() / 2,
core.getViewportWidthPix(), core.getViewportHeightPix());
mContentsClient.getOnScaleChangedHelper().waitForCallback(callCount);
assertTrue("Scale ratio:" + mContentsClient.getOnScaleChangedHelper().getLastScaleRatio(),
mContentsClient.getOnScaleChangedHelper().getLastScaleRatio() < 1);
}
}