OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/prefs/scoped_user_pref_update.h" | 7 #include "base/prefs/scoped_user_pref_update.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/content_settings/cookie_settings.h" | 9 #include "chrome/browser/content_settings/cookie_settings.h" |
10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 protected: | 130 protected: |
131 content::WebContents* web_contents() { return nullptr; } | 131 content::WebContents* web_contents() { return nullptr; } |
132 }; | 132 }; |
133 | 133 |
134 void InlineLoginUIBrowserTest::SetUpSigninManager(const std::string& username) { | 134 void InlineLoginUIBrowserTest::SetUpSigninManager(const std::string& username) { |
135 if (username.empty()) | 135 if (username.empty()) |
136 return; | 136 return; |
137 | 137 |
138 SigninManagerBase* signin_manager = | 138 SigninManagerBase* signin_manager = |
139 SigninManagerFactory::GetForProfile(browser()->profile()); | 139 SigninManagerFactory::GetForProfile(browser()->profile()); |
140 signin_manager->SetAuthenticatedUsername(username); | 140 signin_manager->SetAuthenticatedAccountInfo(username, username); |
141 } | 141 } |
142 | 142 |
143 void InlineLoginUIBrowserTest::EnableSigninAllowed(bool enable) { | 143 void InlineLoginUIBrowserTest::EnableSigninAllowed(bool enable) { |
144 PrefService* pref_service = browser()->profile()->GetPrefs(); | 144 PrefService* pref_service = browser()->profile()->GetPrefs(); |
145 pref_service->SetBoolean(prefs::kSigninAllowed, enable); | 145 pref_service->SetBoolean(prefs::kSigninAllowed, enable); |
146 } | 146 } |
147 | 147 |
148 void InlineLoginUIBrowserTest::EnableOneClick(bool enable) { | 148 void InlineLoginUIBrowserTest::EnableOneClick(bool enable) { |
149 PrefService* pref_service = browser()->profile()->GetPrefs(); | 149 PrefService* pref_service = browser()->profile()->GetPrefs(); |
150 pref_service->SetBoolean(prefs::kReverseAutologinEnabled, enable); | 150 pref_service->SetBoolean(prefs::kReverseAutologinEnabled, enable); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 ->AddObserver(&observer); | 466 ->AddObserver(&observer); |
467 base::RunLoop run_loop; | 467 base::RunLoop run_loop; |
468 EXPECT_CALL(observer, OnUntrustedLoginUIShown()) | 468 EXPECT_CALL(observer, OnUntrustedLoginUIShown()) |
469 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 469 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
470 | 470 |
471 ExecuteJsToSigninInSigninFrame(browser(), "email@gmail.com", "password"); | 471 ExecuteJsToSigninInSigninFrame(browser(), "email@gmail.com", "password"); |
472 run_loop.Run(); | 472 run_loop.Run(); |
473 base::MessageLoop::current()->RunUntilIdle(); | 473 base::MessageLoop::current()->RunUntilIdle(); |
474 } | 474 } |
475 #endif // OS_CHROMEOS | 475 #endif // OS_CHROMEOS |
OLD | NEW |