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

Unified Diff: chrome/browser/chromeos/login/wizard_controller_browsertest.cc

Issue 1079083002: [cros New-GAIA] Webview login and new GAIA endpoint enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix saml test Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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..3b71746928dbcf6dee190a24ac0c1e301d97be89 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,11 @@ IN_PROC_BROWSER_TEST_F(WizardControllerBrokenLocalStateTest,
ASSERT_EQ(1, fake_session_manager_client()->start_device_wipe_call_count());
}
-class WizardControllerProxyAuthOnSigninTest : public WizardControllerTest {
+// Boolean parameter is used to run this test for webview (true) and for
+// iframe (false) GAIA sign in.
+class WizardControllerProxyAuthOnSigninTest
+ : public WizardControllerTest,
+ public testing::WithParamInterface<bool> {
protected:
WizardControllerProxyAuthOnSigninTest()
: proxy_server_(net::SpawnedTestServer::TYPE_BASIC_AUTH_PROXY,
@@ -991,6 +998,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 +1032,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 +1044,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() {}

Powered by Google App Engine
This is Rietveld 408576698