OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 |
| 10 namespace test { |
| 11 |
| 12 // A utility class that sets up CLD dynamic data when constructed, and cleans |
| 13 // it up when destroyed. |
| 14 // The test data for this class lives under: |
| 15 // src/chrome/test/data/cld2_component |
| 16 class ScopedCLDDynamicDataHarness { |
| 17 public: |
| 18 // Invokes whatever dark magic is required in order to make the CLD data |
| 19 // available immediately to testing code. The implementation may vary |
| 20 // depending on the following defines, bypassing any external data access |
| 21 // requirements. |
| 22 ScopedCLDDynamicDataHarness(); |
| 23 |
| 24 // Reverses the work done by the constructor: any files and/or directories |
| 25 // that would be created by the constructor are immediately and irrevocably |
| 26 // deleted. |
| 27 // If dynamic data is not currently available for any reason, this method has |
| 28 // no net effect on the runtime. |
| 29 ~ScopedCLDDynamicDataHarness(); |
| 30 |
| 31 private: |
| 32 void ClearStandaloneDataFileState(); |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(ScopedCLDDynamicDataHarness); |
| 35 }; |
| 36 |
| 37 } // namespace test |
| 38 |
| 39 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |
OLD | NEW |