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

Unified 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: fix InstantNTP test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | chrome/test/base/testing_io_thread_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_io_thread_state.h
diff --git a/chrome/test/base/testing_io_thread_state.h b/chrome/test/base/testing_io_thread_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..8865671093dd932af3531e3142e303abd0b23ecb
--- /dev/null
+++ b/chrome/test/base/testing_io_thread_state.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
+#define CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
+
+class IOThread;
+
+namespace chrome {
+
+// Convenience class for creating an IOThread object in unittests.
+// Usual usage is to create one of these in the test fixture, after the
+// BrowserThreadBundle and TestingBrowserProcess have been initialized.
+//
+// If code requires the use of io thread globals, those can be set by
+// accessing io_thread_state()->globals() on the IO thread during test setup.
+class TestingIOThreadState {
+ public:
+ TestingIOThreadState();
+ ~TestingIOThreadState();
+ IOThread* io_thread_state() { return io_thread_state_.get(); }
+
+ private:
+ void Initialize(const base::Closure& done);
+ void Shutdown(const base::Closure& done);
+
+ scoped_ptr<IOThread> io_thread_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestingIOThreadState);
+};
+
+} // namespace chrome
+
+#endif // CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | chrome/test/base/testing_io_thread_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698