Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Side by Side Diff: base/android/javatests/src/org/chromium/base/LibraryLoaderHelperTest.java

Issue 200753002: [Android] Workaround of an android platform bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ChildProcessService needs to use the hack Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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
5 package org.chromium.base;
6
7 import android.content.Context;
8 import android.test.InstrumentationTestCase;
9 import android.test.suitebuilder.annotation.MediumTest;
10
11 import org.chromium.base.library_loader.LibraryLoaderHelper;
12
13 import java.io.File;
14
15 /**
16 * Test class for the native library hack.
17 */
18 public class LibraryLoaderHelperTest extends InstrumentationTestCase {
19 private static final String TAG = "LibraryLoaderHelperTest";
20
21 @Override
22 public void setUp() throws Exception {
23 Context context = getInstrumentation().getTargetContext();
24 LibraryLoaderHelper.deleteWorkaroundLibrariesSynchronously(context);
25 }
26
27 @MediumTest
28 public void testLoadNativeLibraries() {
29 getInstrumentation().runOnMainSync(new Runnable() {
30 @Override
31 public void run() {
32 Context context = getInstrumentation().getTargetContext();
33 File libDir = LibraryLoaderHelper.getWorkaroundLibDir(context);
34 assertTrue(libDir.exists());
35 assertTrue(libDir.isDirectory());
36 assertEquals(libDir.list().length, 0);
37
38 assertTrue(
39 LibraryLoaderHelper.loadNativeLibrariesUsingWorkaroundForTes ting(
40 context));
41
42 assertTrue(libDir.list().length > 0);
43 }
44 });
45 }
46
47 @Override
48 public void tearDown() throws Exception {
49 Context context = getInstrumentation().getTargetContext();
50 LibraryLoaderHelper.deleteWorkaroundLibrariesSynchronously(context);
51 super.tearDown();
52 }
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698