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

COVERAGE SUMMARY FOR SOURCE FILE [InstrumentationUtils.java]

nameclass, %method, %block, %line, %
InstrumentationUtils.java100% (1/1)50%  (1/2)61%  (11/18)43%  (3/7)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InstrumentationUtils100% (1/1)50%  (1/2)61%  (11/18)43%  (3/7)
InstrumentationUtils (): void 0%   (0/1)0%   (0/3)0%   (0/2)
runOnMainSyncAndGetResult (Instrumentation, Callable): Object 100% (1/1)73%  (11/15)60%  (3/5)

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.base.test.util;
6 
7import android.app.Instrumentation;
8 
9import java.util.concurrent.Callable;
10import java.util.concurrent.ExecutionException;
11import java.util.concurrent.FutureTask;
12 
13/**
14 * Utility methods built around the android.app.Instrumentation class.
15 */
16public final class InstrumentationUtils {
17 
18    private InstrumentationUtils() {
19    }
20 
21    public static <R> R runOnMainSyncAndGetResult(Instrumentation instrumentation,
22            Callable<R> callable) throws Throwable {
23        FutureTask<R> task = new FutureTask<R>(callable);
24        instrumentation.runOnMainSync(task);
25        try {
26            return task.get();
27        } catch (ExecutionException e) {
28            // Unwrap the cause of the exception and re-throw it.
29            throw e.getCause();
30        }
31    }
32}

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