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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_
6 #define CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/browser_thread.h"
19 class TestBrowserThreadImpl
;
21 // DEPRECATED: use TestBrowserThreadBundle instead. See http://crbug.com/272091
22 // A BrowserThread for unit tests; this lets unit tests in chrome/ create
23 // BrowserThread instances.
24 class TestBrowserThread
{
26 explicit TestBrowserThread(BrowserThread::ID identifier
);
27 TestBrowserThread(BrowserThread::ID identifier
,
28 base::MessageLoop
* message_loop
);
31 // We provide a subset of the capabilities of the Thread interface
32 // to enable certain unit tests. To avoid a stronger dependency of
33 // the internals of BrowserThread, we do not provide the full Thread
36 // Starts the thread with a generic message loop.
39 // Starts the thread with an IOThread message loop.
45 // Returns true if the thread is running.
48 // Returns a Thread pointer for the thread. This should not be used
50 base::Thread
* DeprecatedGetThreadObject();
53 scoped_ptr
<TestBrowserThreadImpl
> impl_
;
55 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread
);
58 } // namespace content
60 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_H_