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 (true || extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD )) { |
bulach
2013/12/13 13:49:49
remove it :)
henrika (OOO until Aug 14)
2013/12/13 14:58:42
Of course.
| |
39 // Create a new thread and run tests on it. | 39 // Create a new thread and run tests on it. |
40 new Thread() { | 40 new Thread() { |
41 @Override | 41 @Override |
42 public void run() { | 42 public void run() { |
43 runTests(); | 43 runTests(); |
44 } | 44 } |
45 }.start(); | 45 }.start(); |
46 } else { | 46 } else { |
47 // Post a task to run the tests. This allows us to not block | 47 // Post a task to run the tests. This allows us to not block |
48 // onCreate and still run tests on the main thread. | 48 // onCreate and still run tests on the main thread. |
(...skipping 21 matching lines...) Expand all Loading... | |
70 private void loadLibraries() { | 70 private void loadLibraries() { |
71 for (String library: NativeLibraries.LIBRARIES) { | 71 for (String library: NativeLibraries.LIBRARIES) { |
72 Log.i(TAG, "loading: " + library); | 72 Log.i(TAG, "loading: " + library); |
73 System.loadLibrary(library); | 73 System.loadLibrary(library); |
74 Log.i(TAG, "loaded: " + library); | 74 Log.i(TAG, "loaded: " + library); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 private native void nativeRunTests(String filesDir, Context appContext); | 78 private native void nativeRunTests(String filesDir, Context appContext); |
79 } | 79 } |
OLD | NEW |