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

Unified Diff: base/files/file_proxy_unittest.cc

Issue 252583007: Replace FileUtilProxy with FileProxy in renderer_host/pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/file_proxy.cc ('k') | content/browser/renderer_host/pepper/pepper_file_io_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_proxy_unittest.cc
diff --git a/base/files/file_proxy_unittest.cc b/base/files/file_proxy_unittest.cc
index 774892371709eb11d1cfdf7810c75792a97b0d52..d44beb99633bf71bce5a34daace1c36d30e56fb7 100644
--- a/base/files/file_proxy_unittest.cc
+++ b/base/files/file_proxy_unittest.cc
@@ -207,6 +207,20 @@ TEST_F(FileProxyTest, CreateTemporary) {
EXPECT_TRUE(base::DeleteFile(path_, false));
}
+TEST_F(FileProxyTest, SetAndTake) {
+ File file(test_path(), File::FLAG_CREATE | File::FLAG_READ);
+ ASSERT_TRUE(file.IsValid());
+ FileProxy proxy(file_task_runner());
+ EXPECT_FALSE(proxy.IsValid());
+ proxy.SetFile(file.Pass());
+ EXPECT_TRUE(proxy.IsValid());
+ EXPECT_FALSE(file.IsValid());
+
+ file = proxy.TakeFile();
+ EXPECT_FALSE(proxy.IsValid());
+ EXPECT_TRUE(file.IsValid());
+}
+
TEST_F(FileProxyTest, GetInfo) {
// Setup.
ASSERT_EQ(4, base::WriteFile(test_path(), "test", 4));
« no previous file with comments | « base/files/file_proxy.cc ('k') | content/browser/renderer_host/pepper/pepper_file_io_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698