Title: [210533] trunk
Revision
210533
Author
ryanhad...@apple.com
Date
2017-01-09 17:28:53 -0800 (Mon, 09 Jan 2017)

Log Message

Unreviewed, rolling out r210531.

This change broke the 32-bit macOS build and caused LayoutTest
failures.

Reverted changeset:

"File scheme should not allow access of a resource on a
different volume."
https://bugs.webkit.org/show_bug.cgi?id=158552
http://trac.webkit.org/changeset/210531

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210532 => 210533)


--- trunk/Source/WebCore/ChangeLog	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/ChangeLog	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,3 +1,17 @@
+2017-01-09  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r210531.
+
+        This change broke the 32-bit macOS build and caused LayoutTest
+        failures.
+
+        Reverted changeset:
+
+        "File scheme should not allow access of a resource on a
+        different volume."
+        https://bugs.webkit.org/show_bug.cgi?id=158552
+        http://trac.webkit.org/changeset/210531
+
 2017-01-09  Chris Dumez  <cdu...@apple.com>
 
         [iOS] Drop VNodeTracker

Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (210532 => 210533)


--- trunk/Source/WebCore/page/SecurityOrigin.cpp	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -229,22 +229,19 @@
     }
 
     if (canAccess && isLocal())
-        canAccess = passesFileCheck(*other);
+       canAccess = passesFileCheck(other);
 
     return canAccess;
 }
 
-bool SecurityOrigin::passesFileCheck(const SecurityOrigin& other) const
+bool SecurityOrigin::passesFileCheck(const SecurityOrigin* other) const
 {
-    ASSERT(isLocal() && other.isLocal());
+    ASSERT(isLocal() && other->isLocal());
 
-    if (!filesHaveSameVolume(m_filePath, other.m_filePath))
-        return false;
-
-    if (!m_enforceFilePathSeparation && !other.m_enforceFilePathSeparation)
+    if (!m_enforceFilePathSeparation && !other->m_enforceFilePathSeparation)
         return true;
 
-    return (m_filePath == other.m_filePath);
+    return (m_filePath == other->m_filePath);
 }
 
 bool SecurityOrigin::canRequest(const URL& url) const
@@ -307,11 +304,6 @@
     if (m_universalAccess)
         return true;
 
-    if (isLocal() && url.isLocalFile()) {
-        if (!filesHaveSameVolume(m_filePath, url.path()))
-            return false;
-    }
-
     if (isFeedWithNestedProtocolInHTTPFamily(url))
         return true;
 
@@ -531,7 +523,7 @@
     if (m_port != other->m_port)
         return false;
 
-    if (isLocal() && !passesFileCheck(*other))
+    if (isLocal() && !passesFileCheck(other))
         return false;
 
     return true;

Modified: trunk/Source/WebCore/page/SecurityOrigin.h (210532 => 210533)


--- trunk/Source/WebCore/page/SecurityOrigin.h	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/page/SecurityOrigin.h	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -208,7 +208,7 @@
     explicit SecurityOrigin(const SecurityOrigin*);
 
     // FIXME: Rename this function to something more semantic.
-    bool passesFileCheck(const SecurityOrigin&) const;
+    bool passesFileCheck(const SecurityOrigin*) const;
 
     // This method checks that the scheme for this origin is an HTTP-family
     // scheme, e.g. HTTP and HTTPS.

Modified: trunk/Source/WebCore/platform/FileSystem.cpp (210532 => 210533)


--- trunk/Source/WebCore/platform/FileSystem.cpp	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/platform/FileSystem.cpp	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2015 Canon Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -233,39 +233,6 @@
     ASSERT_NOT_REACHED();
 }
 
-    
-bool filesHaveSameVolume(const String& fileA, const String& fileB)
-{
-    auto fsRepFileA = fileSystemRepresentation(fileA);
-    auto fsRepFileB = fileSystemRepresentation(fileB);
-    
-    if (fsRepFileA.isNull() || fsRepFileB.isNull())
-        return false;
-
-    auto handleA = openFile(fsRepFileA.data(), OpenForRead);
-    if (!isHandleValid(handleA))
-        return false;
-
-    auto handleB = openFile(fsRepFileB.data(), OpenForRead);
-    if (!isHandleValid(handleB)) {
-        closeFile(handleA);
-        return false;
-    }
-
-    bool result = false;
-
-    auto fileADev = getFileDeviceId(handleA);
-    auto fileBDev = getFileDeviceId(handleB);
-
-    if (fileADev && fileBDev)
-        result = (fileADev == fileBDev);
-    
-    closeFile(handleA);
-    closeFile(handleB);
-    
-    return result;
-}
-
 #if !PLATFORM(MAC)
 
 void setMetadataURL(String&, const String&, const String&)

