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

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

Issue 2839983002: [Android] Enable multidex for release builds of chrome_public_test_apk. (RELAND) (Closed)
Patch Set: roll deps Created 3 years, 8 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
OLDNEW
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.base.test; 5 package org.chromium.base.test;
6 6
7 import android.os.Bundle; 7 import android.app.Application;
8 import android.content.Context;
8 9
9 import org.chromium.base.multidex.ChromiumMultiDexInstaller; 10 import org.chromium.base.multidex.ChromiumMultiDexInstaller;
10 import org.chromium.base.test.util.CommandLineFlags; 11 import org.chromium.base.test.util.CommandLineFlags;
11 12
12 // TODO(jbudorick): Add support for on-device handling of timeouts. 13 // TODO(jbudorick): Add support for on-device handling of timeouts.
13 /** 14 /**
14 * An Instrumentation test runner for applications that are based on 15 * An Instrumentation test runner for applications that are based on
15 * {@code org.chromium.base.BaseChromiumApplication} 16 * {@code org.chromium.base.BaseChromiumApplication}
16 */ 17 */
17 public class BaseChromiumInstrumentationTestRunner extends BaseInstrumentationTe stRunner { 18 public class BaseChromiumInstrumentationTestRunner extends BaseInstrumentationTe stRunner {
18 @Override 19 @Override
19 public void onCreate(Bundle arguments) { 20 public Application newApplication(ClassLoader cl, String className, Context context)
20 ChromiumMultiDexInstaller.install(getTargetContext()); 21 throws ClassNotFoundException, IllegalAccessException, Instantiation Exception {
21 super.onCreate(arguments); 22 ChromiumMultiDexInstaller.install(new BaseChromiumRunnerCommon.MultiDexC ontextWrapper(
23 getContext(), getTargetContext()));
24 BaseChromiumRunnerCommon.reorderDexPathElements(cl, getContext(), getTar getContext());
25 return super.newApplication(cl, className, context);
22 } 26 }
23 27
24 /** 28 /**
25 * Override this method to register hooks and checks to be run for each test . Make sure to call 29 * Override this method to register hooks and checks to be run for each test . Make sure to call
26 * the base implementation if you do so. 30 * the base implementation if you do so.
27 * 31 *
28 * @see BaseTestResult#addSkipCheck(BaseTestResult.SkipCheck) 32 * @see BaseTestResult#addSkipCheck(BaseTestResult.SkipCheck)
29 * @see BaseTestResult#addPreTestHook(BaseTestResult.PreTestHook) 33 * @see BaseTestResult#addPreTestHook(BaseTestResult.PreTestHook)
30 */ 34 */
31 @Override 35 @Override
32 protected void addTestHooks(BaseTestResult result) { 36 protected void addTestHooks(BaseTestResult result) {
33 super.addTestHooks(result); 37 super.addTestHooks(result);
34 result.addPreTestHook(CommandLineFlags.getRegistrationHook()); 38 result.addPreTestHook(CommandLineFlags.getRegistrationHook());
35 } 39 }
36 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698