OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ |
6 #define CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ | 6 #define CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // If you have a lot of tests that need language translation features, you can | 29 // If you have a lot of tests that need language translation features, you can |
30 // add an instance of the CldDataHarness to your test class' private | 30 // add an instance of the CldDataHarness to your test class' private |
31 // member variables and add the call to Init() into SetUpOnMainThread. | 31 // member variables and add the call to Init() into SetUpOnMainThread. |
32 // Sample use: | 32 // Sample use: |
33 // | 33 // |
34 // class MyTestClass : public InProcessBrowserTest { | 34 // class MyTestClass : public InProcessBrowserTest { |
35 // public: | 35 // public: |
36 // MyTestClass() : | 36 // MyTestClass() : |
37 // cld_data_scope(test::CreateCldDataHarness()) { | 37 // cld_data_scope(test::CreateCldDataHarness()) { |
38 // } | 38 // } |
39 // virtual void SetUpOnMainThread() OVERRIDE { | 39 // virtual void SetUpOnMainThread() override { |
40 // cld_data_scope->Init(); | 40 // cld_data_scope->Init(); |
41 // InProcessBrowserTest::SetUpOnMainThread(); | 41 // InProcessBrowserTest::SetUpOnMainThread(); |
42 // } | 42 // } |
43 // private: | 43 // private: |
44 // scoped_ptr<test::CldDataHarness> cld_data_scope; | 44 // scoped_ptr<test::CldDataHarness> cld_data_scope; |
45 // }; | 45 // }; |
46 // | 46 // |
47 class CldDataHarness { | 47 class CldDataHarness { |
48 public: | 48 public: |
49 // Reverses the work done by the Init() method: any files and/or directories | 49 // Reverses the work done by the Init() method: any files and/or directories |
(...skipping 21 matching lines...) Expand all Loading... |
71 void GetTestDataSourceDirectory(base::FilePath* out_path); | 71 void GetTestDataSourceDirectory(base::FilePath* out_path); |
72 }; | 72 }; |
73 | 73 |
74 // Static factory function that returns a data harness defined by the | 74 // Static factory function that returns a data harness defined by the |
75 // implementation, which must be a subclass of CldDataHarness. | 75 // implementation, which must be a subclass of CldDataHarness. |
76 scoped_ptr<CldDataHarness> CreateCldDataHarness(); | 76 scoped_ptr<CldDataHarness> CreateCldDataHarness(); |
77 | 77 |
78 } // namespace test | 78 } // namespace test |
79 | 79 |
80 #endif // CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ | 80 #endif // CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_H_ |
OLD | NEW |