⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277449 in webkit


Ignore:
Timestamp:
May 13, 2021, 1:47:38 PM (5 years ago)
Author:
Chris Dumez
Message:

Rename FileSystem::directoryName() to FileSystem::parentPath()
https://bugs.webkit.org/show_bug.cgi?id=225768

Reviewed by Darin Adler.

Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
consistency with std::filesystem::parent_path() which is used internally.

Source/JavaScriptCore:

  • API/JSScript.mm:

(validateBytecodeCachePath):

Source/WebCore:

  • Modules/entriesapi/DOMFileSystem.cpp:

(WebCore::DOMFileSystem::DOMFileSystem):

  • loader/appcache/ApplicationCacheStorage.cpp:

(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
(WebCore::ApplicationCacheStorage::checkForDeletedResources):

  • platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:

(WebCore::CDMSessionAVContentKeySession::contentKeySession):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles):

  • platform/network/curl/CookieJarDB.cpp:

(WebCore::CookieJarDB::openDatabase):

  • platform/sql/SQLiteFileSystem.cpp:

(WebCore::SQLiteFileSystem::ensureDatabaseFileExists):

  • platform/win/SearchPopupMenuDB.cpp:

(WebCore::SearchPopupMenuDB::openDatabase):

  • workers/service/server/SWScriptStorage.cpp:

(WebCore::SWScriptStorage::store):

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):

  • NetworkProcess/cache/CacheStorageEngine.cpp:

(WebKit::CacheStorage::Engine::writeFile):

  • Shared/glib/ProcessExecutablePathGLib.cpp:

(WebKit::getExecutablePath):

  • UIProcess/API/glib/IconDatabase.cpp:

(WebKit::IconDatabase::IconDatabase):

  • UIProcess/API/glib/WebKitWebsiteDataManager.cpp:

(webkit_website_data_manager_get_disk_cache_directory):

  • UIProcess/Launcher/glib/BubblewrapLauncher.cpp:

(WebKit::bubblewrapSpawn):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::platformSetNetworkParameters):

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):

Source/WebKitLegacy:

  • Storage/StorageTracker.cpp:

(WebKit::ensureDatabaseFileExists):

Source/WebKitLegacy/win:

  • Plugins/PluginDatabase.cpp:

(WebCore::PluginDatabase::loadPersistentMetadataCache):

Source/WTF:

  • wtf/FileSystem.cpp:

(WTF::FileSystemImpl::readOrMakeSalt):
(WTF::FileSystemImpl::parentPath):
(WTF::FileSystemImpl::directoryName): Deleted.

  • wtf/FileSystem.h:

Tools:

  • DumpRenderTree/win/DumpRenderTree.cpp:

(findFontFallback):

  • TestWebKitAPI/Tests/WTF/FileSystem.cpp:

(TestWebKitAPI::TEST_F):

  • TestWebKitAPI/win/PlatformUtilitiesWin.cpp:

(TestWebKitAPI::Util::moduleDirectory):