Modified: trunk/Source/WebCore/platform/FileSystem.h (210532 => 210533)


--- trunk/Source/WebCore/platform/FileSystem.h	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/platform/FileSystem.h	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
  * Copyright (C) 2015 Canon Inc. All rights reserved.
  *
@@ -146,7 +146,6 @@
 WEBCORE_EXPORT String pathGetFileName(const String&);
 WEBCORE_EXPORT String directoryName(const String&);
 WEBCORE_EXPORT bool getVolumeFreeSpace(const String&, uint64_t&);
-WEBCORE_EXPORT std::optional<int32_t> getFileDeviceId(PlatformFileHandle);
 
 WEBCORE_EXPORT void setMetadataURL(String& URLString, const String& referrer, const String& path);
 
@@ -194,8 +193,6 @@
 WEBCORE_EXPORT String encodeForFileName(const String&);
 String decodeFromFilename(const String&);
 
-bool filesHaveSameVolume(const String&, const String&);
-
 #if USE(CF)
 RetainPtr<CFURLRef> pathAsURL(const String&);
 #endif

Modified: trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm (210532 => 210533)


--- trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2017 Apple, Inc.  All rights reserved.
+ * Copyright (C) 2014 Apple, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,7 +28,6 @@
 
 #if PLATFORM(COCOA)
 
-#import "FileSystem.h"
 #import "FormDataStreamMac.h"
 #import "HTTPHeaderNames.h"
 #import "ResourceRequestCFNet.h"
@@ -204,20 +203,6 @@
     }
 #endif
 
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
-    if (m_url.isLocalFile()) {
-        auto fsRepFile = fileSystemRepresentation(m_url.fileSystemPath());
-        if (!fsRepFile.isNull()) {
-            auto handle = openFile(fsRepFile.data(), OpenForRead);
-            if (isHandleValid(handle)) {
-                auto fileDevice = getFileDeviceId(handle);
-                if (fileDevice && fileDevice.value())
-                    [nsRequest _setProperty:[NSNumber numberWithInteger:fileDevice.value()] forKey:@"NSURLRequestFileProtocolExpectedDevice"];
-            }
-        }
-    }
-#endif
-
     m_nsRequest = adoptNS(nsRequest);
 }
 

Modified: trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp (210532 => 210533)


--- trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -383,13 +383,4 @@
     return appendResult;
 }
 
-std::optional<int32_t> getFileDeviceId(PlatformFileHandle handle)
-{
-    struct stat fileStat;
-    if (fstat(handle, &fileStat))
-        return std::nullopt;
-
-    return fileStat.st_dev;
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/win/FileSystemWin.cpp (210532 => 210533)


--- trunk/Source/WebCore/platform/win/FileSystemWin.cpp	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Source/WebCore/platform/win/FileSystemWin.cpp	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,15 +33,13 @@
 #include "FileMetadata.h"
 #include "NotImplemented.h"
 #include "PathWalker.h"
-#include <io.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <sys/stat.h>
-#include <windows.h>
 #include <wtf/CryptographicallyRandomNumber.h>
 #include <wtf/HashMap.h>
 #include <wtf/text/CString.h>
 
+#include <windows.h>
+#include <shlobj.h>
+#include <shlwapi.h>
 
 namespace WebCore {
 
@@ -454,13 +452,4 @@
     return false;
 }
 
-std::optional<int32_t> getFileDeviceId(PlatformFileHandle handle)
-{
-    BY_HANDLE_FILE_INFORMATION fileInformation = { };
-    if (!::GetFileInformationByHandle(handle, &fileInformation))
-        return std::nullopt;
-
-    return fileInformation.dwVolumeSerialNumber;
-}
-
 } // namespace WebCore

Modified: trunk/Tools/ChangeLog (210532 => 210533)


