Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.h

Issue 290453006: Quick & dirty example of a WebUIBrowserTest using LoginManagerTestHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: broken test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SHARED_OPTIONS_BROWSERTEST_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SHARED_OPTIONS_BROWSERTEST_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/test/base/web_ui_browsertest.h"
11
12 #include "chrome/browser/chromeos/login/existing_user_controller.h"
13
14 #include "chrome/browser/chromeos/login/ui/mock_login_display_host.h"
15
16 #include "chrome/browser/chromeos/login/ui/mock_login_display.h"
17
18
19 //#include "content/public/browser/web_ui_message_handler.h"
20
21 //#include "base/prefs/pref_service.h"
22
23 #include "chrome/browser/chromeos/login/login_manager_test_helper.h"
24 //#include "chrome/browser/chromeos/login/startup_utils.h"
25 //#include "chrome/browser/chromeos/login/user_adding_screen.h"
26 //#include "chrome/browser/chromeos/login/user_manager.h"
27 //#include "chrome/browser/chromeos/settings/cros_settings.h"
28 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
29 //#include "chrome/browser/ui/browser.h"
30 //#include "chrome/common/chrome_switches.h"
31 //#include "chrome/common/pref_names.h"
32 //#include "chrome/test/base/ui_test_utils.h"
33 //#include "chrome/browser/ui/tabs/tab_strip_model.h"
34 //#include "chromeos/settings/cros_settings_names.h"
35 //#include "content/public/browser/web_contents.h"
36 //#include "content/public/test/browser_test_utils.h"
37 //#include "content/public/test/test_utils.h"
38 #include "content/public/browser/web_ui_message_handler.h"
39
40 namespace chromeos {
41
42 class CrosSettingsProvider;
43 class User;
44
45 // todo: // This is a helper class used by options_browsertest.js to feed the na vigation
46 // history back to the test. blah blah
47 class SharedOptionsTest : public WebUIBrowserTest,
48 public content::WebUIMessageHandler {
49 public:
50 SharedOptionsTest();
51 virtual ~SharedOptionsTest();
52
53 // WebUIBrowserTest implementation.
54 virtual void SetUpOnMainThread() OVERRIDE;
55 virtual void CleanUpOnMainThread() OVERRIDE;
56 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
57 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
58
59 // WebUIMessageHandler implementation.
60 virtual void RegisterMessages() OVERRIDE;
61
62 // WebUIBrowserTest implementation.
63 virtual content::WebUIMessageHandler* GetMockMessageHandler() OVERRIDE;
64
65 void SetUpLoginDisplay();
66
67 protected:
68 void CheckOptionsUI(const User* user, bool is_primary);
69
70 StubCrosSettingsProvider stub_settings_provider_;
71 CrosSettingsProvider* device_settings_provider_;
72 scoped_ptr<LoginManagerTestHelper> login_manager_test_helper_;
73
74 private:
75 // A callback for the 'optionsTestReportHistory' message, this sends the
76 // URLs in the "back" tab history, including the current entry, back to the
77 // WebUI via a callback.
78 void ReportHistory(const base::ListValue* list_value);
79
80 void RegisterUsers(const base::ListValue* list_value);
81 void LogInUser(const base::ListValue* list_value);
82 void AddUser(const base::ListValue* list_value);
83 scoped_ptr<ExistingUserController> existing_user_controller_;
84 scoped_ptr<MockLoginDisplayHost> mock_login_display_host_;
85 MockLoginDisplay* mock_login_display_;
86
87 DISALLOW_COPY_AND_ASSIGN(SharedOptionsTest);
88 };
89
90 } // namespace chromeos
91
92 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SHARED_OPTIONS_BROWSERTEST_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698