Location:
trunk
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSScript.mm

    r277448 r277449  
    8585    }
    8686
    87     String directory = FileSystem::directoryName(systemPath);
     87    String directory = FileSystem::parentPath(systemPath);
    8888    if (directory.isNull()) {
    8989        createError([NSString stringWithFormat:@"Cache path `%@` does not contain in a valid directory", static_cast<NSString *>(systemPath)], error);
  • trunk/Source/JavaScriptCore/ChangeLog

    r277448 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * API/JSScript.mm:
     12        (validateBytecodeCachePath):
     13
    1142021-05-13  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WTF/ChangeLog

    r277448 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * wtf/FileSystem.cpp:
     12        (WTF::FileSystemImpl::readOrMakeSalt):
     13        (WTF::FileSystemImpl::parentPath):
     14        (WTF::FileSystemImpl::directoryName): Deleted.
     15        * wtf/FileSystem.h:
     16
    1172021-05-13  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WTF/wtf/FileSystem.cpp

    r277448 r277449  
    519519
    520520    Salt salt = makeSalt();
    521     FileSystem::makeAllDirectories(FileSystem::directoryName(path));
     521    FileSystem::makeAllDirectories(FileSystem::parentPath(path));
    522522    auto file = FileSystem::openFile(path, FileSystem::FileOpenMode::Write, FileSystem::FileAccessPermission::User);
    523523    if (!FileSystem::isHandleValid(file))
     
    745745}
    746746
    747 String directoryName(const String& path)
     747String parentPath(const String& path)
    748748{
    749749    return fromStdFileSystemPath(toStdFileSystemPath(path).parent_path());
  • trunk/Source/WTF/wtf/FileSystem.h

    r277448 r277449  
    126126WTF_EXPORT_PRIVATE String homeDirectoryPath();
    127127WTF_EXPORT_PRIVATE String pathGetFileName(const String&);
    128 WTF_EXPORT_PRIVATE String directoryName(const String&);
     128WTF_EXPORT_PRIVATE String parentPath(const String&);
    129129WTF_EXPORT_PRIVATE bool getVolumeFreeSpace(const String&, uint64_t&);
    130130WTF_EXPORT_PRIVATE Optional<int32_t> getFileDeviceId(const CString&);
  • trunk/Source/WebCore/ChangeLog

    r277448 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * Modules/entriesapi/DOMFileSystem.cpp:
     12        (WebCore::DOMFileSystem::DOMFileSystem):
     13        * loader/appcache/ApplicationCacheStorage.cpp:
     14        (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
     15        (WebCore::ApplicationCacheStorage::checkForDeletedResources):
     16        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
     17        (WebCore::CDMSessionAVContentKeySession::contentKeySession):
     18        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     19        (WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles):
     20        * platform/network/curl/CookieJarDB.cpp:
     21        (WebCore::CookieJarDB::openDatabase):
     22        * platform/sql/SQLiteFileSystem.cpp:
     23        (WebCore::SQLiteFileSystem::ensureDatabaseFileExists):
     24        * platform/win/SearchPopupMenuDB.cpp:
     25        (WebCore::SearchPopupMenuDB::openDatabase):
     26        * workers/service/server/SWScriptStorage.cpp:
     27        (WebCore::SWScriptStorage::store):
     28
    1292021-05-13  Chris Dumez  <cdumez@apple.com>
    230
  • trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp

    r277448 r277449  
    147147    : m_name(createCanonicalUUIDString())
    148148    , m_file(WTFMove(file))
    149     , m_rootPath(FileSystem::directoryName(m_file->path()))
     149    , m_rootPath(FileSystem::parentPath(m_file->path()))
    150150    , m_workQueue(WorkQueue::create("DOMFileSystem work queue"))
    151151{
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp

    r274022 r277449  
    12921292       
    12931293        fullPath = FileSystem::pathByAppendingComponent(directory, path);
    1294     } while (FileSystem::directoryName(fullPath) != directory || FileSystem::fileExists(fullPath));
     1294    } while (FileSystem::parentPath(fullPath) != directory || FileSystem::fileExists(fullPath));
    12951295   
    12961296    FileSystem::PlatformFileHandle handle = FileSystem::openFile(fullPath, FileSystem::FileOpenMode::Write);
     
    14321432        // Don't exit the flatFileDirectory! This should only happen if the "path" entry contains a directory
    14331433        // component, but protect against it regardless.
    1434         if (FileSystem::directoryName(fullPath) != flatFileDirectory)
     1434        if (FileSystem::parentPath(fullPath) != flatFileDirectory)
    14351435            continue;
    14361436       
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm

    r264685 r277449  
    380380        m_contentKeySession = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming];
    381381    } else {
    382         String storageDirectory = FileSystem::directoryName(storagePath);
     382        String storageDirectory = FileSystem::parentPath(storagePath);
    383383
    384384        if (!FileSystem::fileExists(storageDirectory)) {
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r277357 r277449  
    22092209        return;
    22102210
    2211     auto templateDirectory = FileSystem::directoryName(downloadFilePrefixPath);
     2211    auto templateDirectory = FileSystem::parentPath(downloadFilePrefixPath);
    22122212    auto templatePrefix = FileSystem::pathGetFileName(downloadFilePrefixPath);
    22132213    for (auto& fileName : FileSystem::listDirectory(templateDirectory)) {
  • trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp

    r276211 r277449  
    140140
    141141    if (!existsDatabaseFile) {
    142         if (!FileSystem::makeAllDirectories(FileSystem::directoryName(m_databasePath)))
     142        if (!FileSystem::makeAllDirectories(FileSystem::parentPath(m_databasePath)))
    143143            LOG_ERROR("Unable to create the Cookie Database path %s", m_databasePath.utf8().data());
    144144
  • trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp

    r243270 r277449  
    6666
    6767    if (checkPathOnly) {
    68         String dir = FileSystem::directoryName(fileName);
     68        String dir = FileSystem::parentPath(fileName);
    6969        return ensureDatabaseDirectoryExists(dir);
    7070    }
  • trunk/Source/WebCore/platform/win/SearchPopupMenuDB.cpp

    r248846 r277449  
    189189
    190190    if (!existsDatabaseFile) {
    191         if (!FileSystem::makeAllDirectories(FileSystem::directoryName(m_databaseFilename)))
     191        if (!FileSystem::makeAllDirectories(FileSystem::parentPath(m_databaseFilename)))
    192192            LOG_ERROR("Failed to create the search autosave database path %s", m_databaseFilename.utf8().data());
    193193
  • trunk/Source/WebCore/workers/service/server/SWScriptStorage.cpp

    r275443 r277449  
    8585
    8686    auto scriptPath = this->scriptPath(registrationKey, scriptURL);
    87     FileSystem::makeAllDirectories(FileSystem::directoryName(scriptPath));
     87    FileSystem::makeAllDirectories(FileSystem::parentPath(scriptPath));
    8888
    8989    auto iterateOverBufferAndWriteData = [&](const Function<bool(const uint8_t*, size_t)>& writeData) {
  • trunk/Source/WebKit/ChangeLog

    r277448 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
     12        (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
     13        * NetworkProcess/cache/CacheStorageEngine.cpp:
     14        (WebKit::CacheStorage::Engine::writeFile):
     15        * Shared/glib/ProcessExecutablePathGLib.cpp:
     16        (WebKit::getExecutablePath):
     17        * UIProcess/API/glib/IconDatabase.cpp:
     18        (WebKit::IconDatabase::IconDatabase):
     19        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
     20        (webkit_website_data_manager_get_disk_cache_directory):
     21        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
     22        (WebKit::bubblewrapSpawn):
     23        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     24        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
     25        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     26        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
     27
    1282021-05-13  Chris Dumez  <cdumez@apple.com>
    229
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp

    r277437 r277449  
    370370{
    371371    if (!FileSystem::fileExists(m_storageDirectoryPath)) {
    372         if (!FileSystem::makeAllDirectories(FileSystem::directoryName(m_storageDirectoryPath))) {
     372        if (!FileSystem::makeAllDirectories(FileSystem::parentPath(m_storageDirectoryPath))) {
    373373            RELEASE_LOG_ERROR(Network, "%p - ResourceLoadStatisticsDatabaseStore::open failed, error message: Failed to create directory database path: %" PUBLIC_LOG_STRING, this, m_storageDirectoryPath.utf8().data());
    374374            return;
  • trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp

    r277448 r277449  
    464464    m_ioQueue->dispatch([this, weakThis = makeWeakPtr(this), identifier = m_pendingCallbacksCounter, data = WTFMove(data), filename = filename.isolatedCopy()]() mutable {
    465465
    466         String directoryPath = FileSystem::directoryName(filename);
     466        String directoryPath = FileSystem::parentPath(filename);
    467467        if (!FileSystem::fileExists(directoryPath))
    468468            FileSystem::makeAllDirectories(directoryPath);
  • trunk/Source/WebKit/Shared/glib/ProcessExecutablePathGLib.cpp

    r258309 r277449  
    3939    CString executablePath = getCurrentExecutablePath();
    4040    if (!executablePath.isNull())
    41         return FileSystem::directoryName(FileSystem::stringFromFileSystemRepresentation(executablePath.data()));
     41        return FileSystem::parentPath(FileSystem::stringFromFileSystemRepresentation(executablePath.data()));
    4242    return { };
    4343}
  • trunk/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp

    r276954 r277449  
    6060            return;
    6161
    62         auto databaseDirectory = FileSystem::directoryName(path);
     62        auto databaseDirectory = FileSystem::parentPath(path);
    6363        FileSystem::makeAllDirectories(databaseDirectory);
    6464        if (!m_db.open(path)) {
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp

    r267763 r277449  
    634634    if (!priv->diskCacheDirectory) {
    635635        // The default directory already has the subdirectory.
    636         priv->diskCacheDirectory.reset(g_strdup(FileSystem::directoryName(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory()).utf8().data()));
     636        priv->diskCacheDirectory.reset(g_strdup(FileSystem::parentPath(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory()).utf8().data()));
    637637    }
    638638    return priv->diskCacheDirectory.get();
  • trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp

    r274417 r277449  
    901901    const char* execDirectory = g_getenv("WEBKIT_EXEC_PATH");
    902902    if (execDirectory) {
    903         String parentDir = FileSystem::directoryName(FileSystem::stringFromFileSystemRepresentation(execDirectory));
     903        String parentDir = FileSystem::parentPath(FileSystem::stringFromFileSystemRepresentation(execDirectory));
    904904        bindIfExists(sandboxArgs, parentDir.utf8().data());
    905905    }
     
    908908    if (!executablePath.isNull()) {
    909909        // Our executable is `/foo/bar/bin/Process`, we want `/foo/bar` as a usable prefix
    910         String parentDir = FileSystem::directoryName(FileSystem::directoryName(FileSystem::stringFromFileSystemRepresentation(executablePath.data())));
     910        String parentDir = FileSystem::parentPath(FileSystem::parentPath(FileSystem::stringFromFileSystemRepresentation(executablePath.data())));
    911911        bindIfExists(sandboxArgs, parentDir.utf8().data());
    912912    }
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r276862 r277449  
    193193
    194194    if (!cookieFile.isEmpty())
    195         SandboxExtension::createHandleForReadWriteDirectory(FileSystem::directoryName(cookieFile), parameters.cookieStoragePathExtensionHandle);
     195        SandboxExtension::createHandleForReadWriteDirectory(FileSystem::parentPath(cookieFile), parameters.cookieStoragePathExtensionHandle);
    196196}
    197197
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r277357 r277449  
    269269    // Resolve directories for file paths.
    270270    if (!m_configuration->cookieStorageFile().isEmpty()) {
    271         m_resolvedConfiguration->setCookieStorageFile(resolveAndCreateReadWriteDirectoryForSandboxExtension(FileSystem::directoryName(m_configuration->cookieStorageFile())));
     271        m_resolvedConfiguration->setCookieStorageFile(resolveAndCreateReadWriteDirectoryForSandboxExtension(FileSystem::parentPath(m_configuration->cookieStorageFile())));
    272272        m_resolvedConfiguration->setCookieStorageFile(FileSystem::pathByAppendingComponent(m_resolvedConfiguration->cookieStorageFile(), FileSystem::pathGetFileName(m_configuration->cookieStorageFile())));
    273273    }
  • trunk/Source/WebKitLegacy/ChangeLog

    r277357 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * Storage/StorageTracker.cpp:
     12        (WebKit::ensureDatabaseFileExists):
     13
    1142021-05-11  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKitLegacy/Storage/StorageTracker.cpp

    r277357 r277449  
    114114{
    115115    if (createIfDoesNotExist)
    116         return FileSystem::makeAllDirectories(FileSystem::directoryName(fileName));
     116        return FileSystem::makeAllDirectories(FileSystem::parentPath(fileName));
    117117
    118118    return FileSystem::fileExists(fileName);
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r277437 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * Plugins/PluginDatabase.cpp:
     12        (WebCore::PluginDatabase::loadPersistentMetadataCache):
     13
    1142021-05-13  Darin Adler  <darin@apple.com>
    215
  • trunk/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp

    r277357 r277449  
    516516        // Skip metadata that points to plugins from directories that
    517517        // are not part of plugin directory list anymore.
    518         String pluginDirectoryName = FileSystem::directoryName(path);
     518        String pluginDirectoryName = FileSystem::parentPath(path);
    519519        if (m_pluginDirectories.find(pluginDirectoryName) == WTF::notFound)
    520520            continue;
  • trunk/Tools/ChangeLog

    r277448 r277449  
     12021-05-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename FileSystem::directoryName() to FileSystem::parentPath()
     4        https://bugs.webkit.org/show_bug.cgi?id=225768
     5
     6        Reviewed by Darin Adler.
     7
     8        Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
     9        consistency with std::filesystem::parent_path() which is used internally.
     10
     11        * DumpRenderTree/win/DumpRenderTree.cpp:
     12        (findFontFallback):
     13        * TestWebKitAPI/Tests/WTF/FileSystem.cpp:
     14        (TestWebKitAPI::TEST_F):
     15        * TestWebKitAPI/win/PlatformUtilitiesWin.cpp:
     16        (TestWebKitAPI::Util::moduleDirectory):
     17
    1182021-05-13  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r274407 r277449  
    11071107static String findFontFallback(const char* pathOrUrl)
    11081108{
    1109     String pathToFontFallback = FileSystem::directoryName(pathOrUrl);
     1109    String pathToFontFallback = FileSystem::parentPath(pathOrUrl);
    11101110
    11111111    wchar_t fullPath[_MAX_PATH];
  • trunk/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp

    r277448 r277449  
    245245{
    246246    String path = String::fromUTF8("/test/a\u0308lo/test.txt");
    247     String directoryName = FileSystem::directoryName(path);
     247    String directoryName = FileSystem::parentPath(path);
    248248    String expectedDirectoryName = String::fromUTF8("/test/a\u0308lo");
    249249    EXPECT_TRUE(expectedDirectoryName == directoryName);
     
    763763}
    764764
    765 TEST_F(FileSystemTest, directoryName)
     765TEST_F(FileSystemTest, parentPath)
    766766{
    767767    auto testPath = FileSystem::pathByAppendingComponents(tempEmptyFolderPath(), { "subfolder", "filename.txt" });
    768     EXPECT_STREQ(FileSystem::pathByAppendingComponent(tempEmptyFolderPath(), "subfolder").utf8().data(), FileSystem::directoryName(testPath).utf8().data());
     768    EXPECT_STREQ(FileSystem::pathByAppendingComponent(tempEmptyFolderPath(), "subfolder").utf8().data(), FileSystem::parentPath(testPath).utf8().data());
    769769#if OS(UNIX)
    770     EXPECT_STREQ("/var/tmp", FileSystem::directoryName("/var/tmp/example.txt").utf8().data());
    771     EXPECT_STREQ("/var/tmp", FileSystem::directoryName("/var/tmp/").utf8().data());
    772     EXPECT_STREQ("/var/tmp", FileSystem::directoryName("/var/tmp/.").utf8().data());
    773     EXPECT_STREQ("/", FileSystem::directoryName("/").utf8().data());
     770    EXPECT_STREQ("/var/tmp", FileSystem::parentPath("/var/tmp/example.txt").utf8().data());
     771    EXPECT_STREQ("/var/tmp", FileSystem::parentPath("/var/tmp/").utf8().data());
     772    EXPECT_STREQ("/var/tmp", FileSystem::parentPath("/var/tmp/.").utf8().data());
     773    EXPECT_STREQ("/", FileSystem::parentPath("/").utf8().data());
    774774#endif
    775775#if OS(WINDOWS)
    776     EXPECT_STREQ("C:\\foo", FileSystem::directoryName("C:\\foo\\example.txt").utf8().data());
    777     EXPECT_STREQ("C:\\", FileSystem::directoryName("C:\\").utf8().data());
     776    EXPECT_STREQ("C:\\foo", FileSystem::parentPath("C:\\foo\\example.txt").utf8().data());
     777    EXPECT_STREQ("C:\\", FileSystem::parentPath("C:\\").utf8().data());
    778778#endif
    779779}
  • trunk/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp

    r242592 r277449  
    4040    auto len = GetModuleFileName(nullptr, filename, bufferLength);
    4141    ASSERT(len > 0);
    42     return FileSystem::directoryName(String(filename, len));
     42    return FileSystem::parentPath(String(filename, len));
    4343}
    4444
Note: See TracChangeset for help on using the changeset viewer.