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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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/parallel_authenticator.h" 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DBusThreadManager::Shutdown(); 90 DBusThreadManager::Shutdown();
91 91
92 cryptohome::AsyncMethodCaller::Shutdown(); 92 cryptohome::AsyncMethodCaller::Shutdown();
93 mock_caller_ = NULL; 93 mock_caller_ = NULL;
94 } 94 }
95 95
96 base::FilePath PopulateTempFile(const char* data, int data_len) { 96 base::FilePath PopulateTempFile(const char* data, int data_len) {
97 base::FilePath out; 97 base::FilePath out;
98 FILE* tmp_file = base::CreateAndOpenTemporaryFile(&out); 98 FILE* tmp_file = base::CreateAndOpenTemporaryFile(&out);
99 EXPECT_NE(tmp_file, static_cast<FILE*>(NULL)); 99 EXPECT_NE(tmp_file, static_cast<FILE*>(NULL));
100 EXPECT_EQ(file_util::WriteFile(out, data, data_len), data_len); 100 EXPECT_EQ(base::WriteFile(out, data, data_len), data_len);
101 EXPECT_TRUE(base::CloseFile(tmp_file)); 101 EXPECT_TRUE(base::CloseFile(tmp_file));
102 return out; 102 return out;
103 } 103 }
104 104
105 // Allow test to fail and exit gracefully, even if OnLoginFailure() 105 // Allow test to fail and exit gracefully, even if OnLoginFailure()
106 // wasn't supposed to happen. 106 // wasn't supposed to happen.
107 void FailOnLoginFailure() { 107 void FailOnLoginFailure() {
108 ON_CALL(consumer_, OnLoginFailure(_)) 108 ON_CALL(consumer_, OnLoginFailure(_))
109 .WillByDefault(Invoke(MockConsumer::OnFailQuitAndFail)); 109 .WillByDefault(Invoke(MockConsumer::OnFailQuitAndFail));
110 } 110 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 .Times(1) 607 .Times(1)
608 .RetiresOnSaturation(); 608 .RetiresOnSaturation();
609 609
610 auth_->AuthenticateToUnlock(UserContext(username_, 610 auth_->AuthenticateToUnlock(UserContext(username_,
611 std::string(), 611 std::string(),
612 std::string())); 612 std::string()));
613 base::MessageLoop::current()->Run(); 613 base::MessageLoop::current()->Run();
614 } 614 }
615 615
616 } // namespace chromeos 616 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698