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 |