| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.native_test; | 5 package org.chromium.native_test; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.os.Bundle; | 9 import android.os.Bundle; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 @Override | 30 @Override |
| 31 public void onCreate(Bundle savedInstanceState) { | 31 public void onCreate(Bundle savedInstanceState) { |
| 32 super.onCreate(savedInstanceState); | 32 super.onCreate(savedInstanceState); |
| 33 CommandLine.init(new String[]{}); | 33 CommandLine.init(new String[]{}); |
| 34 | 34 |
| 35 // Needed by path_utils_unittest.cc | 35 // Needed by path_utils_unittest.cc |
| 36 PathUtils.setPrivateDataDirectorySuffix("chrome"); | 36 PathUtils.setPrivateDataDirectorySuffix("chrome"); |
| 37 | 37 |
| 38 ResourceExtractor resourceExtractor = ResourceExtractor.get(getApplicati
onContext()); | 38 ResourceExtractor resourceExtractor = ResourceExtractor.get(getApplicati
onContext()); |
| 39 resourceExtractor.setExtractAllPaksForTesting(); | 39 resourceExtractor.setExtractAllPaksAndV8SnapshotForTesting(); |
| 40 resourceExtractor.startExtractingResources(); | 40 resourceExtractor.startExtractingResources(); |
| 41 resourceExtractor.waitForCompletion(); | 41 resourceExtractor.waitForCompletion(); |
| 42 | 42 |
| 43 // Needed by system_monitor_unittest.cc | 43 // Needed by system_monitor_unittest.cc |
| 44 PowerMonitor.createForTests(this); | 44 PowerMonitor.createForTests(this); |
| 45 | 45 |
| 46 loadLibraries(); | 46 loadLibraries(); |
| 47 Bundle extras = this.getIntent().getExtras(); | 47 Bundle extras = this.getIntent().getExtras(); |
| 48 if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { | 48 if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { |
| 49 // Create a new thread and run tests on it. | 49 // Create a new thread and run tests on it. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 80 private void loadLibraries() { | 80 private void loadLibraries() { |
| 81 for (String library : NativeLibraries.LIBRARIES) { | 81 for (String library : NativeLibraries.LIBRARIES) { |
| 82 Log.i(TAG, "loading: " + library); | 82 Log.i(TAG, "loading: " + library); |
| 83 System.loadLibrary(library); | 83 System.loadLibrary(library); |
| 84 Log.i(TAG, "loaded: " + library); | 84 Log.i(TAG, "loaded: " + library); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 private native void nativeRunTests(String filesDir, Context appContext); | 88 private native void nativeRunTests(String filesDir, Context appContext); |
| 89 } | 89 } |
| OLD | NEW |