Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: content/test/test_browser_thread.h

Issue 10500016: Move test_browser_thread.h from content\test to content\public\test. This way we can enforce that i… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/test/test_browser_thread.h ('k') | content/test/test_browser_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 #ifndef CONTENT_TEST_TEST_BROWSER_THREAD_H_
6 #define CONTENT_TEST_TEST_BROWSER_THREAD_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/browser_thread.h"
12
13 class MessageLoop;
14
15 namespace base {
16 class Thread;
17 }
18
19 namespace content {
20
21 class TestBrowserThreadImpl;
22
23 // A BrowserThread for unit tests; this lets unit tests in chrome/
24 // create BrowserThread instances.
25 class TestBrowserThread {
26 public:
27 explicit TestBrowserThread(BrowserThread::ID identifier);
28 TestBrowserThread(BrowserThread::ID identifier, MessageLoop* message_loop);
29 ~TestBrowserThread();
30
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
34 // interface.
35
36 // Starts the thread with a generic message loop.
37 bool Start();
38
39 // Starts the thread with an IOThread message loop.
40 bool StartIOThread();
41
42 // Stops the thread.
43 void Stop();
44
45 // Returns true if the thread is running.
46 bool IsRunning();
47
48 // Returns a Thread pointer for the thread. This should not be used
49 // in new tests.
50 base::Thread* DeprecatedGetThreadObject();
51
52 // Sets the message loop to use for the thread. This should not be
53 // used in new tests.
54 void DeprecatedSetMessageLoop(MessageLoop* loop);
55
56 private:
57 scoped_ptr<TestBrowserThreadImpl> impl_;
58
59 DISALLOW_COPY_AND_ASSIGN(TestBrowserThread);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_TEST_TEST_BROWSER_THREAD_H_
OLDNEW
« no previous file with comments | « content/public/test/test_browser_thread.h ('k') | content/test/test_browser_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698