1 // Copyright 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.
5 package org.chromium.content.browser.test.util;
7 import android.app.Instrumentation;
10 * Collection of UI utilities.
12 public class UiUtils {
15 * Waits for the UI thread to settle down and then waits for another second.
17 * Avoid this method like the plague. It's a fantastically evil source of flakiness in tests.
18 * Instead, you should either:
19 * - Use an observer interface if possible (preferred), or
20 * - Use CriteriaHelper to poll for the desired condition becoming true
22 * @param instrumentation Instrumentation object used by the test.
24 public static void settleDownUI(Instrumentation instrumentation) throws InterruptedException {
25 instrumentation.waitForIdleSync();