Chromium Code Reviews| Index: chrome/browser/chromeos/login/wizard_controller_browsertest.cc |
| diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc |
| index 658a78a6965d947c9ca10b7823379c636485e5e9..2ac68a35324679c46acdf6317ee0f0965b80a5e9 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc |
| @@ -7,6 +7,8 @@ |
| #include "base/basictypes.h" |
| #include "base/command_line.h" |
| #include "base/compiler_specific.h" |
| +#include "base/json/json_file_value_serializer.h" |
| +#include "base/path_service.h" |
| #include "base/prefs/pref_registry_simple.h" |
| #include "base/prefs/pref_service.h" |
| #include "base/prefs/pref_service_factory.h" |
| @@ -48,6 +50,7 @@ |
| #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| +#include "chrome/common/chrome_constants.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/pref_names.h" |
| @@ -965,7 +968,9 @@ IN_PROC_BROWSER_TEST_F(WizardControllerBrokenLocalStateTest, |
| ASSERT_EQ(1, fake_session_manager_client()->start_device_wipe_call_count()); |
| } |
| -class WizardControllerProxyAuthOnSigninTest : public WizardControllerTest { |
| +class WizardControllerProxyAuthOnSigninTest |
| + : public WizardControllerTest, |
| + public testing::WithParamInterface<bool> { |
|
dzhioev (left Google)
2015/04/15 17:36:25
nit: please put a comment here on the parameter me
Nikita (slow)
2015/04/15 18:35:42
Done.
|
| protected: |
| WizardControllerProxyAuthOnSigninTest() |
| : proxy_server_(net::SpawnedTestServer::TYPE_BASIC_AUTH_PROXY, |
| @@ -991,6 +996,32 @@ class WizardControllerProxyAuthOnSigninTest : public WizardControllerTest { |
| proxy_server_.host_port_pair().ToString()); |
| } |
| + bool SetUpUserDataDirectory() override { |
| + base::FilePath user_data_dir; |
| + CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); |
| + base::FilePath local_state_path = |
| + user_data_dir.Append(chrome::kLocalStateFilename); |
| + |
| + // Set webview disabled flag only when local state file does not exist. |
| + // Otherwise, we break PRE tests that leave state in it. |
| + if (!base::PathExists(local_state_path)) { |
| + base::DictionaryValue local_state_dict; |
| + |
| + if (!GetParam()) |
| + local_state_dict.SetBoolean(prefs::kWebviewSigninDisabled, true); |
| + |
| + // TODO(paulmeyer): Re-enable webview version of this test |
| + // (drop this condition) once http://crbug.com/452452 is fixed. |
| + if (GetParam()) |
| + local_state_dict.SetBoolean(prefs::kWebviewSigninDisabled, true); |
| + |
| + CHECK(JSONFileValueSerializer(local_state_path) |
| + .Serialize(local_state_dict)); |
| + } |
| + |
| + return WizardControllerTest::SetUpUserDataDirectory(); |
| + } |
| + |
| net::SpawnedTestServer& proxy_server() { return proxy_server_; } |
| private: |
| @@ -999,7 +1030,7 @@ class WizardControllerProxyAuthOnSigninTest : public WizardControllerTest { |
| DISALLOW_COPY_AND_ASSIGN(WizardControllerProxyAuthOnSigninTest); |
| }; |
| -IN_PROC_BROWSER_TEST_F(WizardControllerProxyAuthOnSigninTest, |
| +IN_PROC_BROWSER_TEST_P(WizardControllerProxyAuthOnSigninTest, |
| ProxyAuthDialogOnSigninScreen) { |
| content::WindowedNotificationObserver auth_needed_waiter( |
| chrome::NOTIFICATION_AUTH_NEEDED, |
| @@ -1011,6 +1042,10 @@ IN_PROC_BROWSER_TEST_F(WizardControllerProxyAuthOnSigninTest, |
| auth_needed_waiter.Wait(); |
| } |
| +INSTANTIATE_TEST_CASE_P(WizardControllerProxyAuthOnSigninSuite, |
| + WizardControllerProxyAuthOnSigninTest, |
| + testing::Bool()); |
| + |
| class WizardControllerKioskFlowTest : public WizardControllerFlowTest { |
| protected: |
| WizardControllerKioskFlowTest() {} |