| 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 15 matching lines...) Expand all Loading... |
| 26 // We post a delayed task to run tests so that we do not block onCreate(). | 26 // We post a delayed task to run tests so that we do not block onCreate(). |
| 27 private static final long RUN_TESTS_DELAY_IN_MS = 300; | 27 private static final long RUN_TESTS_DELAY_IN_MS = 300; |
| 28 | 28 |
| 29 @Override | 29 @Override |
| 30 public void onCreate(Bundle savedInstanceState) { | 30 public void onCreate(Bundle savedInstanceState) { |
| 31 super.onCreate(savedInstanceState); | 31 super.onCreate(savedInstanceState); |
| 32 // Needed by path_utils_unittest.cc | 32 // Needed by path_utils_unittest.cc |
| 33 PathUtils.setPrivateDataDirectorySuffix("chrome"); | 33 PathUtils.setPrivateDataDirectorySuffix("chrome"); |
| 34 | 34 |
| 35 ResourceExtractor resourceExtractor = ResourceExtractor.get(getApplicati
onContext()); | 35 ResourceExtractor resourceExtractor = ResourceExtractor.get(getApplicati
onContext()); |
| 36 resourceExtractor.setExtractAllPaksForTesting(); | 36 resourceExtractor.setExtractAllPaksAndV8SnapshotForTesting(); |
| 37 resourceExtractor.startExtractingResources(); | 37 resourceExtractor.startExtractingResources(); |
| 38 resourceExtractor.waitForCompletion(); | 38 resourceExtractor.waitForCompletion(); |
| 39 | 39 |
| 40 // Needed by system_monitor_unittest.cc | 40 // Needed by system_monitor_unittest.cc |
| 41 PowerMonitor.createForTests(this); | 41 PowerMonitor.createForTests(this); |
| 42 | 42 |
| 43 loadLibraries(); | 43 loadLibraries(); |
| 44 Bundle extras = this.getIntent().getExtras(); | 44 Bundle extras = this.getIntent().getExtras(); |
| 45 if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { | 45 if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { |
| 46 // Create a new thread and run tests on it. | 46 // Create a new thread and run tests on it. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 77 private void loadLibraries() { | 77 private void loadLibraries() { |
| 78 for (String library : NativeLibraries.LIBRARIES) { | 78 for (String library : NativeLibraries.LIBRARIES) { |
| 79 Log.i(TAG, "loading: " + library); | 79 Log.i(TAG, "loading: " + library); |
| 80 System.loadLibrary(library); | 80 System.loadLibrary(library); |
| 81 Log.i(TAG, "loaded: " + library); | 81 Log.i(TAG, "loaded: " + library); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 private native void nativeRunTests(String filesDir, Context appContext); | 85 private native void nativeRunTests(String filesDir, Context appContext); |
| 86 } | 86 } |
| OLD | NEW |