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_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_BROWSERTEST_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_BROWSERTEST_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/test/base/web_ui_browser_test.h"
11 #include "content/public/browser/web_ui_message_handler.h"
13 // This is a helper class used by options_browsertest.js to feed the navigation
14 // history back to the test.
15 class OptionsBrowserTest
: public WebUIBrowserTest
,
16 public content::WebUIMessageHandler
{
19 ~OptionsBrowserTest() override
;
22 // Clears the preference at the given |path|.
23 void ClearPref(const char* path
);
26 // WebUIMessageHandler implementation.
27 void RegisterMessages() override
;
29 // WebUIBrowserTest implementation.
30 content::WebUIMessageHandler
* GetMockMessageHandler() override
;
32 // A callback for the 'optionsTestReportHistory' message, this sends the
33 // URLs in the "back" tab history, including the current entry, back to the
34 // WebUI via a callback.
35 void ReportHistory(const base::ListValue
* list_value
);
37 // A callback for the 'optionsTestSetPref' message. The first argument should
38 // be a pref path (e.g., "profile.managed_users"); the second, the new value
39 // to set for that pref.
40 void HandleSetPref(const base::ListValue
* args
);
42 DISALLOW_COPY_AND_ASSIGN(OptionsBrowserTest
);
45 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_BROWSERTEST_H_