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

COVERAGE SUMMARY FOR SOURCE FILE [TabShellTabUtils.java]

nameclass, %method, %block, %line, %
TabShellTabUtils.java0%   (0/3)0%   (0/10)0%   (0/67)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TabShellTabUtils0%   (0/1)0%   (0/4)0%   (0/36)0%   (0/8)
TabShellTabUtils (): void 0%   (0/1)0%   (0/3)0%   (0/2)
access$000 (TestShellTab): TestContentViewClient 0%   (0/1)0%   (0/3)0%   (0/1)
createTestContentViewClientForTab (TestShellTab): TestContentViewClient 0%   (0/1)0%   (0/21)0%   (0/5)
getTestCallbackHelperContainer (TestShellTab): TabShellTabUtils$TestCallbackH... 0%   (0/1)0%   (0/9)0%   (0/1)
     
class TabShellTabUtils$TestCallbackHelperContainerForTab0%   (0/1)0%   (0/5)0%   (0/28)0%   (0/9)
TabShellTabUtils$TestCallbackHelperContainerForTab (TestShellTab): void 0%   (0/1)0%   (0/19)0%   (0/4)
getOnCloseTabHelper (): TabShellTabUtils$TestCallbackHelperContainerForTab$On... 0%   (0/1)0%   (0/3)0%   (0/1)
onCloseTab (TestShellTab): void 0%   (0/1)0%   (0/4)0%   (0/2)
onLoadProgressChanged (TestShellTab, int): void 0%   (0/1)0%   (0/1)0%   (0/1)
onUpdateUrl (TestShellTab, String): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class TabShellTabUtils$TestCallbackHelperContainerForTab$OnCloseTabHelper0%   (0/1)0%   (0/1)0%   (0/3)0%   (0/1)
TabShellTabUtils$TestCallbackHelperContainerForTab$OnCloseTabHelper (): void 0%   (0/1)0%   (0/3)0%   (0/1)

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.chrome.testshell;
6 
7import org.chromium.content.browser.ContentViewClient;
8import org.chromium.content.browser.test.util.CallbackHelper;
9import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
10import org.chromium.content.browser.test.util.TestContentViewClient;
11import org.chromium.content.browser.test.util.TestContentViewClientWrapper;
12import org.chromium.content.browser.test.util.TestWebContentsObserver;
13 
14/**
15 * A utility class that contains methods generic to all Tabs tests.
16 */
17public class TabShellTabUtils {
18    private static TestContentViewClient createTestContentViewClientForTab(TestShellTab tab) {
19        ContentViewClient client = tab.getContentView().getContentViewClient();
20        if (client instanceof TestContentViewClient) return (TestContentViewClient) client;
21 
22        TestContentViewClient testClient = new TestContentViewClientWrapper(client);
23        tab.getContentView().setContentViewClient(testClient);
24        return testClient;
25    }
26 
27    public static class TestCallbackHelperContainerForTab
28            extends TestCallbackHelperContainer implements TestShellTabObserver {
29        private final OnCloseTabHelper mOnCloseTabHelper;
30        public TestCallbackHelperContainerForTab(TestShellTab tab) {
31            super(createTestContentViewClientForTab(tab),
32                    new TestWebContentsObserver(tab.getContentView().getContentViewCore()));
33            mOnCloseTabHelper = new OnCloseTabHelper();
34            tab.addObserver(this);
35        }
36 
37        public static class OnCloseTabHelper extends CallbackHelper {
38        }
39 
40        public OnCloseTabHelper getOnCloseTabHelper() {
41            return mOnCloseTabHelper;
42        }
43 
44        @Override
45        public void onLoadProgressChanged(TestShellTab tab, int progress) {
46        }
47 
48        @Override
49        public void onUpdateUrl(TestShellTab tab, String url) {
50        }
51 
52        @Override
53        public void onCloseTab(TestShellTab tab) {
54            mOnCloseTabHelper.notifyCalled();
55        }
56    }
57 
58    /**
59     * Creates, binds and returns a TestCallbackHelperContainer for a given Tab.
60     */
61    public static TestCallbackHelperContainerForTab getTestCallbackHelperContainer(
62            final TestShellTab tab) {
63        return tab == null ? null : new TestCallbackHelperContainerForTab(tab);
64    }
65}

[all classes][org.chromium.chrome.testshell]
EMMA 2.0.5312 (C) Vladimir Roubtsov