EMMA Coverage Report (generated Tue Aug 20 10:07:21 PDT 2013)
[all classes][org.chromium.android_webview.test]

COVERAGE SUMMARY FOR SOURCE FILE [AwContentsClientOnScaleChangedTest.java]

nameclass, %method, %block, %line, %
AwContentsClientOnScaleChangedTest.java0%   (0/1)0%   (0/4)0%   (0/90)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AwContentsClientOnScaleChangedTest0%   (0/1)0%   (0/4)0%   (0/90)0%   (0/16)
AwContentsClientOnScaleChangedTest (): void 0%   (0/1)0%   (0/3)0%   (0/1)
setUp (): void 0%   (0/1)0%   (0/17)0%   (0/5)
tearDown (): void 0%   (0/1)0%   (0/3)0%   (0/2)
testScaleUp (): void 0%   (0/1)0%   (0/67)0%   (0/8)

1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4 
5package org.chromium.android_webview.test;
6 
7import android.test.suitebuilder.annotation.SmallTest;
8 
9import org.chromium.android_webview.AwContents;
10import org.chromium.base.test.util.DisabledTest;
11import org.chromium.content.browser.ContentViewCore;
12import org.chromium.content.browser.test.util.CallbackHelper;
13import org.chromium.android_webview.test.util.CommonResources;
14 
15import android.util.Log;
16 
17/**
18 * Tests for the WebViewClient.onScaleChanged.
19 */
20public class AwContentsClientOnScaleChangedTest extends AwTestBase {
21    private TestAwContentsClient mContentsClient;
22    private AwContents mAwContents;
23 
24    @Override
25    protected void setUp() throws Exception {
26        super.setUp();
27        mContentsClient = new TestAwContentsClient();
28        AwTestContainerView testContainerView =
29                createAwTestContainerViewOnMainSync(mContentsClient);
30        mAwContents = testContainerView.getAwContents();
31    }
32 
33    @Override
34    protected void tearDown() throws Exception {
35        super.tearDown();
36    }
37 
38    /*
39    @SmallTest
40    This test is timing out on ICS bots including cq. See crbug.com/175854.
41    */
42    @DisabledTest
43    public void testScaleUp() throws Throwable {
44        getAwSettingsOnUiThread(mAwContents).setUseWideViewPort(true);
45        loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
46                CommonResources.ABOUT_HTML, "text/html", false);
47        ContentViewCore core = mAwContents.getContentViewCore();
48        int callCount = mContentsClient.getOnScaleChangedHelper().getCallCount();
49        core.onSizeChanged(
50                core.getViewportWidthPix() / 2, core.getViewportHeightPix() / 2,
51                core.getViewportWidthPix(), core.getViewportHeightPix());
52        // TODO: Investigate on using core.zoomIn();
53        mContentsClient.getOnScaleChangedHelper().waitForCallback(callCount);
54        assertTrue("Scale ratio:" + mContentsClient.getOnScaleChangedHelper().getLastScaleRatio(),
55                mContentsClient.getOnScaleChangedHelper().getLastScaleRatio() < 1);
56    }
57}

[all classes][org.chromium.android_webview.test]
EMMA 2.0.5312 (C) Vladimir Roubtsov