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

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

Issue 2860063003: Improve usage documentation of scoped task environments. (Closed)
Patch Set: nits + fix nacl compile 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
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..c8f85deb2a5378de47e4d1b1badfc14f6f2b160e 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 the 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_

Powered by Google App Engine
This is Rietveld 408576698