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