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 [KeyUtils.java]

nameclass, %method, %block, %line, %
KeyUtils.java0%   (0/1)0%   (0/6)0%   (0/77)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class KeyUtils0%   (0/1)0%   (0/6)0%   (0/77)0%   (0/20)
KeyUtils (): void 0%   (0/1)0%   (0/3)0%   (0/1)
inputString (Instrumentation, String): void 0%   (0/1)0%   (0/6)0%   (0/3)
pressBack (Instrumentation): void 0%   (0/1)0%   (0/17)0%   (0/4)
pressBackspace (Instrumentation): void 0%   (0/1)0%   (0/17)0%   (0/4)
pressEnter (Instrumentation): void 0%   (0/1)0%   (0/17)0%   (0/4)
pressTab (Instrumentation): void 0%   (0/1)0%   (0/17)0%   (0/4)

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.content.browser.test.util;
6 
7import android.app.Instrumentation;
8import android.view.KeyEvent;
9 
10/**
11 * Collection of keyboard utilities.
12 */
13public class KeyUtils {
14    /**
15     * Press "Enter".
16     */
17    public static void pressEnter(Instrumentation instrumentation) {
18        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN,
19                        KeyEvent.KEYCODE_ENTER));
20        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_UP,
21                        KeyEvent.KEYCODE_ENTER));
22        instrumentation.waitForIdleSync();
23    }
24 
25    /**
26     * Press "Tab".
27     */
28    public static void pressTab(Instrumentation instrumentation) {
29        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN,
30                        KeyEvent.KEYCODE_TAB));
31        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_UP,
32                        KeyEvent.KEYCODE_TAB));
33        instrumentation.waitForIdleSync();
34    }
35 
36    /**
37     * Press "Backspace".
38     */
39    public static void pressBackspace(Instrumentation instrumentation) {
40        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN,
41                        KeyEvent.KEYCODE_DEL));
42        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_UP,
43                        KeyEvent.KEYCODE_DEL));
44        instrumentation.waitForIdleSync();
45    }
46 
47    /**
48     * Press "Back".
49     */
50    public static void pressBack(Instrumentation instrumentation) {
51        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN,
52                        KeyEvent.KEYCODE_BACK));
53        instrumentation.sendKeySync(new KeyEvent(KeyEvent.ACTION_UP,
54                        KeyEvent.KEYCODE_BACK));
55        instrumentation.waitForIdleSync();
56    }
57 
58    /**
59     * Input a String.
60     */
61    public static void inputString(Instrumentation instrumentation, String text) {
62        instrumentation.sendStringSync(text);
63        instrumentation.waitForIdleSync();
64    }
65}

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