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

Side by Side Diff: chrome/browser/chromeos/login/saml/saml_browsertest.cc

Issue 1097663003: Fetch OAuth2 tokens prior to profile creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set up default networks 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 <cstring> 5 #include <cstring>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/common/chrome_paths.h" 44 #include "chrome/common/chrome_paths.h"
45 #include "chrome/common/chrome_switches.h" 45 #include "chrome/common/chrome_switches.h"
46 #include "chrome/common/extensions/features/feature_channel.h" 46 #include "chrome/common/extensions/features/feature_channel.h"
47 #include "chrome/common/pref_names.h" 47 #include "chrome/common/pref_names.h"
48 #include "chrome/grit/generated_resources.h" 48 #include "chrome/grit/generated_resources.h"
49 #include "chrome/test/base/in_process_browser_test.h" 49 #include "chrome/test/base/in_process_browser_test.h"
50 #include "chromeos/chromeos_switches.h" 50 #include "chromeos/chromeos_switches.h"
51 #include "chromeos/dbus/dbus_thread_manager.h" 51 #include "chromeos/dbus/dbus_thread_manager.h"
52 #include "chromeos/dbus/fake_session_manager_client.h" 52 #include "chromeos/dbus/fake_session_manager_client.h"
53 #include "chromeos/dbus/session_manager_client.h" 53 #include "chromeos/dbus/session_manager_client.h"
54 #include "chromeos/dbus/shill_manager_client.h"
54 #include "chromeos/settings/cros_settings_names.h" 55 #include "chromeos/settings/cros_settings_names.h"
55 #include "components/policy/core/browser/browser_policy_connector.h" 56 #include "components/policy/core/browser/browser_policy_connector.h"
56 #include "components/policy/core/common/mock_configuration_policy_provider.h" 57 #include "components/policy/core/common/mock_configuration_policy_provider.h"
57 #include "components/policy/core/common/policy_map.h" 58 #include "components/policy/core/common/policy_map.h"
58 #include "components/policy/core/common/policy_switches.h" 59 #include "components/policy/core/common/policy_switches.h"
59 #include "components/policy/core/common/policy_types.h" 60 #include "components/policy/core/common/policy_types.h"
60 #include "components/user_manager/user.h" 61 #include "components/user_manager/user.h"
61 #include "components/user_manager/user_manager.h" 62 #include "components/user_manager/user_manager.h"
62 #include "content/public/browser/browser_thread.h" 63 #include "content/public/browser/browser_thread.h"
63 #include "content/public/browser/render_frame_host.h" 64 #include "content/public/browser/render_frame_host.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 OobeBaseTest::SetUpCommandLine(command_line); 286 OobeBaseTest::SetUpCommandLine(command_line);
286 } 287 }
287 288
288 void SetUpOnMainThread() override { 289 void SetUpOnMainThread() override {
289 fake_gaia_->SetFakeMergeSessionParams( 290 fake_gaia_->SetFakeMergeSessionParams(
290 kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); 291 kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1);
291 292
292 embedded_test_server()->RegisterRequestHandler(base::Bind( 293 embedded_test_server()->RegisterRequestHandler(base::Bind(
293 &FakeSamlIdp::HandleRequest, base::Unretained(&fake_saml_idp_))); 294 &FakeSamlIdp::HandleRequest, base::Unretained(&fake_saml_idp_)));
294 295
296 // Set up fake networks.
297 DBusThreadManager::Get()
298 ->GetShillManagerClient()
299 ->GetTestInterface()
300 ->SetupDefaultEnvironment();
xiyuan 2015/04/23 16:09:23 nit: Move this to SAMLPolicyTest::SetUpOnMainThrea
achuithb 2015/04/23 22:11:16 Done.
301
295 OobeBaseTest::SetUpOnMainThread(); 302 OobeBaseTest::SetUpOnMainThread();
296 } 303 }
297 304
298 virtual void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) { 305 virtual void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) {
299 WaitForSigninScreen(); 306 WaitForSigninScreen();
300 307
301 if (!saml_load_injected_) { 308 if (!saml_load_injected_) {
302 saml_load_injected_ = true; 309 saml_load_injected_ = true;
303 310
304 ASSERT_TRUE(content::ExecuteScript( 311 ASSERT_TRUE(content::ExecuteScript(
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); 1118 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName));
1112 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); 1119 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName));
1113 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); 1120 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName));
1114 } 1121 }
1115 1122
1116 INSTANTIATE_TEST_CASE_P(SamlSuite, 1123 INSTANTIATE_TEST_CASE_P(SamlSuite,
1117 SAMLPolicyTest, 1124 SAMLPolicyTest,
1118 testing::Bool()); 1125 testing::Bool());
1119 1126
1120 } // namespace chromeos 1127 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698