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 #ifndef CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 ~TestBrowserThread(); | 29 ~TestBrowserThread(); |
30 | 30 |
31 // We provide a subset of the capabilities of the Thread interface | 31 // We provide a subset of the capabilities of the Thread interface |
32 // to enable certain unit tests. To avoid a stronger dependency of | 32 // to enable certain unit tests. To avoid a stronger dependency of |
33 // the internals of BrowserThread, we do not provide the full Thread | 33 // the internals of BrowserThread, we do not provide the full Thread |
34 // interface. | 34 // interface. |
35 | 35 |
36 // Starts the thread with a generic message loop. | 36 // Starts the thread with a generic message loop. |
37 bool Start(); | 37 bool Start(); |
38 | 38 |
| 39 // Starts the thread with a generic message loop and waits for the |
| 40 // thread to run. |
| 41 bool StartAndWaitForTesting(); |
| 42 |
39 // Starts the thread with an IOThread message loop. | 43 // Starts the thread with an IOThread message loop. |
40 bool StartIOThread(); | 44 bool StartIOThread(); |
41 | 45 |
42 // Stops the thread. | 46 // Stops the thread. |
43 void Stop(); | 47 void Stop(); |
44 | 48 |
45 // Returns true if the thread is running. | 49 // Returns true if the thread is running. |
46 bool IsRunning(); | 50 bool IsRunning(); |
47 | 51 |
48 // Returns a Thread pointer for the thread. This should not be used | 52 // Returns a Thread pointer for the thread. This should not be used |
49 // in new tests. | 53 // in new tests. |
50 base::Thread* DeprecatedGetThreadObject(); | 54 base::Thread* DeprecatedGetThreadObject(); |
51 | 55 |
52 private: | 56 private: |
53 scoped_ptr<TestBrowserThreadImpl> impl_; | 57 scoped_ptr<TestBrowserThreadImpl> impl_; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); | 59 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); |
56 }; | 60 }; |
57 | 61 |
58 } // namespace content | 62 } // namespace content |
59 | 63 |
60 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ | 64 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ |
OLD | NEW |