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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_
6 #define CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_
8 #include "base/time/time.h"
10 #include "chrome/test/base/web_ui_browser_test.h"
16 class HistoryUIBrowserTest
: public WebUIBrowserTest
{
18 HistoryUIBrowserTest();
19 ~HistoryUIBrowserTest() override
;
21 void SetUpOnMainThread() override
;
24 // Sets the pref to allow or prohibit deleting history entries.
25 void SetDeleteAllowed(bool allowed
);
27 // Add a test entry to the history database. The timestamp for the entry will
28 // be |hour_offset| hours after |baseline_time_|.
29 void AddPageToHistory(
30 int hour_offset
, const std::string
& url
, const std::string
& title
);
32 // Clears kAcceptLanguages pref value.
33 void ClearAcceptLanguages();
36 // The HistoryService is owned by the profile.
37 history::HistoryService
* history_
;
39 // The time from which entries added via AddPageToHistory() will be offset.
40 base::Time baseline_time_
;
42 // Counter used to generate a unique ID for each page added to the history.
45 DISALLOW_COPY_AND_ASSIGN(HistoryUIBrowserTest
);
48 #endif // CHROME_TEST_DATA_WEBUI_HISTORY_UI_BROWSERTEST_H_