OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/google_authenticator.h" | 5 #include "chrome/browser/chromeos/login/google_authenticator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 PrepForLogin(auth.get()); | 485 PrepForLogin(auth.get()); |
486 EXPECT_CALL(*user_manager_.get(), IsKnownUser(username_)) | 486 EXPECT_CALL(*user_manager_.get(), IsKnownUser(username_)) |
487 .WillOnce(Return(true)) | 487 .WillOnce(Return(true)) |
488 .RetiresOnSaturation(); | 488 .RetiresOnSaturation(); |
489 auth->OnClientLoginSuccess(result_); | 489 auth->OnClientLoginSuccess(result_); |
490 message_loop.RunAllPending(); | 490 message_loop.RunAllPending(); |
491 } | 491 } |
492 | 492 |
493 TEST_F(GoogleAuthenticatorTest, CheckLocalaccount) { | 493 TEST_F(GoogleAuthenticatorTest, CheckLocalaccount) { |
494 GURL source(AuthResponseHandler::kTokenAuthUrl); | 494 GURL source(AuthResponseHandler::kTokenAuthUrl); |
495 URLRequestStatus status(URLRequestStatus::SUCCESS, 0); | 495 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); |
496 | 496 |
497 MockConsumer consumer; | 497 MockConsumer consumer; |
498 EXPECT_CALL(consumer, OnLoginSuccess(username_, std::string(), _, false)) | 498 EXPECT_CALL(consumer, OnLoginSuccess(username_, std::string(), _, false)) |
499 .Times(1) | 499 .Times(1) |
500 .RetiresOnSaturation(); | 500 .RetiresOnSaturation(); |
501 EXPECT_CALL(*mock_library_, MountForBwsi(_)) | 501 EXPECT_CALL(*mock_library_, MountForBwsi(_)) |
502 .WillOnce(Return(true)) | 502 .WillOnce(Return(true)) |
503 .RetiresOnSaturation(); | 503 .RetiresOnSaturation(); |
504 | 504 |
505 scoped_refptr<GoogleAuthenticator> auth(new GoogleAuthenticator(&consumer)); | 505 scoped_refptr<GoogleAuthenticator> auth(new GoogleAuthenticator(&consumer)); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 // Post a task to cancel the login attempt. | 733 // Post a task to cancel the login attempt. |
734 CancelLogin(auth.get()); | 734 CancelLogin(auth.get()); |
735 | 735 |
736 URLFetcher::set_factory(NULL); | 736 URLFetcher::set_factory(NULL); |
737 | 737 |
738 // Run the UI thread until we exit it gracefully. | 738 // Run the UI thread until we exit it gracefully. |
739 message_loop.Run(); | 739 message_loop.Run(); |
740 } | 740 } |
741 | 741 |
742 } // namespace chromeos | 742 } // namespace chromeos |
OLD | NEW |