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

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

Issue 1251001: Fixed loader issue in unit tests caused by some test not using that mock and ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/cros/cros_library.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/chromeos/login/client_login_response_handler.h" 6 #include "chrome/browser/chromeos/login/client_login_response_handler.h"
7 #include "chrome/browser/chromeos/login/issue_response_handler.h" 7 #include "chrome/browser/chromeos/login/issue_response_handler.h"
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <string> 10 #include <string>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 .Times(AnyNumber()); 60 .Times(AnyNumber());
61 61
62 test_api->SetLibraryLoader(loader_); 62 test_api->SetLibraryLoader(loader_);
63 63
64 mock_library_ = new MockCryptohomeLibrary(); 64 mock_library_ = new MockCryptohomeLibrary();
65 test_api->SetCryptohomeLibrary(mock_library_); 65 test_api->SetCryptohomeLibrary(mock_library_);
66 } 66 }
67 67
68 // Tears down the test fixture. 68 // Tears down the test fixture.
69 virtual void TearDown() { 69 virtual void TearDown() {
70 // Prevent bogus gMock leak check from firing.
71 chromeos::CrosLibrary::TestApi* test_api =
72 chromeos::CrosLibrary::Get()->GetTestApi();
73 test_api->SetLibraryLoader(NULL);
74 test_api->SetCryptohomeLibrary(NULL);
70 } 75 }
71 76
72 unsigned char fake_hash_[32]; 77 unsigned char fake_hash_[32];
73 std::string hash_ascii_; 78 std::string hash_ascii_;
74 std::string username_; 79 std::string username_;
75 ResponseCookies cookies_; 80 ResponseCookies cookies_;
76 // Mocks, destroyed by CrosLibrary class. 81 // Mocks, destroyed by CrosLibrary class.
77 MockCryptohomeLibrary* mock_library_; 82 MockCryptohomeLibrary* mock_library_;
78 MockLibraryLoader* loader_; 83 MockLibraryLoader* loader_;
79 }; 84 };
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 GoogleAuthenticator auth(&consumer, 260 GoogleAuthenticator auth(&consumer,
256 new ClientLoginResponseHandler(NULL), 261 new ClientLoginResponseHandler(NULL),
257 new IssueResponseHandler(NULL)); 262 new IssueResponseHandler(NULL));
258 auth.set_password_hash(hash_ascii_); 263 auth.set_password_hash(hash_ascii_);
259 auth.set_username(username_); 264 auth.set_username(username_);
260 auth.OnURLFetchComplete(NULL, source, status, 200, cookies_, std::string()); 265 auth.OnURLFetchComplete(NULL, source, status, 200, cookies_, std::string());
261 MessageLoop::current()->Run(); // So tasks can be posted. 266 MessageLoop::current()->Run(); // So tasks can be posted.
262 } 267 }
263 268
264 } // namespace chromeos 269 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/cros_library.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698