--- trunk/Tools/ChangeLog	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Tools/ChangeLog	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,3 +1,17 @@
+2017-01-09  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r210531.
+
+        This change broke the 32-bit macOS build and caused LayoutTest
+        failures.
+
+        Reverted changeset:
+
+        "File scheme should not allow access of a resource on a
+        different volume."
+        https://bugs.webkit.org/show_bug.cgi?id=158552
+        http://trac.webkit.org/changeset/210531
+
 2017-01-09  Brent Fulgham  <bfulg...@apple.com>
 
         File scheme should not allow access of a resource on a different volume.

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (210532 => 210533)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-01-10 01:28:53 UTC (rev 210533)
@@ -197,8 +197,6 @@
 		7A909A831D877480007E10F8 /* IntSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A909A751D877475007E10F8 /* IntSize.cpp */; };
 		7AD3FE8E1D76131200B169A4 /* TransformationMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AD3FE8D1D75FB8D00B169A4 /* TransformationMatrix.cpp */; };
 		7AE9E5091AE5AE8B00CF874B /* test.pdf in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7AE9E5081AE5AE8B00CF874B /* test.pdf */; };
-		7AEAD47F1E20116C00416EFE /* CrossPartitionFileSchemeAccess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AEAD47C1E20113800416EFE /* CrossPartitionFileSchemeAccess.mm */; };
-		7AEAD4811E20122700416EFE /* CrossPartitionFileSchemeAccess.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7AEAD47D1E20114E00416EFE /* CrossPartitionFileSchemeAccess.html */; };
 		7C3965061CDD74F90094DBB8 /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3965051CDD74F90094DBB8 /* Color.cpp */; };
 		7C3DB8E41D12129B00AE8CC3 /* CommandBackForward.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */; };
 		7C417F331D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C417F311D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm */; };
