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

Unified Diff: chrome/browser/translate/translate_browser_test_utils.h

Issue 296943002: Simplify and extend commenting in test::ScopedCLDDynamicDataHarness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: chrome/browser/translate/translate_browser_test_utils.h
diff --git a/chrome/browser/translate/translate_browser_test_utils.h b/chrome/browser/translate/translate_browser_test_utils.h
index d5e054b6838f4b33529fe9e2985eb8530fe32060..3f74db29ccbaaf73abdd5e48227a311e1f39953e 100644
--- a/chrome/browser/translate/translate_browser_test_utils.h
+++ b/chrome/browser/translate/translate_browser_test_utils.h
@@ -11,13 +11,12 @@ namespace test {
// A utility class that sets up CLD dynamic data upon calling Init() and cleans
// it up when destroyed.
+// NB: Test data lives under: src/chrome/test/data/cld2_component
msw 2014/05/22 04:26:48 nit: what does "NB:" itself add to this comment? I
Andrew Hayden (chromium.org) 2014/05/22 10:33:45 Funny thing, I first encountered "NB" about 3 year
//
// This class is intended to be instantiated within IN_PROC_BROWSER_TEST_F
// test fixtures; it uses ASSERT macros for correctness, so that tests will
// fail gracefully in error conditions. Sample use:
//
-// #include "chrome/browser/translate/translate_browser_test_utils.h"
-//
// IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) {
// test::ScopedCLDDynamicDataHarness dynamic_data_scope;
// ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init());
@@ -26,9 +25,25 @@ namespace test {
//
// If you have a lot of tests that need language translation features, you can
// add an instance of the ScopedCLDDynamicDataHarness to your test class'
-// private member variables and add the call to Init() into your Setup method.
+// private member variables and add the call to Init() into SetUpOnMainThread.
msw 2014/05/22 04:26:48 I'm not sure the example here adds much, in fact I
Andrew Hayden (chromium.org) 2014/05/22 10:33:45 That's fair, I suppose. "git gs ScopedCLD" would g
+// Sample use:
+//
+// class MyTestClass : public InProcessBrowserTest {
+// public:
msw 2014/05/22 04:26:48 nit: remove lines not directly related to init; I'
Andrew Hayden (chromium.org) 2014/05/22 10:33:45 Done.
+// virtual MyTestClass() {}
+// virtual ~MyTestclass() {}
+// virtual void SetUpOnMainThread() OVERRIDE {
+// dynamic_data_scope.Init();
msw 2014/05/22 04:26:48 If this doesn't need to ASSERT_NO_FATAL_FAILURE(..
Andrew Hayden (chromium.org) 2014/05/22 10:33:45 Thorny question. It doesn't make sense to ASSERT_N
msw 2014/05/22 18:16:58 Thanks for clarifying, I suppose what you have is
+// InProcessBrowserTest::SetUpOnMainThread();
+// }
+// private:
+// test::ScopedCLDDynamicDataHarness dynamic_data_scope;
+// DISALLOW_COPY_AND_ASSIGN(MyTestClass);
+// };
//
-// NB: Test data lives under src/chrome/test/data/cld2_component
+// IN_PROC_BROWSER_TEST_F(MyTestClass, MyTest) {
+// (your code here)
+// }
class ScopedCLDDynamicDataHarness {
public:
// Constructs the object, but does nothing. Call Init() to prepare the

Powered by Google App Engine
This is Rietveld 408576698