Chromium Code Reviews| Index: chrome/browser/translate/translate_tab_helper.h |
| diff --git a/chrome/browser/translate/translate_tab_helper.h b/chrome/browser/translate/translate_tab_helper.h |
| index 10fb138aa9fe6ed2565fcdc9311d6bc5d69c5b23..6e582977b59b4b86bcbc29bb7c031288e3276d29 100644 |
| --- a/chrome/browser/translate/translate_tab_helper.h |
| +++ b/chrome/browser/translate/translate_tab_helper.h |
| @@ -26,12 +26,16 @@ |
| namespace base { |
| class File; |
| -} |
| +} // namespace base |
| namespace content { |
| class BrowserContext; |
| class WebContents; |
| -} |
| +} // namespace content |
| + |
| +namespace test { |
| +class TranslateBrowserUtilsTest; |
| +} // namespace test |
| struct LanguageDetectionDetails; |
| class PrefService; |
| @@ -100,6 +104,7 @@ class TranslateTabHelper |
| private: |
| explicit TranslateTabHelper(content::WebContents* web_contents); |
| friend class content::WebContentsUserData<TranslateTabHelper>; |
| + friend class test::TranslateBrowserUtilsTest; // For cleaning up static state |
|
Sorin Jianu
2014/05/15 17:16:13
Ends with .
Andrew Hayden (chromium.org)
2014/05/16 17:53:20
Done.
|
| // content::WebContentsObserver implementation. |
| virtual void NavigationEntryCommitted( |
| @@ -143,6 +148,12 @@ class TranslateTabHelper |
| const uint64 data_offset, |
| const uint64 data_length); |
| + // For testing purposes only, clear the s_cached_* state. Leaks the open |
|
Sorin Jianu
2014/05/15 17:16:13
clears
Sorin Jianu
2014/05/15 17:16:13
Since we already have test friendship, would it be
Andrew Hayden (chromium.org)
2014/05/16 17:53:20
Done.
|
| + // file handle, because renderer processes could be using it and there's no |
| + // way to be sure that they aren't. This effectively allows a test harness |
| + // to wipe any cached state. |
| + static void ClearCLDDataForTest(); |
| + |
| // The data file, cached as long as the process stays alive. |
| // We also track the offset at which the data starts, and its length. |
| static base::File* s_cached_file_; // guarded by file_lock_ |