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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7e3548d4b185b88e75a232fd1e1565f7d36edbfe |
--- /dev/null |
+++ b/chrome/browser/translate/translate_browser_test_utils.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |
+#define CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |
+ |
+#include "base/macros.h" |
+ |
+namespace test { |
+ |
+// A utility class that sets up CLD dynamic data when constructed, and cleans |
+// it up when destroyed. |
+// The test data for this class lives under: |
+// src/chrome/test/data/cld2_component |
+class ScopedCLDDynamicDataHarness { |
+ public: |
+ // Invokes whatever dark magic is required in order to make the CLD data |
+ // available immediately to testing code. The implementation may vary |
+ // depending on the following defines, bypassing any external data access |
+ // requirements. |
+ ScopedCLDDynamicDataHarness(); |
+ |
+ // Reverses the work done by the constructor: any files and/or directories |
+ // that would be created by the constructor are immediately and irrevocably |
+ // deleted. |
+ // If dynamic data is not currently available for any reason, this method has |
+ // no net effect on the runtime. |
+ ~ScopedCLDDynamicDataHarness(); |
+ |
+ private: |
+ void ClearStandaloneDataFileState(); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScopedCLDDynamicDataHarness); |
+}; |
+ |
+} // namespace test |
+ |
+#endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_TEST_UTILS_H_ |