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

Unified Diff: chrome/browser/chromeos/login/saml/saml_browsertest.cc

Issue 1021383002: cros: Transfer auth cookies for SAML webview sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, break UserCloudPolicyManagerChromeOS dependency on UserSessionManager to fix tests Created 5 years, 9 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/saml/saml_browsertest.cc
diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc
index 047a7aa5d49cf436c22e089f36def2a1e16f50c4..9bfde3ed962852e1cf7b8af0857e1b70849fedd2 100644
--- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc
+++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc
@@ -293,23 +293,28 @@ class SamlTest : public InProcessBrowserTest,
bool SetUpUserDataDirectory() override {
if (UseWebView()) {
- // Enable webview signin.
+ // Fake Dev channel to enable webview signin.
scoped_channel_.reset(new extensions::ScopedCurrentChannel(
chrome::VersionInfo::CHANNEL_DEV));
- base::DictionaryValue local_state_dict;
- local_state_dict.SetBoolean(prefs::kWebviewSigninEnabled, true);
- // OobeCompleted to skip controller-pairing-screen which still uses
- // iframe and ends up in a JS error in oobe page init.
- // See http://crbug.com/467147
- local_state_dict.SetBoolean(prefs::kOobeComplete, true);
-
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);
- CHECK(JSONFileValueSerializer(local_state_path)
- .Serialize(local_state_dict));
+
+ // Set webview enabled flag only when local state file does not exist.
+ // Otherwise, we break PRE tests that leave state in it.
Mattias Nissler (ping if slow) 2015/03/25 08:28:18 Shouldn't we fix these tests instead? Or are you a
xiyuan 2015/03/25 19:26:19 The PRE tests are valid. They are added to setup s
+ if (!base::PathExists(local_state_path)) {
+ base::DictionaryValue local_state_dict;
+ local_state_dict.SetBoolean(prefs::kWebviewSigninEnabled, true);
+ // OobeCompleted to skip controller-pairing-screen which still uses
+ // iframe and ends up in a JS error in oobe page init.
+ // See http://crbug.com/467147
+ local_state_dict.SetBoolean(prefs::kOobeComplete, true);
+
+ CHECK(JSONFileValueSerializer(local_state_path)
+ .Serialize(local_state_dict));
+ }
}
return InProcessBrowserTest::SetUpUserDataDirectory();
@@ -1250,6 +1255,6 @@ IN_PROC_BROWSER_TEST_P(SAMLPolicyTest, TransferCookiesUnaffiliated) {
// TODO(xiyuan): Update once cookies are properly handled.
INSTANTIATE_TEST_CASE_P(SamlSuite,
SAMLPolicyTest,
- testing::Values(false));
+ testing::Bool());
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698