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

Side by Side Diff: chrome/browser/diagnostics/diagnostics_controller_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/diagnostics/diagnostics_controller.h" 5 #include "chrome/browser/diagnostics/diagnostics_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ::unsetenv("HOME"); 68 ::unsetenv("HOME");
69 } 69 }
70 old_home_dir_.clear(); 70 old_home_dir_.clear();
71 #endif 71 #endif
72 } 72 }
73 73
74 void CorruptDataFile(const base::FilePath& path) { 74 void CorruptDataFile(const base::FilePath& path) {
75 // Just write some random characters into the file tInvaludUsero "corrupt" 75 // Just write some random characters into the file tInvaludUsero "corrupt"
76 // it. 76 // it.
77 const char bogus_data[] = "wwZ2uNYNuyUVzFbDm3DL"; 77 const char bogus_data[] = "wwZ2uNYNuyUVzFbDm3DL";
78 file_util::WriteFile(path, bogus_data, arraysize(bogus_data)); 78 base::WriteFile(path, bogus_data, arraysize(bogus_data));
79 } 79 }
80 80
81 scoped_ptr<DiagnosticsModel> model_; 81 scoped_ptr<DiagnosticsModel> model_;
82 CommandLine cmdline_; 82 CommandLine cmdline_;
83 base::ScopedTempDir temp_dir_; 83 base::ScopedTempDir temp_dir_;
84 scoped_ptr<DiagnosticsWriter> writer_; 84 scoped_ptr<DiagnosticsWriter> writer_;
85 base::FilePath profile_dir_; 85 base::FilePath profile_dir_;
86 86
87 #if defined(OS_CHROMEOS) 87 #if defined(OS_CHROMEOS)
88 std::string old_home_dir_; 88 std::string old_home_dir_;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 EXPECT_EQ(DiagnosticsModel::TEST_FAIL_CONTINUE, info->GetResult()); 160 EXPECT_EQ(DiagnosticsModel::TEST_FAIL_CONTINUE, info->GetResult());
161 EXPECT_EQ(DIAG_SQLITE_ERROR_HANDLER_CALLED, info->GetOutcomeCode()); 161 EXPECT_EQ(DIAG_SQLITE_ERROR_HANDLER_CALLED, info->GetOutcomeCode());
162 162
163 DiagnosticsController::GetInstance()->RunRecovery(cmdline_, writer_.get()); 163 DiagnosticsController::GetInstance()->RunRecovery(cmdline_, writer_.get());
164 EXPECT_EQ(DiagnosticsModel::RECOVERY_OK, info->GetResult()); 164 EXPECT_EQ(DiagnosticsModel::RECOVERY_OK, info->GetResult());
165 EXPECT_FALSE(base::PathExists(db_path)); 165 EXPECT_FALSE(base::PathExists(db_path));
166 } 166 }
167 #endif 167 #endif
168 168
169 } // namespace diagnostics 169 } // namespace diagnostics
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_file_helper.cc ('k') | chrome/browser/download/chrome_download_manager_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698