OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 EXPECT_TRUE(file_util::ReadFromFD(fd, buffer, image_size)); | 2353 EXPECT_TRUE(file_util::ReadFromFD(fd, buffer, image_size)); |
2354 delete[] buffer; | 2354 delete[] buffer; |
2355 } | 2355 } |
2356 | 2356 |
2357 TEST_F(FileUtilTest, NonExistentContentUriTest) { | 2357 TEST_F(FileUtilTest, NonExistentContentUriTest) { |
2358 base::FilePath path("content://foo.bar"); | 2358 base::FilePath path("content://foo.bar"); |
2359 EXPECT_TRUE(path.IsContentUri()); | 2359 EXPECT_TRUE(path.IsContentUri()); |
2360 EXPECT_FALSE(base::PathExists(path)); | 2360 EXPECT_FALSE(base::PathExists(path)); |
2361 // Size should be smaller than 0. | 2361 // Size should be smaller than 0. |
2362 int64 size; | 2362 int64 size; |
2363 file_util::GetFileSize(path, &size); | 2363 EXPECT_FALSE(file_util::GetFileSize(path, &size)); |
2364 EXPECT_GT(0, size); | |
2365 | 2364 |
2366 // We should not be able to read the file. | 2365 // We should not be able to read the file. |
2367 int fd = base::OpenContentUriForRead(path); | 2366 int fd = base::OpenContentUriForRead(path); |
2368 EXPECT_EQ(-1, fd); | 2367 EXPECT_EQ(-1, fd); |
2369 } | 2368 } |
2370 #endif | 2369 #endif |
2371 | 2370 |
2372 #endif // defined(OS_POSIX) | 2371 #endif // defined(OS_POSIX) |
2373 | 2372 |
2374 } // namespace | 2373 } // namespace |
OLD | NEW |