EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.android_webview.test]

COVERAGE SUMMARY FOR SOURCE FILE [AwTestRunnerActivity.java]

nameclass, %method, %block, %line, %
AwTestRunnerActivity.java100% (1/1)100% (5/5)99%  (79/80)100% (18/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AwTestRunnerActivity100% (1/1)100% (5/5)99%  (79/80)100% (18/18)
onCreate (Bundle): void 100% (1/1)98%  (55/56)100% (11/11)
AwTestRunnerActivity (): void 100% (1/1)100% (3/3)100% (1/1)
addView (View): void 100% (1/1)100% (13/13)100% (3/3)
getRootLayoutWidth (): int 100% (1/1)100% (4/4)100% (1/1)
removeAllViews (): void 100% (1/1)100% (4/4)100% (2/2)

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.app.Activity;
8import android.os.Bundle;
9import android.util.Log;
10import android.view.View;
11import android.view.ViewGroup.LayoutParams;
12import android.view.WindowManager;
13import android.widget.LinearLayout;
14 
15/*
16 * This is a lightweight activity for tests that only require WebView functionality.
17 */
18public class AwTestRunnerActivity extends Activity {
19 
20    private LinearLayout mLinearLayout;
21 
22    @Override
23    public void onCreate(Bundle savedInstanceState) {
24        super.onCreate(savedInstanceState);
25 
26        // TODO(joth): When SW-renderer is available, we'll want to enable this on a per-test
27        // basis.
28        boolean hardwareAccelerated = true;
29        Log.i("AwTestRunnerActivity", "Is " + (hardwareAccelerated ? "" : "NOT ")
30                + "hardware accelerated");
31 
32        if (hardwareAccelerated) {
33            getWindow().setFlags(
34                    WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
35                    WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
36        }
37 
38        mLinearLayout = new LinearLayout(this);
39        mLinearLayout.setOrientation(LinearLayout.VERTICAL);
40        mLinearLayout.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
41        mLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
42                LayoutParams.WRAP_CONTENT));
43 
44        setContentView(mLinearLayout);
45    }
46 
47    public int getRootLayoutWidth() {
48        return mLinearLayout.getWidth();
49    }
50 
51    /**
52     * Adds a view to the main linear layout.
53     */
54    public void addView(View view) {
55        view.setLayoutParams(new LinearLayout.LayoutParams(
56                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1f));
57        mLinearLayout.addView(view);
58    }
59 
60    /**
61     * Clears the main linear layout.
62     */
63    public void removeAllViews() {
64        mLinearLayout.removeAllViews();
65    }
66}

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