Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // TestBrowserThreadBundle is a convenience class for creating a set of | 5 // TestBrowserThreadBundle is a convenience class for creating a set of |
| 6 // TestBrowserThreads in unit tests. For most tests, it is sufficient to | 6 // TestBrowserThreads in unit tests. For most tests, it is sufficient to |
| 7 // just instantiate the TestBrowserThreadBundle as a member variable. | 7 // just instantiate the TestBrowserThreadBundle as a member variable. |
| 8 // | 8 // |
| 9 // By default, all of the created TestBrowserThreads will be backed by a single | 9 // By default, all of the created TestBrowserThreads will be backed by a single |
| 10 // shared MessageLoop. If a test truly needs separate threads, it can do | 10 // shared MessageLoop. If a test truly needs separate threads, it can do |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 | 55 |
| 56 class TestBrowserThreadBundle { | 56 class TestBrowserThreadBundle { |
| 57 public: | 57 public: |
| 58 // Used to specify the type of MessageLoop that backs the UI thread, and | 58 // Used to specify the type of MessageLoop that backs the UI thread, and |
| 59 // which of the named BrowserThreads should be backed by a real | 59 // which of the named BrowserThreads should be backed by a real |
| 60 // threads. The UI thread is always the main thread in a unit test. | 60 // threads. The UI thread is always the main thread in a unit test. |
| 61 enum Options { | 61 enum Options { |
| 62 DEFAULT = 0x00, | 62 DEFAULT = 0x00, |
| 63 IO_MAINLOOP = 0x01, | 63 IO_MAINLOOP = 0x01, |
| 64 REAL_DB_THREAD = 0x02, | 64 REAL_DB_THREAD = 0x02, |
| 65 // Uses NestedMessagePumpAndroid to process the Java message queue during | |
| 66 // run loops (needed for AsyncTasks etc). Has no effect on other platforms. | |
| 67 NESTED_JAVA_ON_ANDROID = 0x04, | |
|
Peter Beverloo
2016/04/11 15:47:56
I am very concerned about further spreading availa
johnme
2016/04/21 10:58:37
Removed since I no longer use NestedSystemMessageH
| |
| 65 REAL_FILE_THREAD = 0x08, | 68 REAL_FILE_THREAD = 0x08, |
| 66 REAL_FILE_USER_BLOCKING_THREAD = 0x10, | 69 REAL_FILE_USER_BLOCKING_THREAD = 0x10, |
| 67 REAL_PROCESS_LAUNCHER_THREAD = 0x20, | 70 REAL_PROCESS_LAUNCHER_THREAD = 0x20, |
| 68 REAL_CACHE_THREAD = 0x40, | 71 REAL_CACHE_THREAD = 0x40, |
| 69 REAL_IO_THREAD = 0x80, | 72 REAL_IO_THREAD = 0x80, |
| 70 DONT_START_THREADS = 0x100, | 73 DONT_START_THREADS = 0x100, |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 TestBrowserThreadBundle(); | 76 TestBrowserThreadBundle(); |
| 74 explicit TestBrowserThreadBundle(int options); | 77 explicit TestBrowserThreadBundle(int options); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 93 | 96 |
| 94 int options_; | 97 int options_; |
| 95 bool threads_started_; | 98 bool threads_started_; |
| 96 | 99 |
| 97 DISALLOW_COPY_AND_ASSIGN(TestBrowserThreadBundle); | 100 DISALLOW_COPY_AND_ASSIGN(TestBrowserThreadBundle); |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 } // namespace content | 103 } // namespace content |
| 101 | 104 |
| 102 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_BUNDLE_H_ | 105 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_BUNDLE_H_ |
| OLD | NEW |