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

Side by Side Diff: chrome/browser/chromeos/cros/cros_library.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 | « no previous file | chrome/browser/chromeos/login/google_authenticator_unittest.cc » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cros/cros_library.h" 5 #include "chrome/browser/chromeos/cros/cros_library.h"
6 6
7 #include "chrome/browser/chromeos/cros/cros_library_loader.h" 7 #include "chrome/browser/chromeos/cros/cros_library_loader.h"
8 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 8 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
9 #include "chrome/browser/chromeos/cros/language_library.h" 9 #include "chrome/browser/chromeos/cros/language_library.h"
10 #include "chrome/browser/chromeos/cros/login_library.h" 10 #include "chrome/browser/chromeos/cros/login_library.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return loaded_; 107 return loaded_;
108 } 108 }
109 109
110 CrosLibrary::TestApi* CrosLibrary::GetTestApi() { 110 CrosLibrary::TestApi* CrosLibrary::GetTestApi() {
111 if (!test_api_) 111 if (!test_api_)
112 test_api_ = new TestApi(this); 112 test_api_ = new TestApi(this);
113 return test_api_; 113 return test_api_;
114 } 114 }
115 115
116 void CrosLibrary::TestApi::SetLibraryLoader(LibraryLoader* loader) { 116 void CrosLibrary::TestApi::SetLibraryLoader(LibraryLoader* loader) {
117 if (library_->library_loader_ == loader)
118 return;
117 if (library_->library_loader_) 119 if (library_->library_loader_)
118 delete library_->library_loader_; 120 delete library_->library_loader_;
119 library_->library_loader_ = loader; 121 library_->library_loader_ = loader;
122 // Reset load flags when loader changes. Otherwise some tests are really not
123 // going to be happy.
124 library_->loaded_ = false;
125 library_->load_error_ = false;
120 } 126 }
121 127
122 void CrosLibrary::TestApi::SetCryptohomeLibrary(CryptohomeLibrary* library) { 128 void CrosLibrary::TestApi::SetCryptohomeLibrary(CryptohomeLibrary* library) {
123 if (library_->crypto_lib_) 129 if (library_->crypto_lib_)
124 delete library_->crypto_lib_; 130 delete library_->crypto_lib_;
125 library_->crypto_lib_ = library; 131 library_->crypto_lib_ = library;
126 } 132 }
127 133
128 void CrosLibrary::TestApi::SetLanguageLibrary(LanguageLibrary* library) { 134 void CrosLibrary::TestApi::SetLanguageLibrary(LanguageLibrary* library) {
129 if (library_->language_lib_) 135 if (library_->language_lib_)
(...skipping 26 matching lines...) Expand all
156 } 162 }
157 163
158 void CrosLibrary::TestApi::SetSynapticsLibrary(SynapticsLibrary* library) { 164 void CrosLibrary::TestApi::SetSynapticsLibrary(SynapticsLibrary* library) {
159 if (library_->synaptics_lib_) 165 if (library_->synaptics_lib_)
160 delete library_->synaptics_lib_; 166 delete library_->synaptics_lib_;
161 library_->synaptics_lib_ = library; 167 library_->synaptics_lib_ = library;
162 } 168 }
163 169
164 } // end namespace. 170 } // end namespace.
165 171
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/google_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698