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

COVERAGE SUMMARY FOR SOURCE FILE [TestContentViewClientWrapper.java]

nameclass, %method, %block, %line, %
TestContentViewClientWrapper.java100% (1/1)25%  (3/12)27%  (26/96)25%  (7.4/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestContentViewClientWrapper100% (1/1)25%  (3/12)27%  (26/96)25%  (7.4/29)
getSelectActionModeCallback (Context, SelectActionModeCallback$ActionHandler,... 0%   (0/1)0%   (0/7)0%   (0/1)
onContextualActionBarHidden (): void 0%   (0/1)0%   (0/6)0%   (0/3)
onContextualActionBarShown (): void 0%   (0/1)0%   (0/6)0%   (0/3)
onImeEvent (): void 0%   (0/1)0%   (0/6)0%   (0/3)
onRendererCrash (boolean): void 0%   (0/1)0%   (0/8)0%   (0/3)
onStartContentIntent (Context, String): void 0%   (0/1)0%   (0/10)0%   (0/3)
onUpdateTitle (String): void 0%   (0/1)0%   (0/8)0%   (0/3)
shouldOverrideKeyEvent (KeyEvent): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
shouldOverrideScroll (float, float, float, float): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
TestContentViewClientWrapper (ContentViewClient): void 100% (1/1)71%  (10/14)90%  (3.6/4)
<static initializer> 100% (1/1)75%  (6/8)75%  (0.8/1)
onScaleChanged (float, float): void 100% (1/1)100% (10/10)100% (3/3)

1// Copyright (c) 2013 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.content.browser.test.util;
6 
7import android.content.Context;
8import android.view.ActionMode;
9import android.view.KeyEvent;
10 
11import org.chromium.content.browser.ContentViewClient;
12import org.chromium.content.browser.SelectActionModeCallback;
13import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
14import org.chromium.content.browser.test.util.TestContentViewClient;
15 
16/**
17 * Simplistic {@link TestContentViewClient} for browser tests.
18 * Wraps around existing client so that specific methods can be overridden if needed.
19 * This class MUST override ALL METHODS OF the ContentViewClient and pass them
20 * to the wrapped client.
21 */
22public class TestContentViewClientWrapper extends TestContentViewClient {
23 
24    private ContentViewClient mWrappedClient;
25 
26    public TestContentViewClientWrapper(ContentViewClient wrappedClient) {
27        assert wrappedClient != null;
28        mWrappedClient = wrappedClient;
29    }
30 
31    @Override
32    public void onUpdateTitle(String title) {
33        super.onUpdateTitle(title);
34        mWrappedClient.onUpdateTitle(title);
35    }
36 
37    @Override
38    public void onScaleChanged(float oldScale, float newScale) {
39        super.onScaleChanged(oldScale, newScale);
40        mWrappedClient.onScaleChanged(oldScale, newScale);
41    }
42 
43    @Override
44    public void onRendererCrash(boolean processWasOomProtected) {
45        super.onRendererCrash(processWasOomProtected);
46        mWrappedClient.onRendererCrash(processWasOomProtected);
47    }
48 
49    @Override
50    public boolean shouldOverrideKeyEvent(KeyEvent event) {
51        return mWrappedClient.shouldOverrideKeyEvent(event);
52    }
53 
54    @Override
55    public void onImeEvent() {
56        super.onImeEvent();
57        mWrappedClient.onImeEvent();
58    }
59 
60    @Override
61    public boolean shouldOverrideScroll(float deltaX, float deltaY, float currX, float currY) {
62        return mWrappedClient.shouldOverrideScroll(deltaX, deltaY, currX, currX);
63    }
64 
65    @Override
66    public ActionMode.Callback getSelectActionModeCallback(
67            Context context, ActionHandler actionHandler, boolean incognito) {
68        return mWrappedClient.getSelectActionModeCallback(context, actionHandler, incognito);
69    }
70 
71    @Override
72    public void onContextualActionBarShown() {
73        super.onContextualActionBarShown();
74        mWrappedClient.onContextualActionBarShown();
75    }
76 
77    @Override
78    public void onContextualActionBarHidden() {
79        super.onContextualActionBarHidden();
80        mWrappedClient.onContextualActionBarHidden();
81    }
82 
83    @Override
84    public void onStartContentIntent(Context context, String contentUrl) {
85        super.onStartContentIntent(context, contentUrl);
86        mWrappedClient.onStartContentIntent(context, contentUrl);
87    }
88}

[all classes][org.chromium.content.browser.test.util]
EMMA 2.0.5312 (C) Vladimir Roubtsov