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

Side by Side Diff: chrome/browser/history/history_backend_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/history/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 base::FilePath history_path(getTestDir()); 2831 base::FilePath history_path(getTestDir());
2832 base::FilePath db1(history_path.AppendASCII("History Index 2013-05")); 2832 base::FilePath db1(history_path.AppendASCII("History Index 2013-05"));
2833 base::FilePath db1_journal(db1.InsertBeforeExtensionASCII("-journal")); 2833 base::FilePath db1_journal(db1.InsertBeforeExtensionASCII("-journal"));
2834 base::FilePath db1_wal(db1.InsertBeforeExtensionASCII("-wal")); 2834 base::FilePath db1_wal(db1.InsertBeforeExtensionASCII("-wal"));
2835 base::FilePath db2_symlink(history_path.AppendASCII("History Index 2013-06")); 2835 base::FilePath db2_symlink(history_path.AppendASCII("History Index 2013-06"));
2836 base::FilePath db2_actual(history_path.AppendASCII("Underlying DB")); 2836 base::FilePath db2_actual(history_path.AppendASCII("Underlying DB"));
2837 2837
2838 // Setup dummy index database files. 2838 // Setup dummy index database files.
2839 const char* data = "Dummy"; 2839 const char* data = "Dummy";
2840 const size_t data_len = 5; 2840 const size_t data_len = 5;
2841 ASSERT_TRUE(file_util::WriteFile(db1, data, data_len)); 2841 ASSERT_TRUE(base::WriteFile(db1, data, data_len));
2842 ASSERT_TRUE(file_util::WriteFile(db1_journal, data, data_len)); 2842 ASSERT_TRUE(base::WriteFile(db1_journal, data, data_len));
2843 ASSERT_TRUE(file_util::WriteFile(db1_wal, data, data_len)); 2843 ASSERT_TRUE(base::WriteFile(db1_wal, data, data_len));
2844 ASSERT_TRUE(file_util::WriteFile(db2_actual, data, data_len)); 2844 ASSERT_TRUE(base::WriteFile(db2_actual, data, data_len));
2845 #if defined(OS_POSIX) 2845 #if defined(OS_POSIX)
2846 EXPECT_TRUE(base::CreateSymbolicLink(db2_actual, db2_symlink)); 2846 EXPECT_TRUE(base::CreateSymbolicLink(db2_actual, db2_symlink));
2847 #endif 2847 #endif
2848 2848
2849 // Delete all DTS index databases. 2849 // Delete all DTS index databases.
2850 backend_->DeleteFTSIndexDatabases(); 2850 backend_->DeleteFTSIndexDatabases();
2851 EXPECT_FALSE(base::PathExists(db1)); 2851 EXPECT_FALSE(base::PathExists(db1));
2852 EXPECT_FALSE(base::PathExists(db1_wal)); 2852 EXPECT_FALSE(base::PathExists(db1_wal));
2853 EXPECT_FALSE(base::PathExists(db1_journal)); 2853 EXPECT_FALSE(base::PathExists(db1_journal));
2854 EXPECT_FALSE(base::PathExists(db2_symlink)); 2854 EXPECT_FALSE(base::PathExists(db2_symlink));
2855 EXPECT_TRUE(base::PathExists(db2_actual)); // Symlinks shouldn't be followed. 2855 EXPECT_TRUE(base::PathExists(db2_actual)); // Symlinks shouldn't be followed.
2856 } 2856 }
2857 2857
2858 } // namespace history 2858 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/google/google_update_settings_posix.cc ('k') | chrome/browser/history/redirect_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698