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

Side by Side Diff: webkit/browser/appcache/appcache_storage_impl_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 <stack> 5 #include <stack>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 1651
1652 if (test_case == CORRUPT_CACHE_ON_INSTALL || 1652 if (test_case == CORRUPT_CACHE_ON_INSTALL ||
1653 test_case == CORRUPT_CACHE_ON_LOAD_EXISTING) { 1653 test_case == CORRUPT_CACHE_ON_LOAD_EXISTING) {
1654 // Create a corrupt/unopenable disk_cache index file. 1654 // Create a corrupt/unopenable disk_cache index file.
1655 const std::string kCorruptData("deadbeef"); 1655 const std::string kCorruptData("deadbeef");
1656 base::FilePath disk_cache_directory = 1656 base::FilePath disk_cache_directory =
1657 temp_directory_.path().AppendASCII("Cache"); 1657 temp_directory_.path().AppendASCII("Cache");
1658 ASSERT_TRUE(base::CreateDirectory(disk_cache_directory)); 1658 ASSERT_TRUE(base::CreateDirectory(disk_cache_directory));
1659 base::FilePath index_file = disk_cache_directory.AppendASCII("index"); 1659 base::FilePath index_file = disk_cache_directory.AppendASCII("index");
1660 EXPECT_EQ(static_cast<int>(kCorruptData.length()), 1660 EXPECT_EQ(static_cast<int>(kCorruptData.length()),
1661 file_util::WriteFile( 1661 base::WriteFile(
1662 index_file, kCorruptData.data(), kCorruptData.length())); 1662 index_file, kCorruptData.data(), kCorruptData.length()));
1663 } 1663 }
1664 1664
1665 // Create records for a degenerate cached manifest that only contains 1665 // Create records for a degenerate cached manifest that only contains
1666 // one entry for the manifest file resource. 1666 // one entry for the manifest file resource.
1667 if (test_case == CORRUPT_CACHE_ON_LOAD_EXISTING) { 1667 if (test_case == CORRUPT_CACHE_ON_LOAD_EXISTING) {
1668 AppCacheDatabase db(temp_directory_.path().AppendASCII("Index")); 1668 AppCacheDatabase db(temp_directory_.path().AppendASCII("Index"));
1669 GURL manifest_url = MockHttpServer::GetMockUrl("manifest"); 1669 GURL manifest_url = MockHttpServer::GetMockUrl("manifest");
1670 1670
1671 AppCacheDatabase::GroupRecord group_record; 1671 AppCacheDatabase::GroupRecord group_record;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); 2000 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2);
2001 } 2001 }
2002 2002
2003 TEST_F(AppCacheStorageImplTest, Reinitialize3) { 2003 TEST_F(AppCacheStorageImplTest, Reinitialize3) {
2004 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); 2004 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3);
2005 } 2005 }
2006 2006
2007 // That's all folks! 2007 // That's all folks!
2008 2008
2009 } // namespace appcache 2009 } // namespace appcache
OLDNEW
« no previous file with comments | « webkit/browser/appcache/appcache_database_unittest.cc ('k') | webkit/browser/blob/local_file_stream_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698