Diff
Modified: trunk/Tools/ChangeLog (203425 => 203426)
--- trunk/Tools/ChangeLog 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/ChangeLog 2016-07-19 22:51:13 UTC (rev 203426)
@@ -1,3 +1,25 @@
+2016-07-19 Alex Christensen <[email protected]>
+
+ Add regression test for r203392
+ https://bugs.webkit.org/show_bug.cgi?id=159949
+
+ Reviewed by Brady Eidson.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db: Added.
+ * TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm: Added.
+ * TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal: Added.
+ * TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm:
+ (TEST):
+ (fileSize):
+ (swizzledBundleIdentifierMobileSafari):
+ (swizzledBundleIdentifierWebBookmarksD):
+ (defaultApplicationCacheDirectory):
+ * TestWebKitAPI/cocoa/InstanceMethodSwizzler.h: Copied from TestWebKitAPI/mac/InstanceMethodSwizzler.h.
+ * TestWebKitAPI/cocoa/InstanceMethodSwizzler.mm: Copied from TestWebKitAPI/mac/InstanceMethodSwizzler.mm.
+ * TestWebKitAPI/mac/InstanceMethodSwizzler.h: Removed.
+ * TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Removed.
+
2016-07-19 Keith Miller <[email protected]>
Test262 should have a file with the revision and url
Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (203425 => 203426)
--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2016-07-19 22:51:13 UTC (rev 203426)
@@ -107,6 +107,10 @@
5714ECBD1CA8C22A00051AC8 /* DownloadRequestOriginalURL2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */; };
57901FB11CAF142D00ED64F9 /* LoadInvalidURLRequest.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57901FB01CAF141C00ED64F9 /* LoadInvalidURLRequest.html */; };
57F56A5C1C7F8CC100F31D7E /* IsNavigationActionTrusted.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57F56A5B1C7F8A4000F31D7E /* IsNavigationActionTrusted.html */; };
+ 5C726D6F1D3EE06E00C5E1A1 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C726D6E1D3EE06800C5E1A1 /* InstanceMethodSwizzler.mm */; };
+ 5C9E59411D3EB5AC00E3C62E /* ApplicationCache.db in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C9E593E1D3EB1DE00E3C62E /* ApplicationCache.db */; };
+ 5C9E59421D3EB5AC00E3C62E /* ApplicationCache.db-shm in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */; };
+ 5C9E59431D3EB5AC00E3C62E /* ApplicationCache.db-wal in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */; };
764322D71B61CCC30024F801 /* WordBoundaryTypingAttributes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 764322D51B61CCA40024F801 /* WordBoundaryTypingAttributes.mm */; };
7673499D1930C5BB00E44DF9 /* StopLoadingDuringDidFailProvisionalLoad_bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7673499A1930182E00E44DF9 /* StopLoadingDuringDidFailProvisionalLoad_bundle.cpp */; };
76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */; };
@@ -203,7 +207,6 @@
7CCB4DA91C83AE7300CC6918 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCB4DA71C83AE7300CC6918 /* PageGroup.cpp */; };
7CCB99211D3B41F6003922F6 /* UserInitiatedActionInNavigationAction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CCB99201D3B41F6003922F6 /* UserInitiatedActionInNavigationAction.mm */; };
7CCB99231D3B4A46003922F6 /* open-multiple-external-url.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7CCB99221D3B44E7003922F6 /* open-multiple-external-url.html */; };
- 7CCE7EA41A4119F300447C4C /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */; };
7CCE7EA51A411A0800447C4C /* _javascript_TestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C081224013FC172400DC39AE /* _javascript_TestMac.mm */; };
7CCE7EA61A411A0F00447C4C /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
7CCE7EA71A411A1300447C4C /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90955C125548AA00083756 /* PlatformWebViewMac.mm */; };
@@ -488,6 +491,9 @@
dstPath = TestWebKitAPI.resources;
dstSubfolderSpec = 7;
files = (
+ 5C9E59411D3EB5AC00E3C62E /* ApplicationCache.db in Copy Resources */,
+ 5C9E59421D3EB5AC00E3C62E /* ApplicationCache.db-shm in Copy Resources */,
+ 5C9E59431D3EB5AC00E3C62E /* ApplicationCache.db-wal in Copy Resources */,
7CCB99231D3B4A46003922F6 /* open-multiple-external-url.html in Copy Resources */,
932AE53D1D371047005DFFAF /* focus-inputs.html in Copy Resources */,
46C519E61D3563FD00DAA51A /* LocalStorageNullEntries.html in Copy Resources */,
@@ -783,6 +789,11 @@
57F10D921C7E7B3800ECDF30 /* IsNavigationActionTrusted.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IsNavigationActionTrusted.mm; sourceTree = "<group>"; };
57F56A5B1C7F8A4000F31D7E /* IsNavigationActionTrusted.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = IsNavigationActionTrusted.html; sourceTree = "<group>"; };
5C5E633D1D0B67940085A025 /* UniqueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueRef.cpp; sourceTree = "<group>"; };
+ 5C726D6D1D3EE06800C5E1A1 /* InstanceMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstanceMethodSwizzler.h; path = cocoa/InstanceMethodSwizzler.h; sourceTree = "<group>"; };
+ 5C726D6E1D3EE06800C5E1A1 /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InstanceMethodSwizzler.mm; path = cocoa/InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
+ 5C9E593E1D3EB1DE00E3C62E /* ApplicationCache.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = ApplicationCache.db; sourceTree = "<group>"; };
+ 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ApplicationCache.db-shm"; sourceTree = "<group>"; };
+ 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ApplicationCache.db-wal"; sourceTree = "<group>"; };
7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheAddImageToCacheIOS.mm; sourceTree = "<group>"; };
75F3133F18C171B70041CAEC /* EphemeralSessionPushStateNoHistoryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EphemeralSessionPushStateNoHistoryCallback.cpp; sourceTree = "<group>"; };
764322D51B61CCA40024F801 /* WordBoundaryTypingAttributes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WordBoundaryTypingAttributes.mm; sourceTree = "<group>"; };
@@ -974,8 +985,6 @@
C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitAgnosticTest.mm; sourceTree = "<group>"; };
C08587BE13FE956C001EF4E5 /* WebKitAgnosticTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAgnosticTest.h; sourceTree = "<group>"; };
C08587FB13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
- C08587FE13FEC3A6001EF4E5 /* InstanceMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstanceMethodSwizzler.h; sourceTree = "<group>"; };
- C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
C0991C50143C7D68007998F2 /* RetainPtrHashing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RetainPtrHashing.cpp; sourceTree = "<group>"; };
C0ADBE7A12FCA4D000D2C129 /* _javascript_Test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = _javascript_Test.cpp; sourceTree = "<group>"; };
C0ADBE7B12FCA4D000D2C129 /* _javascript_Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _javascript_Test.h; sourceTree = "<group>"; };
@@ -1146,6 +1155,8 @@
0F139E711A423A1D00F590F5 /* cocoa */ = {
isa = PBXGroup;
children = (
+ 5C726D6D1D3EE06800C5E1A1 /* InstanceMethodSwizzler.h */,
+ 5C726D6E1D3EE06800C5E1A1 /* InstanceMethodSwizzler.mm */,
A13EBB441B87332B00097110 /* WebProcessPlugIn */,
0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */,
A14FC58D1B8AE36500D107EB /* TestProtocol.h */,
@@ -1304,6 +1315,9 @@
A16F66B81C40E9E100BD4D24 /* Resources */ = {
isa = PBXGroup;
children = (
+ 5C9E593E1D3EB1DE00E3C62E /* ApplicationCache.db */,
+ 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */,
+ 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */,
93CFA8661CEB9DE1000565A8 /* autofocused-text-input.html */,
A16F66B91C40EA2000BD4D24 /* ContentFiltering.html */,
5714ECB81CA8B58800051AC8 /* DownloadRequestOriginalURL.html */,
@@ -1618,8 +1632,6 @@
isa = PBXGroup;
children = (
1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */,
- C08587FE13FEC3A6001EF4E5 /* InstanceMethodSwizzler.h */,
- C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */,
C081224013FC172400DC39AE /* _javascript_TestMac.mm */,
2E7765CE16C4D81100BA2BB1 /* mainMac.mm */,
BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */,
@@ -2137,7 +2149,6 @@
7CCE7EFC1A411AE600447C4C /* InjectedBundleFrameHitTest.cpp in Sources */,
7CCE7EFD1A411AE600447C4C /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */,
7CCE7EC31A411A7E00447C4C /* InspectorBar.mm in Sources */,
- 7CCE7EA41A4119F300447C4C /* InstanceMethodSwizzler.mm in Sources */,
7CCE7EDA1A411A8700447C4C /* InstanceMethodSwizzler.mm in Sources */,
7C54A4BE1AA11CCA00380F78 /* WKBundleFileHandle.cpp in Sources */,
CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */,
@@ -2177,6 +2188,7 @@
7CCE7F091A411AE600447C4C /* ParentFrame.cpp in Sources */,
7CCE7F0A1A411AE600447C4C /* PasteboardNotifications.mm in Sources */,
7C83E0BB1D0A650000FEBCF3 /* FindInPage.mm in Sources */,
+ 5C726D6F1D3EE06E00C5E1A1 /* InstanceMethodSwizzler.mm in Sources */,
7CCE7EAF1A411A3800447C4C /* PlatformUtilities.cpp in Sources */,
0F139E781A423A6B00F590F5 /* PlatformUtilitiesCocoa.mm in Sources */,
7C417F331D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm in Sources */,
Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db
(Binary files differ)
Index: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db
===================================================================
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db 2016-07-19 22:51:13 UTC (rev 203426)
Property changes on: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db
___________________________________________________________________
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm
(Binary files differ)
Index: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm
===================================================================
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm 2016-07-19 22:51:13 UTC (rev 203426)
Property changes on: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm
___________________________________________________________________
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal
(Binary files differ)
Index: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal
===================================================================
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal 2016-07-19 22:51:13 UTC (rev 203426)
Property changes on: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal
___________________________________________________________________
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm (203425 => 203426)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm 2016-07-19 22:51:13 UTC (rev 203426)
@@ -25,6 +25,7 @@
#import "config.h"
+#import "InstanceMethodSwizzler.h"
#import "PlatformUtilities.h"
#import "Test.h"
#import <WebKit/WKProcessPoolPrivate.h>
@@ -89,4 +90,84 @@
TestWebKitAPI::Util::run(&readyToContinue);
}
+static long long fileSize(NSURL* url)
+{
+ NSError *error = nil;
+ NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:url.path error:&error];
+ if (error)
+ return -1;
+ return [[fileAttributes objectForKey:NSFileSize] longLongValue];
+}
+
+NSString *swizzledBundleIdentifierMobileSafari()
+{
+ return @"com.apple.mobilesafari";
+}
+
+NSString *swizzledBundleIdentifierWebBookmarksD()
+{
+ return @"com.apple.webbookmarksd";
+}
+
+NSString *defaultApplicationCacheDirectory()
+{
+ return @"~/Library/Caches/TestWebKitAPI/WebKit/OfflineWebApplicationCache";
+}
+
+TEST(WKWebView, ClearAppCache)
+{
+ {
+ NSURL *dbResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db" subdirectory:@"TestWebKitAPI.resources"];
+ NSURL *shmResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-shm" subdirectory:@"TestWebKitAPI.resources"];
+ NSURL *walResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-wal" subdirectory:@"TestWebKitAPI.resources"];
+
+ NSURL *targetURL = [NSURL fileURLWithPath:[defaultApplicationCacheDirectory() stringByExpandingTildeInPath]];
+ [[NSFileManager defaultManager] createDirectoryAtURL:targetURL withIntermediateDirectories:YES attributes:nil error:nil];
+
+ NSURL *dbTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db"];
+ NSURL *walTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db-wal"];
+ NSURL *shmTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db-shm"];
+
+ // Clean up any files that may have been left from this test failing before.
+ [[NSFileManager defaultManager] removeItemAtURL:dbTargetURL error:nil];
+ [[NSFileManager defaultManager] removeItemAtURL:walTargetURL error:nil];
+ [[NSFileManager defaultManager] removeItemAtURL:shmTargetURL error:nil];
+ EXPECT_EQ(fileSize(dbTargetURL), -1);
+ EXPECT_EQ(fileSize(walTargetURL), -1);
+ EXPECT_EQ(fileSize(shmTargetURL), -1);
+
+ // Copy the resources from the bundle to ~/Library/...
+ [[NSFileManager defaultManager] copyItemAtURL:dbResourceURL toURL:dbTargetURL error:nil];
+ [[NSFileManager defaultManager] copyItemAtURL:shmResourceURL toURL:shmTargetURL error:nil];
+ [[NSFileManager defaultManager] copyItemAtURL:walResourceURL toURL:walTargetURL error:nil];
+ EXPECT_GT(fileSize(dbTargetURL), 0);
+ EXPECT_GT(fileSize(shmTargetURL), 0);
+ EXPECT_GT(fileSize(walTargetURL), 0);
+
+ // Make sure there is a record in the WKWebsiteDataStore.
+ readyToContinue = false;
+ [[WKWebsiteDataStore defaultDataStore] fetchDataRecordsOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] completionHandler:^(NSArray<WKWebsiteDataRecord *> *websiteDataRecords)
+ {
+ EXPECT_EQ(websiteDataRecords.count, 1ul);
+ readyToContinue = true;
+ }];
+ TestWebKitAPI::Util::run(&readyToContinue);
+ }
+
+ readyToContinue = false;
+ [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^()
+ {
+ NSURL *targetURL = [NSURL fileURLWithPath:[defaultApplicationCacheDirectory() stringByExpandingTildeInPath]];
+ NSURL *walTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db-wal"];
+
+ // Make sure there is no record in the WKWebsiteDataStore.
+ EXPECT_EQ(fileSize(walTargetURL), 0);
+ [[WKWebsiteDataStore defaultDataStore] fetchDataRecordsOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] completionHandler:^(NSArray<WKWebsiteDataRecord *> *websiteDataRecords)
+ {
+ EXPECT_EQ(websiteDataRecords.count, 0ul);
+ readyToContinue = true;
+ }];
+ }];
+ TestWebKitAPI::Util::run(&readyToContinue);
+}
#endif
Copied: trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.h (from rev 203425, trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.h) (0 => 203426)
--- trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.h (rev 0)
+++ trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.h 2016-07-19 22:51:13 UTC (rev 203426)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef InstanceMethodSwizzler_h
+#define InstanceMethodSwizzler_h
+
+#include <objc/runtime.h>
+#include <wtf/Noncopyable.h>
+
+namespace TestWebKitAPI {
+
+class InstanceMethodSwizzler {
+ WTF_MAKE_NONCOPYABLE(InstanceMethodSwizzler);
+public:
+ InstanceMethodSwizzler(Class, SEL, IMP);
+ ~InstanceMethodSwizzler();
+
+ Method m_method;
+ IMP m_originalImplementation;
+};
+
+} // namespace TestWebKitAPI
+
+#endif // InstanceMethodSwizzler_h
Copied: trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.mm (from rev 203425, trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.mm) (0 => 203426)
--- trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.mm (rev 0)
+++ trunk/Tools/TestWebKitAPI/cocoa/InstanceMethodSwizzler.mm 2016-07-19 22:51:13 UTC (rev 203426)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#include "config.h"
+#include "InstanceMethodSwizzler.h"
+
+namespace TestWebKitAPI {
+
+InstanceMethodSwizzler::InstanceMethodSwizzler(Class cls, SEL selector, IMP implementation)
+ : m_method(class_getInstanceMethod(cls, selector))
+ , m_originalImplementation(method_setImplementation(m_method, implementation))
+{
+}
+
+InstanceMethodSwizzler::~InstanceMethodSwizzler()
+{
+ method_setImplementation(m_method, m_originalImplementation);
+}
+
+} // namespace TestWebKitAPI
Deleted: trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.h (203425 => 203426)
--- trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.h 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.h 2016-07-19 22:51:13 UTC (rev 203426)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef InstanceMethodSwizzler_h
-#define InstanceMethodSwizzler_h
-
-#include <objc/runtime.h>
-#include <wtf/Noncopyable.h>
-
-namespace TestWebKitAPI {
-
-class InstanceMethodSwizzler {
- WTF_MAKE_NONCOPYABLE(InstanceMethodSwizzler);
-public:
- InstanceMethodSwizzler(Class, SEL, IMP);
- ~InstanceMethodSwizzler();
-
- Method m_method;
- IMP m_originalImplementation;
-};
-
-} // namespace TestWebKitAPI
-
-#endif // InstanceMethodSwizzler_h
Deleted: trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.mm (203425 => 203426)
--- trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.mm 2016-07-19 22:50:10 UTC (rev 203425)
+++ trunk/Tools/TestWebKitAPI/mac/InstanceMethodSwizzler.mm 2016-07-19 22:51:13 UTC (rev 203426)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include "config.h"
-#include "InstanceMethodSwizzler.h"
-
-namespace TestWebKitAPI {
-
-InstanceMethodSwizzler::InstanceMethodSwizzler(Class cls, SEL selector, IMP implementation)
- : m_method(class_getInstanceMethod(cls, selector))
- , m_originalImplementation(method_setImplementation(m_method, implementation))
-{
-}
-
-InstanceMethodSwizzler::~InstanceMethodSwizzler()
-{
- method_setImplementation(m_method, m_originalImplementation);
-}
-
-} // namespace TestWebKitAPI