WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-225476-20210506121756.patch (text/plain), 2.37 KB, created by
Chris Dumez
on 2021-05-06 12:17:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2021-05-06 12:17:57 PDT
Size:
2.37 KB
patch
obsolete
>Subversion Revision: 277101 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 38c5958439e96e2c4c444335bfd508b17dd1c6ab..f827aeaa53f7091e19ebe71ffbc21fe68e227bfd 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2021-05-06 Chris Dumez <cdumez@apple.com> >+ >+ Add API test for FileSystem::fileExists() on a broken symbolic link >+ https://bugs.webkit.org/show_bug.cgi?id=225476 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add API test for FileSystem::fileExists() on a broken symbolic link since this is a special >+ case. FileSystem::fileExists() currently tries to follow symbolic links and will thus return >+ false. The behavior is a little odd but I have verified that this is what our access()-based >+ implementation was returning also before I ported FileSystem::fileExists() to std::filesystem. >+ >+ * TestWebKitAPI/Tests/WTF/FileSystem.cpp: >+ (TestWebKitAPI::TEST_F): >+ > 2021-05-04 Chris Dumez <cdumez@apple.com> > > Port Filesystem::fileMetadata() & Filesystem::getFileModificationTime() to std::filesystem >diff --git a/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp b/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp >index 9da663992be09a6cf4cc138ba76dccbcf0fd7781..1b4b09fffb4f400bc3dc26f7110890b3d7adb11b 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp >@@ -279,6 +279,19 @@ TEST_F(FileSystemTest, fileExists) > EXPECT_FALSE(FileSystem::fileExists(FileSystem::pathByAppendingComponent(tempEmptyFolderPath(), "does-not-exist"_s))); > } > >+TEST_F(FileSystemTest, fileExistsBrokenSymlink) >+{ >+ auto doesNotExistPath = FileSystem::pathByAppendingComponent(tempEmptyFolderPath(), "does-not-exist"_s); >+ auto symlinkPath = FileSystem::pathByAppendingComponent(tempEmptyFolderPath(), "does-not-exist-symlink"_s); >+ EXPECT_TRUE(FileSystem::createSymbolicLink(doesNotExistPath, symlinkPath)); >+ EXPECT_FALSE(FileSystem::fileExists(doesNotExistPath)); >+ EXPECT_FALSE(FileSystem::fileExists(symlinkPath)); // fileExists() follows symlinks. >+ auto symlinkMetadata = FileSystem::fileMetadata(symlinkPath); >+ ASSERT_TRUE(!!symlinkMetadata); >+ EXPECT_EQ(symlinkMetadata->type, FileMetadata::Type::SymbolicLink); >+ EXPECT_TRUE(FileSystem::deleteFile(symlinkPath)); >+} >+ > TEST_F(FileSystemTest, deleteSymlink) > { > EXPECT_TRUE(FileSystem::fileExists(tempFilePath()));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 225476
: 427918