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

Side by Side Diff: chrome/browser/chromeos/login/login_utils_browsertest.cc

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 .WillRepeatedly(Return(std::string("stub_system_salt"))); 398 .WillRepeatedly(Return(std::string("stub_system_salt")));
399 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _)) 399 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _))
400 .WillRepeatedly(Return()); 400 .WillRepeatedly(Return());
401 401
402 scoped_refptr<Authenticator> authenticator = 402 scoped_refptr<Authenticator> authenticator =
403 LoginUtils::Get()->CreateAuthenticator(this); 403 LoginUtils::Get()->CreateAuthenticator(this);
404 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(), 404 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(),
405 username, 405 username,
406 "password"); 406 "password");
407 407
408 const bool kPendingRequests = false;
409 const bool kUsingOAuth = true; 408 const bool kUsingOAuth = true;
410 const bool kHasCookies = true; 409 const bool kHasCookies = true;
411 LoginUtils::Get()->PrepareProfile(username, std::string(), "password", 410 LoginUtils::Get()->PrepareProfile(username, std::string(), "password",
412 kPendingRequests, kUsingOAuth, 411 kUsingOAuth, kHasCookies, this);
413 kHasCookies, this);
414 device_settings_test_helper.Flush(); 412 device_settings_test_helper.Flush();
415 RunUntilIdle(); 413 RunUntilIdle();
416 } 414 }
417 415
418 net::TestURLFetcher* PrepareOAuthFetcher(const std::string& expected_url) { 416 net::TestURLFetcher* PrepareOAuthFetcher(const std::string& expected_url) {
419 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0); 417 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0);
420 EXPECT_TRUE(fetcher); 418 EXPECT_TRUE(fetcher);
421 EXPECT_TRUE(fetcher->delegate()); 419 EXPECT_TRUE(fetcher->delegate());
422 EXPECT_TRUE(StartsWithASCII(fetcher->GetOriginalURL().spec(), 420 EXPECT_TRUE(StartsWithASCII(fetcher->GetOriginalURL().spec(),
423 expected_url, 421 expected_url,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 } 678 }
681 679
682 INSTANTIATE_TEST_CASE_P( 680 INSTANTIATE_TEST_CASE_P(
683 LoginUtilsBlockingLoginTestInstance, 681 LoginUtilsBlockingLoginTestInstance,
684 LoginUtilsBlockingLoginTest, 682 LoginUtilsBlockingLoginTest,
685 testing::Values(0, 1, 2, 3, 4, 5)); 683 testing::Values(0, 1, 2, 3, 4, 5));
686 684
687 } // namespace 685 } // namespace
688 686
689 } 687 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698