OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ | 5 #ifndef CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ |
6 #define CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ | 6 #define CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 | 9 |
10 #include "chrome/test/base/web_ui_browser_test.h" | 10 #include "chrome/test/base/web_ui_browser_test.h" |
11 | 11 |
12 class HistoryService; | 12 class HistoryService; |
13 | 13 |
14 class HistoryUIBrowserTest : public WebUIBrowserTest { | 14 class HistoryUIBrowserTest : public WebUIBrowserTest { |
15 public: | 15 public: |
16 HistoryUIBrowserTest(); | 16 HistoryUIBrowserTest(); |
17 virtual ~HistoryUIBrowserTest(); | 17 virtual ~HistoryUIBrowserTest(); |
18 | 18 |
19 virtual void SetUpOnMainThread() OVERRIDE; | 19 virtual void SetUpOnMainThread() override; |
20 | 20 |
21 protected: | 21 protected: |
22 // Sets the pref to allow or prohibit deleting history entries. | 22 // Sets the pref to allow or prohibit deleting history entries. |
23 void SetDeleteAllowed(bool allowed); | 23 void SetDeleteAllowed(bool allowed); |
24 | 24 |
25 // Add a test entry to the history database. The timestamp for the entry will | 25 // Add a test entry to the history database. The timestamp for the entry will |
26 // be |hour_offset| hours after |baseline_time_|. | 26 // be |hour_offset| hours after |baseline_time_|. |
27 void AddPageToHistory( | 27 void AddPageToHistory( |
28 int hour_offset, const std::string& url, const std::string& title); | 28 int hour_offset, const std::string& url, const std::string& title); |
29 | 29 |
30 // Clears kAcceptLanguages pref value. | 30 // Clears kAcceptLanguages pref value. |
31 void ClearAcceptLanguages(); | 31 void ClearAcceptLanguages(); |
32 | 32 |
33 private: | 33 private: |
34 // The HistoryService is owned by the profile. | 34 // The HistoryService is owned by the profile. |
35 HistoryService* history_; | 35 HistoryService* history_; |
36 | 36 |
37 // The time from which entries added via AddPageToHistory() will be offset. | 37 // The time from which entries added via AddPageToHistory() will be offset. |
38 base::Time baseline_time_; | 38 base::Time baseline_time_; |
39 | 39 |
40 // Counter used to generate a unique ID for each page added to the history. | 40 // Counter used to generate a unique ID for each page added to the history. |
41 int32 page_id_; | 41 int32 page_id_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(HistoryUIBrowserTest); | 43 DISALLOW_COPY_AND_ASSIGN(HistoryUIBrowserTest); |
44 }; | 44 }; |
45 | 45 |
46 #endif // CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ | 46 #endif // CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_ |
OLD | NEW |