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

Side by Side Diff: webkit/browser/blob/local_file_stream_reader_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 "webkit/browser/blob/local_file_stream_reader.h" 5 #include "webkit/browser/blob/local_file_stream_reader.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 class LocalFileStreamReaderTest : public testing::Test { 60 class LocalFileStreamReaderTest : public testing::Test {
61 public: 61 public:
62 LocalFileStreamReaderTest() 62 LocalFileStreamReaderTest()
63 : file_thread_("FileUtilProxyTestFileThread") {} 63 : file_thread_("FileUtilProxyTestFileThread") {}
64 64
65 virtual void SetUp() OVERRIDE { 65 virtual void SetUp() OVERRIDE {
66 ASSERT_TRUE(file_thread_.Start()); 66 ASSERT_TRUE(file_thread_.Start());
67 ASSERT_TRUE(dir_.CreateUniqueTempDir()); 67 ASSERT_TRUE(dir_.CreateUniqueTempDir());
68 68
69 file_util::WriteFile(test_path(), kTestData, kTestDataSize); 69 base::WriteFile(test_path(), kTestData, kTestDataSize);
70 base::File::Info info; 70 base::File::Info info;
71 ASSERT_TRUE(base::GetFileInfo(test_path(), &info)); 71 ASSERT_TRUE(base::GetFileInfo(test_path(), &info));
72 test_file_modification_time_ = info.last_modified; 72 test_file_modification_time_ = info.last_modified;
73 } 73 }
74 74
75 virtual void TearDown() OVERRIDE { 75 virtual void TearDown() OVERRIDE {
76 // Give another chance for deleted streams to perform Close. 76 // Give another chance for deleted streams to perform Close.
77 base::RunLoop().RunUntilIdle(); 77 base::RunLoop().RunUntilIdle();
78 file_thread_.Stop(); 78 file_thread_.Stop();
79 base::RunLoop().RunUntilIdle(); 79 base::RunLoop().RunUntilIdle();
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); 247 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled));
248 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); 248 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0);
249 249
250 // Delete immediately. 250 // Delete immediately.
251 // Should not crash; nor should NeverCalled be callback. 251 // Should not crash; nor should NeverCalled be callback.
252 reader.reset(); 252 reader.reset();
253 EnsureFileTaskFinished(); 253 EnsureFileTaskFinished();
254 } 254 }
255 255
256 } // namespace webkit_blob 256 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/appcache/appcache_storage_impl_unittest.cc ('k') | webkit/browser/database/database_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698