1 // Copyright 2018 The Chromium Authors 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.native_test; 6 7 import android.app.Application; 8 import android.content.Context; 9 10 import org.chromium.base.CommandLine; 11 12 /** 13 * Application class to be used by native_test apks. 14 */ 15 public class NativeTestApplication extends Application { 16 @Override attachBaseContext(Context base)17 protected void attachBaseContext(Context base) { 18 super.attachBaseContext(base); 19 assert getBaseContext() != null; 20 CommandLine.init(new String[] {}); 21 22 // This is required for Mockito to initialize mocks without running under Instrumentation. 23 System.setProperty("org.mockito.android.target", getCacheDir().getPath()); 24 } 25 } 26