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 | |
43 // Starts the thread with an IOThread message loop. | 39 // Starts the thread with an IOThread message loop. |
44 bool StartIOThread(); | 40 bool StartIOThread(); |
45 | 41 |
46 // Stops the thread. | 42 // Stops the thread. |
47 void Stop(); | 43 void Stop(); |
48 | 44 |
49 // Returns true if the thread is running. | 45 // Returns true if the thread is running. |
50 bool IsRunning(); | 46 bool IsRunning(); |
51 | 47 |
52 // Returns a Thread pointer for the thread. This should not be used | 48 // Returns a Thread pointer for the thread. This should not be used |
53 // in new tests. | 49 // in new tests. |
54 base::Thread* DeprecatedGetThreadObject(); | 50 base::Thread* DeprecatedGetThreadObject(); |
55 | 51 |
56 private: | 52 private: |
57 scoped_ptr<TestBrowserThreadImpl> impl_; | 53 scoped_ptr<TestBrowserThreadImpl> impl_; |
58 | 54 |
59 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); | 55 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); |
60 }; | 56 }; |
61 | 57 |
62 } // namespace content | 58 } // namespace content |
63 | 59 |
64 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ | 60 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ |
OLD | NEW |