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

Unified Diff: content/public/test/test_browser_thread_bundle.h

Issue 2860063003: Improve usage documentation of scoped task environments. (Closed)
Patch Set: Created 3 years, 7 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
« base/test/scoped_task_environment.h ('K') | « base/test/scoped_task_environment.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_browser_thread_bundle.h
diff --git a/content/public/test/test_browser_thread_bundle.h b/content/public/test/test_browser_thread_bundle.h
index 15cdba8f5c6b350876bfb172fe04a15de5dac492..0f1b455947cd683728a00f88a6bc54d576d34484 100644
--- a/content/public/test/test_browser_thread_bundle.h
+++ b/content/public/test/test_browser_thread_bundle.h
@@ -53,6 +53,24 @@
//
// DONT_CREATE_THREADS should only be used when the options specify at least
// one real thread other than the main thread.
+//
+// Basic usage:
+//
+// class MyTestFixture : public testing::Test {
+// public:
+// (...)
+//
+// protected:
+// // Must be first member (or at least before any member that cares about
+// // tasks) to be initialized first and destroyed last. protected instead
+// // of private visibility will allow controlling the task environment
+// // (e.g. clock) once such features are added (see
+// // base::test::ScopedTaskEnvironment for details), until then it at least
+// // doesn't hurt :).
+// content::TestBrowserThreadBundle test_browser_thread_bundle_;
+//
+// // Other members go here (or further below in private section.)
+// };
#ifndef CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_BUNDLE_H_
#define CONTENT_PUBLIC_TEST_TEST_BROWSER_THREAD_BUNDLE_H_
« base/test/scoped_task_environment.h ('K') | « base/test/scoped_task_environment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698