OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.test.InstrumentationTestCase; | 7 import android.test.InstrumentationTestCase; |
8 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
9 | 9 |
10 import org.chromium.base.CommandLine; | 10 import org.chromium.base.CommandLine; |
(...skipping 29 matching lines...) Expand all Loading... |
40 CommandLine.reset(); | 40 CommandLine.reset(); |
41 } | 41 } |
42 | 42 |
43 void loadJni() { | 43 void loadJni() { |
44 assertFalse(CommandLine.getInstance().isNativeImplementation()); | 44 assertFalse(CommandLine.getInstance().isNativeImplementation()); |
45 getInstrumentation().runOnMainSync(new Runnable() { | 45 getInstrumentation().runOnMainSync(new Runnable() { |
46 @Override | 46 @Override |
47 public void run() { | 47 public void run() { |
48 ContentShellApplication.initializeApplicationParameters(); | 48 ContentShellApplication.initializeApplicationParameters(); |
49 try { | 49 try { |
50 LibraryLoader.ensureInitialized(); | 50 LibraryLoader.ensureInitialized( |
| 51 getInstrumentation().getTargetContext(), false); |
51 } catch (ProcessInitException e) { | 52 } catch (ProcessInitException e) { |
52 throw new Error(e); | 53 throw new Error(e); |
53 } | 54 } |
54 } | 55 } |
55 }); | 56 }); |
56 assertTrue(CommandLine.getInstance().isNativeImplementation()); | 57 assertTrue(CommandLine.getInstance().isNativeImplementation()); |
57 } | 58 } |
58 | 59 |
59 void checkInitSwitches() { | 60 void checkInitSwitches() { |
60 CommandLine cl = CommandLine.getInstance(); | 61 CommandLine cl = CommandLine.getInstance(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 140 } |
140 | 141 |
141 @MediumTest | 142 @MediumTest |
142 @Feature({"Android-AppBase"}) | 143 @Feature({"Android-AppBase"}) |
143 public void testFileInitialization() { | 144 public void testFileInitialization() { |
144 CommandLine.initFromFile(ContentShellActivity.COMMAND_LINE_FILE); | 145 CommandLine.initFromFile(ContentShellActivity.COMMAND_LINE_FILE); |
145 loadJni(); | 146 loadJni(); |
146 checkSettingThenGetting(); | 147 checkSettingThenGetting(); |
147 } | 148 } |
148 } | 149 } |
OLD | NEW |