OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/timer.h" | 7 #include "base/timer.h" |
8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "chrome/browser/renderer_host/file_system_accessor.h" | 9 #include "chrome/browser/renderer_host/file_system_accessor.h" |
10 #include "chrome/test/file_test_utils.h" | 10 #include "chrome/test/file_test_utils.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 FileAutoDeleter deleter(path); | 95 FileAutoDeleter deleter(path); |
96 | 96 |
97 int param = 100; | 97 int param = 100; |
98 TestGetFileSize(path, static_cast<void*>(¶m), | 98 TestGetFileSize(path, static_cast<void*>(¶m), |
99 bytes_written, static_cast<void*>(¶m)); | 99 bytes_written, static_cast<void*>(¶m)); |
100 } | 100 } |
101 | 101 |
102 TEST_F(FileSystemAccessorTest, GetFileSizeEmptyFile) { | 102 TEST_F(FileSystemAccessorTest, GetFileSizeEmptyFile) { |
103 FilePath path; | 103 FilePath path; |
104 EXPECT_TRUE(file_util::CreateTemporaryFileName(&path)); | 104 EXPECT_TRUE(file_util::CreateTemporaryFile(&path)); |
105 FileAutoDeleter deleter(path); | 105 FileAutoDeleter deleter(path); |
106 | 106 |
107 TestGetFileSize(path, NULL, 0, NULL); | 107 TestGetFileSize(path, NULL, 0, NULL); |
108 } | 108 } |
109 | 109 |
110 TEST_F(FileSystemAccessorTest, GetFileSizeNotFound) { | 110 TEST_F(FileSystemAccessorTest, GetFileSizeNotFound) { |
111 FilePath path; | 111 FilePath path; |
112 EXPECT_TRUE(file_util::CreateNewTempDirectory( | 112 EXPECT_TRUE(file_util::CreateNewTempDirectory( |
113 FILE_PATH_LITERAL("chrome_test_"), &path)); | 113 FILE_PATH_LITERAL("chrome_test_"), &path)); |
114 FileAutoDeleter deleter(path); | 114 FileAutoDeleter deleter(path); |
115 | 115 |
116 TestGetFileSize(path.Append(FILE_PATH_LITERAL("foo.txt")), NULL, -1, NULL); | 116 TestGetFileSize(path.Append(FILE_PATH_LITERAL("foo.txt")), NULL, -1, NULL); |
117 } | 117 } |
OLD | NEW |