| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "modules/filesystem/DOMFileSystemBase.h" | 5 #include "modules/filesystem/DOMFileSystemBase.h" |
| 6 | 6 |
| 7 #include "core/fileapi/File.h" | 7 #include "core/fileapi/File.h" |
| 8 #include "platform/testing/UnitTestHelpers.h" | 8 #include "platform/testing/UnitTestHelpers.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 | 29 |
| 30 TEST_F(DOMFileSystemBaseTest, externalFilesystemFilesAreUserVisible) | 30 TEST_F(DOMFileSystemBaseTest, externalFilesystemFilesAreUserVisible) |
| 31 { | 31 { |
| 32 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypeExternal); | 32 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypeExternal); |
| 33 | 33 |
| 34 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypeExternal, "DOMFileSystemBaseTest.cpp"); | 34 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypeExternal, "DOMFileSystemBaseTest.cpp"); |
| 35 EXPECT_TRUE(file); | 35 EXPECT_TRUE(file); |
| 36 EXPECT_TRUE(file->hasBackingFile()); | 36 EXPECT_TRUE(file->hasBackingFile()); |
| 37 EXPECT_EQ(File::IsUserVisible, file->userVisibility()); | 37 EXPECT_EQ(File::IsUserVisible, file->getUserVisibility()); |
| 38 EXPECT_EQ("DOMFileSystemBaseTest.cpp", file->name()); | 38 EXPECT_EQ("DOMFileSystemBaseTest.cpp", file->name()); |
| 39 EXPECT_EQ(m_filePath, file->path()); | 39 EXPECT_EQ(m_filePath, file->path()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 TEST_F(DOMFileSystemBaseTest, temporaryFilesystemFilesAreNotUserVisible) | 42 TEST_F(DOMFileSystemBaseTest, temporaryFilesystemFilesAreNotUserVisible) |
| 43 { | 43 { |
| 44 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypeTemporary); | 44 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypeTemporary); |
| 45 | 45 |
| 46 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypeTemporary, "UserVisibleName.txt"); | 46 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypeTemporary, "UserVisibleName.txt"); |
| 47 EXPECT_TRUE(file); | 47 EXPECT_TRUE(file); |
| 48 EXPECT_TRUE(file->hasBackingFile()); | 48 EXPECT_TRUE(file->hasBackingFile()); |
| 49 EXPECT_EQ(File::IsNotUserVisible, file->userVisibility()); | 49 EXPECT_EQ(File::IsNotUserVisible, file->getUserVisibility()); |
| 50 EXPECT_EQ("UserVisibleName.txt", file->name()); | 50 EXPECT_EQ("UserVisibleName.txt", file->name()); |
| 51 EXPECT_EQ(m_filePath, file->path()); | 51 EXPECT_EQ(m_filePath, file->path()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 TEST_F(DOMFileSystemBaseTest, persistentFilesystemFilesAreNotUserVisible) | 54 TEST_F(DOMFileSystemBaseTest, persistentFilesystemFilesAreNotUserVisible) |
| 55 { | 55 { |
| 56 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypePersistent); | 56 KURL rootUrl = DOMFileSystemBase::createFileSystemRootURL("http://chromium.o
rg/", FileSystemTypePersistent); |
| 57 | 57 |
| 58 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypePersistent, "UserVisibleName.txt"); | 58 File* file = DOMFileSystemBase::createFile(m_fileMetadata, rootUrl, FileSyst
emTypePersistent, "UserVisibleName.txt"); |
| 59 EXPECT_TRUE(file); | 59 EXPECT_TRUE(file); |
| 60 EXPECT_TRUE(file->hasBackingFile()); | 60 EXPECT_TRUE(file->hasBackingFile()); |
| 61 EXPECT_EQ(File::IsNotUserVisible, file->userVisibility()); | 61 EXPECT_EQ(File::IsNotUserVisible, file->getUserVisibility()); |
| 62 EXPECT_EQ("UserVisibleName.txt", file->name()); | 62 EXPECT_EQ("UserVisibleName.txt", file->name()); |
| 63 EXPECT_EQ(m_filePath, file->path()); | 63 EXPECT_EQ(m_filePath, file->path()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |