• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /** Application class to be used by native_test apks. */
13 public class NativeTestApplication extends Application {
14     @Override
attachBaseContext(Context base)15     protected void attachBaseContext(Context base) {
16         super.attachBaseContext(base);
17         assert getBaseContext() != null;
18         CommandLine.init(new String[] {});
19 
20         // This is required for Mockito to initialize mocks without running under Instrumentation.
21         System.setProperty("org.mockito.android.target", getCacheDir().getPath());
22     }
23 }
24