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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_
10 #include "base/callback.h"
11 #include "base/command_line.h"
12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
14 #include "chrome/browser/extensions/extension_apitest.h"
15 #include "chrome/test/base/in_process_browser_test.h"
16 #include "content/public/test/test_utils.h"
17 #include "google_apis/gaia/fake_gaia.h"
18 #include "net/test/embedded_test_server/embedded_test_server.h"
26 class NetworkPortalDetectorTestImpl
;
28 // Base class for OOBE and Kiosk tests.
29 class OobeBaseTest
: public ExtensionApiTest
{
32 ~OobeBaseTest() override
;
35 // InProcessBrowserTest overrides.
36 void SetUp() override
;
37 void SetUpInProcessBrowserTestFixture() override
;
38 void SetUpOnMainThread() override
;
39 void TearDownOnMainThread() override
;
40 void SetUpCommandLine(base::CommandLine
* command_line
) override
;
42 // Network status control functions.
43 void SimulateNetworkOffline();
44 void SimulateNetworkOnline();
45 void SimulateNetworkPortal();
47 base::Closure
SimulateNetworkOfflineClosure();
48 base::Closure
SimulateNetworkOnlineClosure();
49 base::Closure
SimulateNetworkPortalClosure();
51 // Checks JavaScript |expression| in login screen.
52 void JsExpect(const std::string
& expression
);
54 // Returns chrome://oobe WebUI.
55 content::WebUI
* GetLoginUI();
57 // Returns login display.
58 WebUILoginDisplay
* GetLoginDisplay();
60 scoped_ptr
<FakeGaia
> fake_gaia_
;
61 NetworkPortalDetectorTestImpl
* network_portal_detector_
;
63 // Whether to use background networking. Note this is only effective when it
64 // is set before SetUpCommandLine is invoked.
65 bool needs_background_networking_
;
68 } // namespace chromeos
70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_OOBE_BASE_TEST_H_