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

COVERAGE SUMMARY FOR SOURCE FILE [ScalableTimeout.java]

nameclass, %method, %block, %line, %
ScalableTimeout.java100% (1/1)67%  (2/3)52%  (16/31)56%  (5/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ScalableTimeout100% (1/1)67%  (2/3)52%  (16/31)56%  (5/9)
ScalableTimeout (): void 0%   (0/1)0%   (0/3)0%   (0/1)
ScaleTimeout (long): long 100% (1/1)52%  (13/25)57%  (4/7)
<static initializer> 100% (1/1)100% (3/3)100% (1/1)

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 
7/**
8 * Utility class for scaling various timeouts by a common factor.
9 * For example, to run tests under Valgrind, you might want the following:
10 *   adb shell "echo 20.0 > /data/local/tmp/chrome_timeout_scale"
11 */
12public class ScalableTimeout {
13    private static Double sTimeoutScale = null;
14    private static final String PROPERTY_FILE = "/data/local/tmp/chrome_timeout_scale";
15 
16    public static long ScaleTimeout(long timeout) {
17        if (sTimeoutScale == null) {
18            try {
19                char[] data = TestFileUtil.readUtf8File(PROPERTY_FILE, 32);
20                sTimeoutScale = Double.parseDouble(new String(data));
21            } catch (Exception e) {
22                // NumberFormatException, FileNotFoundException, IOException
23                sTimeoutScale = 1.0;
24            }
25        }
26        return (long)(timeout * sTimeoutScale);
27    }
28}

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