OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.blimp; | 5 package org.chromium.blimp.app; |
6 | 6 |
7 import android.test.InstrumentationTestCase; | 7 import android.test.InstrumentationTestCase; |
8 | 8 |
9 import org.chromium.base.ThreadUtils; | 9 import org.chromium.base.ThreadUtils; |
10 import org.chromium.base.library_loader.ProcessInitException; | 10 import org.chromium.base.library_loader.ProcessInitException; |
11 | 11 |
12 import java.util.concurrent.Semaphore; | 12 import java.util.concurrent.Semaphore; |
13 | 13 |
14 /** | 14 /** |
15 * Base class for loading native library in tests. The setUp() methods must be i
nvoked, and | 15 * Base class for loading native library in tests. The setUp() methods must be i
nvoked, and |
(...skipping 27 matching lines...) Expand all Loading... |
43 * Blocks until the native library startup is complete. If the startup dit n
ot complete | 43 * Blocks until the native library startup is complete. If the startup dit n
ot complete |
44 * successfully, this method throws a RuntimeException, otherwise it does no
thing. | 44 * successfully, this method throws a RuntimeException, otherwise it does no
thing. |
45 * This method should be called in the start of any test method that require
s native to be | 45 * This method should be called in the start of any test method that require
s native to be |
46 * successfully loaded. | 46 * successfully loaded. |
47 */ | 47 */ |
48 protected final void waitUntilNativeIsReady() throws InterruptedException { | 48 protected final void waitUntilNativeIsReady() throws InterruptedException { |
49 mNativeReadySemaphore.acquire(); | 49 mNativeReadySemaphore.acquire(); |
50 if (!mSuccess) throw new RuntimeException("Native startup failed"); | 50 if (!mSuccess) throw new RuntimeException("Native startup failed"); |
51 } | 51 } |
52 } | 52 } |
OLD | NEW |