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

Side by Side Diff: chrome/test/base/testing_io_thread_state.h

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments. merge to ToT. Murder a DB thread and more TestBrowserThreads. Created 7 years, 5 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CHROME_TEST_BASE_SCOPED_TESTING_IO_THREAD_STATE_H
6 #define CHROME_TEST_BASE_SCOPED_TESTING_IO_THREAD_STATE_H
7
8 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10
11 class IOThread;
12
13 namespace chrome {
14
15 // Convenience class for creating an IOThread object in unittests.
16 // Usual usage is to create one of these in the test fixture, after the
17 // BrowserThreadBundle and TestingBrowserProcess have been initialized.
18 //
19 // If code requires the use of io thread globals, those can be set by
20 // accessing io_thread_state()->globals() on the IO thread during test setup.
21 class TestingIOThreadState {
22 public:
23 TestingIOThreadState();
24 ~TestingIOThreadState();
25 IOThread* io_thread_state() { return io_thread_state_.get(); }
26
27 private:
28 void Initialize(const base::Closure& done);
29 void Shutdown(const base::Closure& done);
30
31 scoped_ptr<IOThread> io_thread_state_;
32
33 DISALLOW_COPY_AND_ASSIGN(TestingIOThreadState);
34 };
35
36 } // namespace chrome
37
38 #endif // CHROME_TEST_BASE_SCOPED_TESTING_IO_THREAD_STATE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698