@@ -603,7 +601,6 @@
 			dstPath = TestWebKitAPI.resources;
 			dstSubfolderSpec = 7;
 			files = (
-				7AEAD4811E20122700416EFE /* CrossPartitionFileSchemeAccess.html in Copy Resources */,
 				CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */,
 				9BD4239C1E04C01C00200395 /* chinese-character-with-image.html in Copy Resources */,
 				A155022C1E050D0300A24C57 /* duplicate-completion-handler-calls.html in Copy Resources */,
@@ -1043,8 +1040,6 @@
 		7AA6A1511AAC0B31002B2ED3 /* WorkQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueue.cpp; sourceTree = "<group>"; };
 		7AD3FE8D1D75FB8D00B169A4 /* TransformationMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformationMatrix.cpp; sourceTree = "<group>"; };
 		7AE9E5081AE5AE8B00CF874B /* test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = test.pdf; sourceTree = "<group>"; };
-		7AEAD47C1E20113800416EFE /* CrossPartitionFileSchemeAccess.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CrossPartitionFileSchemeAccess.mm; sourceTree = "<group>"; };
-		7AEAD47D1E20114E00416EFE /* CrossPartitionFileSchemeAccess.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = CrossPartitionFileSchemeAccess.html; path = Tests/mac/CrossPartitionFileSchemeAccess.html; sourceTree = SOURCE_ROOT; };
 		7C3965051CDD74F90094DBB8 /* Color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = "<group>"; };
 		7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CommandBackForward.mm; sourceTree = "<group>"; };
 		7C417F311D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewDefaultNavigationDelegate.mm; sourceTree = "<group>"; };
@@ -2034,7 +2029,6 @@
 		C07E6CAD13FD67650038B22B /* mac */ = {
 			isa = PBXGroup;
 			children = (
-				7AEAD47C1E20113800416EFE /* CrossPartitionFileSchemeAccess.mm */,
 				5C0BF88F1DD5999B00B00328 /* WebViewCanPasteZeroPng.mm */,
 				5C0BF88C1DD5957400B00328 /* MemoryPressureHandler.mm */,
 				C07E6CB013FD737C0038B22B /* Resources */,
@@ -2099,7 +2093,6 @@
 		C07E6CB013FD737C0038B22B /* Resources */ = {
 			isa = PBXGroup;
 			children = (
-				7AEAD47D1E20114E00416EFE /* CrossPartitionFileSchemeAccess.html */,
 				F42DA5151D8CEFDB00336F40 /* large-input-field-focus-onload.html */,
 				379028B814FABE49007E6B43 /* acceptsFirstMouse.html */,
 				B55F11B9151916E600915916 /* Ahem.ttf */,
@@ -2504,7 +2497,6 @@
 				2DC4CF771D2D9DD800ECCC94 /* DataDetection.mm in Sources */,
 				2D1646E21D1862CD00015A1A /* DeferredViewInWindowStateChange.mm in Sources */,
 				7CCE7EB91A411A7E00447C4C /* DeviceScaleFactorInDashboardRegions.mm in Sources */,
-				7AEAD47F1E20116C00416EFE /* CrossPartitionFileSchemeAccess.mm in Sources */,
 				7CCE7EBA1A411A7E00447C4C /* DeviceScaleFactorOnBack.mm in Sources */,
 				7C83E04D1D0A641800FEBCF3 /* DFACombiner.cpp in Sources */,
 				7C83E04E1D0A641800FEBCF3 /* DFAMinimizer.cpp in Sources */,

Deleted: trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.html (210532 => 210533)


--- trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.html	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.html	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<script>
-    var check = 0;
-    function iframeLoaded() {
-        check = 1;
-    }
-    function documentLoaded() {
-        if (check == 1)
-            document.write("Fail: A cross partition resource was loaded");
-        else
-            document.write("Pass: A cross partition resource was blocked from loading");
-    }
-</script>
-<body _onload_="documentLoaded()">
-    <iframe src="" _onload_="iframeLoaded();"></iframe>
-</body>
-</html>

Deleted: trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm (210532 => 210533)


--- trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm	2017-01-10 00:46:04 UTC (rev 210532)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm	2017-01-10 01:28:53 UTC (rev 210533)
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#import "PlatformUtilities.h"
-#import "WKWebViewConfigurationExtras.h"
-#import <WebKit/WKFoundation.h>
-#import <WebKit/WKWebViewPrivate.h>
-#import <WebKit/WebKit.h>
-#import <wtf/RetainPtr.h>
-
-const char* successfulResult = "Pass: A cross partition resource was blocked from loading";
-
-@interface CrossPartitionFileSchemeAccessNavigationDelegate : NSObject <WKNavigationDelegate>
-@end
-
-@implementation CrossPartitionFileSchemeAccessNavigationDelegate
-
-static bool navigationComplete = false;
-
-- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
-{
-    [webView evaluateJavaScript: @"document.body.innerHTML" completionHandler:^(NSString *result, NSError *error)
-    {
-        EXPECT_STREQ(successfulResult, [result UTF8String]);
-        navigationComplete = true;
-    }];
-}
-
-@end
-
-void createPartition(const char *filePath) 
-{
-    const char* fileContent = " \"<!DOCTYPE html><html><body>Hello</body></html>\" > ";
-    const char* targetFile = "resources/CrossPartitionFileSchemeAccess.html";
-    
-    const char* createDirCmd  = "mkdir resources";
-    const char* createDiskImage = "hdiutil create otherVolume.dmg -srcfolder resources/ -ov > /dev/null";
-    const char* attachDiskImage = "hdiutil attach otherVolume.dmg > /dev/null";
-    
-    std::string createFileCmd = "echo ";
-    createFileCmd.append(fileContent);
-    createFileCmd.append(targetFile);
-    
-    system(createDirCmd);
-    system(createFileCmd.c_str());
-    system(createDiskImage);
-    system(attachDiskImage);
-}
-
-void cleanUp()
-{
-    const char* detachDiskImage = "hdiutil detach /Volumes/resources > /dev/null";
-    const char* deleteFolder = "rm -rf resources/";
-    const char* deleteDiskImage = "rm -rf otherVolume.dmg";
-    system(detachDiskImage);
-    system(deleteFolder);
-    system(deleteDiskImage);
-}
-
-
-namespace TestWebKitAPI {
-
-TEST(WebKit1, CrossPartitionFileSchemeAccess)
-{
-    NSURL *url = "" mainBundle] URLForResource:@"CrossPartitionFileSchemeAccess" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
-    const char *filePath = [url fileSystemRepresentation];
-    createPartition(filePath);
-        
-    RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
-    
-    CrossPartitionFileSchemeAccessNavigationDelegate *delegate = [[CrossPartitionFileSchemeAccessNavigationDelegate alloc] init];
-    [webView setNavigationDelegate:delegate];
-    
-    NSURLRequest *request = [NSURLRequest requestWithURL:url];
-    [webView loadRequest:request];
-    Util::run(&navigationComplete);
-    cleanUp();
-}
-}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to