| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class MessageLoop; | 14 class MessageLoop; |
| 15 class Thread; | |
| 16 } | 15 } |
| 17 | 16 |
| 18 namespace content { | 17 namespace content { |
| 19 | 18 |
| 20 class TestBrowserThreadImpl; | 19 class TestBrowserThreadImpl; |
| 21 | 20 |
| 22 // DEPRECATED: use TestBrowserThreadBundle instead. See http://crbug.com/272091 | 21 // DEPRECATED: use TestBrowserThreadBundle instead. See http://crbug.com/272091 |
| 23 // A BrowserThread for unit tests; this lets unit tests in chrome/ create | 22 // A BrowserThread for unit tests; this lets unit tests in chrome/ create |
| 24 // BrowserThread instances. | 23 // BrowserThread instances. |
| 25 class TestBrowserThread { | 24 class TestBrowserThread { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 | 42 |
| 44 // Starts the thread with an IOThread message loop. | 43 // Starts the thread with an IOThread message loop. |
| 45 bool StartIOThread(); | 44 bool StartIOThread(); |
| 46 | 45 |
| 47 // Stops the thread. | 46 // Stops the thread. |
| 48 void Stop(); | 47 void Stop(); |
| 49 | 48 |
| 50 // Returns true if the thread is running. | 49 // Returns true if the thread is running. |
| 51 bool IsRunning(); | 50 bool IsRunning(); |
| 52 | 51 |
| 53 // Returns a Thread pointer for the thread. This should not be used | |
| 54 // in new tests. | |
| 55 base::Thread* DeprecatedGetThreadObject(); | |
| 56 | |
| 57 private: | 52 private: |
| 58 std::unique_ptr<TestBrowserThreadImpl> impl_; | 53 std::unique_ptr<TestBrowserThreadImpl> impl_; |
| 59 | 54 |
| 60 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); | 55 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread); |
| 61 }; | 56 }; |
| 62 | 57 |
| 63 } // namespace content | 58 } // namespace content |
| 64 | 59 |
| 65 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ | 60 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_ |
| OLD | NEW |