OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
14 #include "chrome/browser/extensions/extension_apitest.h" | 14 #include "chrome/browser/extensions/extension_apitest.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
17 #include "google_apis/gaia/fake_gaia.h" | 17 #include "google_apis/gaia/fake_gaia.h" |
18 #include "net/test/embedded_test_server/embedded_test_server.h" | 18 #include "net/test/embedded_test_server/embedded_test_server.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class WebUI; | 21 class WebUI; |
| 22 class WindowedNotificationObserver; |
| 23 } |
| 24 |
| 25 namespace extensions { |
| 26 class ScopedCurrentChannel; |
22 } | 27 } |
23 | 28 |
24 namespace chromeos { | 29 namespace chromeos { |
25 | 30 |
| 31 class HTTPSForwarder; |
26 class NetworkPortalDetectorTestImpl; | 32 class NetworkPortalDetectorTestImpl; |
27 | 33 |
28 // Base class for OOBE and Kiosk tests. | 34 // Base class for OOBE, login, SAML and Kiosk tests. |
29 class OobeBaseTest : public ExtensionApiTest { | 35 class OobeBaseTest : public ExtensionApiTest { |
30 public: | 36 public: |
31 OobeBaseTest(); | 37 OobeBaseTest(); |
32 ~OobeBaseTest() override; | 38 ~OobeBaseTest() override; |
33 | 39 |
34 protected: | 40 protected: |
35 // InProcessBrowserTest overrides. | 41 // InProcessBrowserTest overrides. |
36 void SetUp() override; | 42 void SetUp() override; |
37 void SetUpInProcessBrowserTestFixture() override; | 43 void SetUpInProcessBrowserTestFixture() override; |
| 44 bool SetUpUserDataDirectory() override; |
38 void SetUpOnMainThread() override; | 45 void SetUpOnMainThread() override; |
39 void TearDownOnMainThread() override; | 46 void TearDownOnMainThread() override; |
40 void SetUpCommandLine(base::CommandLine* command_line) override; | 47 void SetUpCommandLine(base::CommandLine* command_line) override; |
41 | 48 |
| 49 virtual void InitHttpsForwarders(); |
| 50 |
42 // Network status control functions. | 51 // Network status control functions. |
43 void SimulateNetworkOffline(); | 52 void SimulateNetworkOffline(); |
44 void SimulateNetworkOnline(); | 53 void SimulateNetworkOnline(); |
45 void SimulateNetworkPortal(); | 54 void SimulateNetworkPortal(); |
46 | 55 |
47 base::Closure SimulateNetworkOfflineClosure(); | 56 base::Closure SimulateNetworkOfflineClosure(); |
48 base::Closure SimulateNetworkOnlineClosure(); | 57 base::Closure SimulateNetworkOnlineClosure(); |
49 base::Closure SimulateNetworkPortalClosure(); | 58 base::Closure SimulateNetworkPortalClosure(); |
50 | 59 |
51 // Checks JavaScript |expression| in login screen. | 60 // Checks JavaScript |expression| in login screen. |
52 void JsExpect(const std::string& expression); | 61 void JsExpect(const std::string& expression); |
53 | 62 |
54 // Returns chrome://oobe WebUI. | 63 // Returns chrome://oobe WebUI. |
55 content::WebUI* GetLoginUI(); | 64 content::WebUI* GetLoginUI(); |
56 | 65 |
57 // Returns login display. | 66 // Returns login display. |
58 WebUILoginDisplay* GetLoginDisplay(); | 67 WebUILoginDisplay* GetLoginDisplay(); |
59 | 68 |
| 69 void WaitForSigninScreen(); |
| 70 void ExecuteJsInSigninFrame(const std::string& js); |
| 71 void SetSignFormField(const std::string& field_id, |
| 72 const std::string& field_value); |
| 73 |
60 scoped_ptr<FakeGaia> fake_gaia_; | 74 scoped_ptr<FakeGaia> fake_gaia_; |
61 NetworkPortalDetectorTestImpl* network_portal_detector_; | 75 NetworkPortalDetectorTestImpl* network_portal_detector_; |
62 | 76 |
63 // Whether to use background networking. Note this is only effective when it | 77 // Whether to use background networking. Note this is only effective when it |
64 // is set before SetUpCommandLine is invoked. | 78 // is set before SetUpCommandLine is invoked. |
65 bool needs_background_networking_; | 79 bool needs_background_networking_; |
| 80 |
| 81 scoped_ptr<content::WindowedNotificationObserver> login_screen_load_observer_; |
| 82 scoped_ptr<extensions::ScopedCurrentChannel> scoped_channel_; |
| 83 scoped_ptr<HTTPSForwarder> gaia_https_forwarder_; |
| 84 std::string gaia_frame_parent_; |
| 85 bool use_webview_; |
| 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(OobeBaseTest); |
66 }; | 88 }; |
67 | 89 |
68 } // namespace chromeos | 90 } // namespace chromeos |
69 | 91 |
70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ | 92 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_ |
OLD | NEW |