Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 17 matching lines...) Expand all Loading... | |
| 28 public void onCreate(Bundle savedInstanceState) { | 28 public void onCreate(Bundle savedInstanceState) { |
| 29 super.onCreate(savedInstanceState); | 29 super.onCreate(savedInstanceState); |
| 30 // Needed by path_utils_unittest.cc | 30 // Needed by path_utils_unittest.cc |
| 31 PathUtils.setPrivateDataDirectorySuffix("chrome"); | 31 PathUtils.setPrivateDataDirectorySuffix("chrome"); |
| 32 | 32 |
| 33 // Needed by system_monitor_unittest.cc | 33 // Needed by system_monitor_unittest.cc |
| 34 PowerMonitor.createForTests(this); | 34 PowerMonitor.createForTests(this); |
| 35 | 35 |
| 36 loadLibraries(); | 36 loadLibraries(); |
| 37 Bundle extras = this.getIntent().getExtras(); | 37 Bundle extras = this.getIntent().getExtras(); |
| 38 if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { | 38 // if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) { |
| 39 if (true) { | |
|
henrika (OOO until Aug 14)
2013/11/22 12:54:47
This is just a hack to allow us to receive broadca
| |
| 40 Log.i(TAG, "+++ Running test on new thread +++"); | |
| 39 // Create a new thread and run tests on it. | 41 // Create a new thread and run tests on it. |
| 40 new Thread() { | 42 new Thread() { |
| 41 @Override | 43 @Override |
| 42 public void run() { | 44 public void run() { |
| 43 runTests(); | 45 runTests(); |
| 44 } | 46 } |
| 45 }.start(); | 47 }.start(); |
| 46 } else { | 48 } else { |
| 47 // Post a task to run the tests. This allows us to not block | 49 // Post a task to run the tests. This allows us to not block |
| 48 // onCreate and still run tests on the main thread. | 50 // onCreate and still run tests on the main thread. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 70 private void loadLibraries() { | 72 private void loadLibraries() { |
| 71 for (String library: NativeLibraries.libraries) { | 73 for (String library: NativeLibraries.libraries) { |
| 72 Log.i(TAG, "loading: " + library); | 74 Log.i(TAG, "loading: " + library); |
| 73 System.loadLibrary(library); | 75 System.loadLibrary(library); |
| 74 Log.i(TAG, "loaded: " + library); | 76 Log.i(TAG, "loaded: " + library); |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 | 79 |
| 78 private native void nativeRunTests(String filesDir, Context appContext); | 80 private native void nativeRunTests(String filesDir, Context appContext); |
| 79 } | 81 } |
| OLD | NEW |