diff options
Diffstat (limited to 'Tools/TestWebKitAPI')
30 files changed, 1053 insertions, 26 deletions
diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebug.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebug.vsprops new file mode 100644 index 0000000..565455e --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebug.vsprops @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIDebug" + InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugAll.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugAll.vsprops new file mode 100644 index 0000000..4b9ffac --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugAll.vsprops @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIDebugAll" + InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugCairoCFLite.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugCairoCFLite.vsprops new file mode 100644 index 0000000..a218ec7 --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIDebugCairoCFLite.vsprops @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIDebugCairoCFLite" + InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIInjectedBundleCommon.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIInjectedBundleCommon.vsprops new file mode 100644 index 0000000..2819359 --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIInjectedBundleCommon.vsprops @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIInjectedBundleCommon" + > + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll" + /> +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIRelease.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIRelease.vsprops new file mode 100644 index 0000000..f98fbfc --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIRelease.vsprops @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIRelease" + InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPIReleaseCairoCFLite.vsprops b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIReleaseCairoCFLite.vsprops new file mode 100644 index 0000000..512eca6 --- /dev/null +++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPIReleaseCairoCFLite.vsprops @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIReleaseCairoCFLite" + InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Tools/TestWebKitAPI/InjectedBundleController.h b/Tools/TestWebKitAPI/InjectedBundleController.h index b84be4b..c9923bb 100644 --- a/Tools/TestWebKitAPI/InjectedBundleController.h +++ b/Tools/TestWebKitAPI/InjectedBundleController.h @@ -46,6 +46,8 @@ public: typedef InjectedBundleTest* (*CreateInjectedBundleTestFunction)(const std::string&); void registerCreateInjectedBundleTestFunction(const std::string&, CreateInjectedBundleTestFunction); + WKBundleRef bundle() const { return m_bundle; } + private: InjectedBundleController(); ~InjectedBundleController(); diff --git a/Tools/TestWebKitAPI/JavaScriptTest.cpp b/Tools/TestWebKitAPI/JavaScriptTest.cpp index 08418c2..11b2d99 100644 --- a/Tools/TestWebKitAPI/JavaScriptTest.cpp +++ b/Tools/TestWebKitAPI/JavaScriptTest.cpp @@ -27,7 +27,9 @@ #include "PlatformUtilities.h" #include "Test.h" +#include <JavaScriptCore/JavaScriptCore.h> #include <WebKit2/WKRetainPtr.h> +#include <WebKit2/WKSerializedScriptValue.h> namespace TestWebKitAPI { @@ -39,12 +41,26 @@ struct JavaScriptCallbackContext { bool didMatchExpectedString; }; -static void javaScriptCallback(WKStringRef string, WKErrorRef error, void* ctx) +static void javaScriptCallback(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* ctx) { + TEST_ASSERT(resultSerializedScriptValue); + JavaScriptCallbackContext* context = static_cast<JavaScriptCallbackContext*>(ctx); + JSGlobalContextRef scriptContext = JSGlobalContextCreate(0); + TEST_ASSERT(scriptContext); + + JSValueRef scriptValue = WKSerializedScriptValueDeserialize(resultSerializedScriptValue, scriptContext, 0); + TEST_ASSERT(scriptValue); + + JSStringRef scriptString = JSValueToStringCopy(scriptContext, scriptValue, 0); + TEST_ASSERT(scriptString); + context->didFinish = true; - context->didMatchExpectedString = WKStringIsEqualToUTF8CString(string, context->expectedString); + context->didMatchExpectedString = JSStringIsEqualToUTF8CString(scriptString, context->expectedString); + + JSStringRelease(scriptString); + JSGlobalContextRelease(scriptContext); TEST_ASSERT(!error); } diff --git a/Tools/TestWebKitAPI/PlatformUtilities.h b/Tools/TestWebKitAPI/PlatformUtilities.h index 9fecdd5..219a5dc 100644 --- a/Tools/TestWebKitAPI/PlatformUtilities.h +++ b/Tools/TestWebKitAPI/PlatformUtilities.h @@ -36,6 +36,8 @@ namespace Util { // Runs a platform runloop until the 'done' is true. void run(bool* done); +void sleep(double seconds); + WKContextRef createContextForInjectedBundleTest(const std::string&, WKTypeRef userData = 0); WKStringRef createInjectedBundlePath(); @@ -47,7 +49,6 @@ bool isKeyDown(WKNativeEventPtr); std::string toSTD(WKStringRef string); WKRetainPtr<WKStringRef> toWK(const char* utf8String); - template<typename T> static inline WKRetainPtr<T> adoptWK(T item) { return WKRetainPtr<T>(AdoptWK, item); diff --git a/Tools/TestWebKitAPI/PlatformWebView.h b/Tools/TestWebKitAPI/PlatformWebView.h index 312168d..3d1698f 100644 --- a/Tools/TestWebKitAPI/PlatformWebView.h +++ b/Tools/TestWebKitAPI/PlatformWebView.h @@ -27,6 +27,7 @@ #define PlatformWebView_h #include <wtf/Platform.h> +#include <CoreGraphics/CGGeometry.h> #ifdef __APPLE__ #ifdef __OBJC__ @@ -61,6 +62,7 @@ public: void simulateSpacebarKeyPress(); void simulateAltKeyPress(); + void simulateRightClick(unsigned x, unsigned y); #if PLATFORM(WIN) void setParentWindowMessageObserver(WindowMessageObserver* observer) { m_parentWindowMessageObserver = observer; } diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj index 99bb29f..079b7ff 100644 --- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj +++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj @@ -10,7 +10,11 @@ 1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02C84E125D4A8400E3F4BD /* Find.cpp */; }; 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; }; 1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */; }; + 1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */; }; + 1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */; }; 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; }; + 4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */; }; + 4BFDFFA9131477770061F24B /* HitTestResultNodeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFDFFA8131477770061F24B /* HitTestResultNodeHandle.cpp */; }; BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; }; BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; }; BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC131AA8117131FC00B69727 /* TestsController.cpp */; }; @@ -48,6 +52,8 @@ C0ADBE7C12FCA4D000D2C129 /* JavaScriptTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0ADBE7A12FCA4D000D2C129 /* JavaScriptTest.cpp */; }; C0ADBE8312FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */; }; C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C0ADBE8412FCA6B600D2C129 /* simple-form.html */; }; + C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */; }; + C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -82,6 +88,7 @@ C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */, C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */, BC2D006412AA04CE00E732A3 /* file-with-anchor.html in Copy Resources */, + 1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */, ); name = "Copy Resources"; runOnlyForDeploymentPostprocessing = 0; @@ -92,7 +99,11 @@ 1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; }; 1A02C84E125D4A8400E3F4BD /* Find.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Find.cpp; sourceTree = "<group>"; }; 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJavaScript.cpp; sourceTree = "<group>"; }; + 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ForceRepaint.cpp; sourceTree = "<group>"; }; + 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-accelerated-compositing.html"; sourceTree = "<group>"; }; 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; }; + 4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResultNodeHandle_Bundle.cpp; sourceTree = "<group>"; }; + 4BFDFFA8131477770061F24B /* HitTestResultNodeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResultNodeHandle.cpp; sourceTree = "<group>"; }; 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; }; BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; }; BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUtilitiesMac.mm; sourceTree = "<group>"; }; @@ -140,6 +151,8 @@ C0ADBE7B12FCA4D000D2C129 /* JavaScriptTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptTest.h; sourceTree = "<group>"; }; C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestoreSessionStateContainingFormData.cpp; sourceTree = "<group>"; }; C0ADBE8412FCA6B600D2C129 /* simple-form.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-form.html"; sourceTree = "<group>"; }; + C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly.cpp; sourceTree = "<group>"; }; + C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -249,13 +262,18 @@ 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */, BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */, 1A02C84E125D4A8400E3F4BD /* Find.cpp */, + 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */, BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */, BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */, + 4BFDFFA8131477770061F24B /* HitTestResultNodeHandle.cpp */, + 4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */, BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */, BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */, BC909779125571AB00083756 /* PageLoadBasic.cpp */, BC2D004812A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp */, 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */, + C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */, + C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */, C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */, C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */, BC7B619A1299FE9E00D174A4 /* WKPreferences.cpp */, @@ -279,8 +297,9 @@ BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */, 1A02C84B125D4A5E00E3F4BD /* find.html */, BCBD372E125ABBE600D2C29F /* icon.png */, - BC909778125571AB00083756 /* simple.html */, + 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */, C0ADBE8412FCA6B600D2C129 /* simple-form.html */, + BC909778125571AB00083756 /* simple.html */, C02B7882126615410026BF0F /* spacebar-scrolling.html */, ); name = Resources; @@ -407,6 +426,9 @@ BC2D004912A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */, C0ADBE7C12FCA4D000D2C129 /* JavaScriptTest.cpp in Sources */, C0ADBE8312FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp in Sources */, + 1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */, + 4BFDFFA9131477770061F24B /* HitTestResultNodeHandle.cpp in Sources */, + C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -420,6 +442,8 @@ BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */, BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */, BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */, + 4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */, + C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp index 32bd563..c5d1745 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp @@ -27,17 +27,19 @@ #include "PlatformUtilities.h" #include "PlatformWebView.h" +#include <JavaScriptCore/JavaScriptCore.h> #include <WebKit2/WKRetainPtr.h> #include <WebKit2/WebKit2.h> +#include <WebKit2/WKSerializedScriptValue.h> namespace TestWebKitAPI { static bool testDone; -static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context) +static void didRunJavaScript(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context) { TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578)); - TEST_ASSERT(WKStringIsEmpty(resultString)); + TEST_ASSERT(!resultSerializedScriptValue); // FIXME: We should also check the error, but right now it's always null. // Assert that it's null so we can revisit when this changes. diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp new file mode 100644 index 0000000..499a40a --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp @@ -0,0 +1,69 @@ +/* + * 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 "Test.h" + +#include "PlatformUtilities.h" +#include "PlatformWebView.h" +#include <WebKit2/WebKit2.h> +#include <WebKit2/WKRetainPtr.h> + +namespace TestWebKitAPI { + +static bool test1Done; +static bool test2Done; + +void didForceRepaint(WKErrorRef error, void*) +{ + TEST_ASSERT(!error); + test2Done = true; +} + +static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) +{ + test1Done = true; + WKPageForceRepaint(page, 0, didForceRepaint); +} + +TEST(WebKit2, ForceRepaint) +{ + WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); + PlatformWebView webView(context.get()); + + WKPageLoaderClient loaderClient; + memset(&loaderClient, 0, sizeof(loaderClient)); + + loaderClient.version = 0; + loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; + WKPageSetPageLoaderClient(webView.page(), &loaderClient); + + WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-accelerated-compositing", "html")); + WKPageLoadURL(webView.page(), url.get()); + + Util::run(&test1Done); + Util::run(&test2Done); +} + +} // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp new file mode 100644 index 0000000..5000a47 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp @@ -0,0 +1,88 @@ +/* + * 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 "Test.h" + +#include "PlatformUtilities.h" +#include "PlatformWebView.h" +#include <WebKit2/WebKit2.h> +#include <WebKit2/WKRetainPtr.h> + +namespace TestWebKitAPI { + +static bool done; +static bool messageReceived; +static bool didFinishLoad; + +static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*) +{ + didFinishLoad = true; +} + +static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo) +{ + messageReceived = true; + if (WKStringIsEqualToUTF8CString(messageName, "HitTestResultNodeHandleTestDoneMessageName")) + done = true; +} + +static void setPageLoaderClient(WKPageRef page) +{ + WKPageLoaderClient loaderClient; + memset(&loaderClient, 0, sizeof(loaderClient)); + loaderClient.version = 0; + loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; + + WKPageSetPageLoaderClient(page, &loaderClient); +} + +static void setInjectedBundleClient(WKContextRef context) +{ + WKContextInjectedBundleClient injectedBundleClient; + memset(&injectedBundleClient, 0, sizeof(injectedBundleClient)); + injectedBundleClient.version = 0; + injectedBundleClient.clientInfo = 0; + injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle; + WKContextSetInjectedBundleClient(context, &injectedBundleClient); +} + +TEST(WebKit2, HitTestResultNodeHandle) +{ + WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("HitTestResultNodeHandleTest")); + + setInjectedBundleClient(context.get()); + + PlatformWebView webView(context.get()); + setPageLoaderClient(webView.page()); + + WKPageLoadURL(webView.page(), Util::adoptWK(Util::createURLForResource("simple", "html")).get()); + Util::run(&didFinishLoad); + didFinishLoad = false; + + webView.simulateRightClick(10, 10); + Util::run(&done); +} + +} // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp new file mode 100644 index 0000000..d8a7fd1 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp @@ -0,0 +1,64 @@ +/* + * 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 "InjectedBundleTest.h" +#include "InjectedBundleController.h" +#include "PlatformUtilities.h" +#include <WebKit2/WKBundlePage.h> +#include <WebKit2/WKBundleHitTestResult.h> +#include <WebKit2/WKRetainPtr.h> +#include <WebKit2/WebKit2.h> + +namespace TestWebKitAPI { + +class HitTestResultNodeHandleTest : public InjectedBundleTest { +public: + HitTestResultNodeHandleTest(const std::string& identifier) + : InjectedBundleTest(identifier) + { + } + + static void getContextMenuFromDefaultMenu(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo) + { + WKRetainPtr<WKBundleNodeHandleRef> nodeHandle(AdoptWK, WKBundleHitTestResultCopyNodeHandle(hitTestResult)); + if (!nodeHandle) + return; + + WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("HitTestResultNodeHandleTestDoneMessageName").get(), Util::toWK("HitTestResultNodeHandleTestDoneMessageBody").get()); + } + + virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) + { + WKBundlePageContextMenuClient contextMenuClient; + memset(&contextMenuClient, 0, sizeof(contextMenuClient)); + contextMenuClient.getContextMenuFromDefaultMenu = getContextMenuFromDefaultMenu; + + WKBundlePageSetContextMenuClient(page, &contextMenuClient); + } +}; + +static InjectedBundleTest::Register<HitTestResultNodeHandleTest> registrar("HitTestResultNodeHandleTest"); + +} // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp index 6cd281e..8de5dba 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp @@ -103,7 +103,7 @@ static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKF WKFramePolicyListenerUse(listener); } -static void decidePolicyForMIMEType(WKPageRef page, WKFrameRef frame, WKStringRef MIMEType, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) +static void decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) { WKFramePolicyListenerUse(listener); } @@ -132,7 +132,7 @@ TEST(WebKit2, PageLoadBasic) policyClient.clientInfo = &state; policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction; policyClient.decidePolicyForNewWindowAction = decidePolicyForNewWindowAction; - policyClient.decidePolicyForMIMEType = decidePolicyForMIMEType; + policyClient.decidePolicyForResponse = decidePolicyForResponse; WKPageSetPagePolicyClient(webView.page(), &policyClient); WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html")); diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp index 3cbe113..a492a67 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp @@ -32,7 +32,7 @@ namespace TestWebKitAPI { -static void nullJavaScriptCallback(WKStringRef, WKErrorRef error, void*) +static void nullJavaScriptCallback(WKSerializedScriptValueRef, WKErrorRef error, void*) { } diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp index 306174a..932b15f 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp @@ -27,20 +27,31 @@ #include "PlatformUtilities.h" #include "PlatformWebView.h" +#include <JavaScriptCore/JavaScriptCore.h> #include <WebKit2/WKRetainPtr.h> #include <WebKit2/WebKit2.h> +#include <WebKit2/WKSerializedScriptValue.h> namespace TestWebKitAPI { static bool testDone; -static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context) +static void didRunJavaScript(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context) { TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578)); - + TEST_ASSERT(resultSerializedScriptValue); + + JSGlobalContextRef scriptContext = JSGlobalContextCreate(0); + JSValueRef scriptValue = WKSerializedScriptValueDeserialize(resultSerializedScriptValue, scriptContext, 0); + TEST_ASSERT(JSValueIsString(scriptContext, scriptValue)); + // Make sure that the result of navigator.userAgent isn't empty, even if we set the custom // user agent to the empty string. - TEST_ASSERT(!WKStringIsEmpty(resultString)); + JSStringRef scriptString = JSValueToStringCopy(scriptContext, scriptValue, 0); + TEST_ASSERT(JSStringGetLength(scriptString)); + + JSStringRelease(scriptString); + JSGlobalContextRelease(scriptContext); testDone = true; } diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp new file mode 100644 index 0000000..ea1013a --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp @@ -0,0 +1,98 @@ +/* + * 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 "Test.h" + +#include "PlatformUtilities.h" +#include "PlatformWebView.h" + +namespace TestWebKitAPI { + +static bool didFinishLoad; +static bool didBecomeUnresponsive; +static bool didBrieflyPause; + +static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef, const void*) +{ + didBrieflyPause = true; + TEST_ASSERT(WKStringIsEqualToUTF8CString(messageName, "DidBrieflyPause")); +} + +static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*) +{ + didFinishLoad = true; +} + +static void processDidBecomeUnresponsive(WKPageRef, const void*) +{ + didBecomeUnresponsive = true; +} + +static void setInjectedBundleClient(WKContextRef context) +{ + WKContextInjectedBundleClient injectedBundleClient; + memset(&injectedBundleClient, 0, sizeof(injectedBundleClient)); + injectedBundleClient.version = 0; + injectedBundleClient.clientInfo = 0; + injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle; + + WKContextSetInjectedBundleClient(context, &injectedBundleClient); +} + +static void setPageLoaderClient(WKPageRef page) +{ + WKPageLoaderClient loaderClient; + memset(&loaderClient, 0, sizeof(loaderClient)); + loaderClient.version = 0; + loaderClient.clientInfo = 0; + loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; + loaderClient.processDidBecomeUnresponsive = processDidBecomeUnresponsive; + + WKPageSetPageLoaderClient(page, &loaderClient); +} + +TEST(WebKit2, ResponsivenessTimerDoesntFireEarly) +{ + WKRetainPtr<WKContextRef> context = Util::adoptWK(Util::createContextForInjectedBundleTest("ResponsivenessTimerDoesntFireEarlyTest")); + setInjectedBundleClient(context.get()); + + PlatformWebView webView(context.get()); + setPageLoaderClient(webView.page()); + + WKPageLoadURL(webView.page(), Util::adoptWK(Util::createURLForResource("simple", "html")).get()); + Util::run(&didFinishLoad); + + WKContextPostMessageToInjectedBundle(context.get(), Util::toWK("BrieflyPause").get(), 0); + + // Pressing a key on the keyboard should start the responsiveness timer. Since the web process + // is going to pause before it receives this keypress, it should take a little while to respond + // (but not so long that the responsiveness timer fires). + webView.simulateSpacebarKeyPress(); + + Util::run(&didBrieflyPause); + TEST_ASSERT(!didBecomeUnresponsive); +} + +} // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp new file mode 100644 index 0000000..f0ad0ea --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp @@ -0,0 +1,58 @@ +/* + * 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 "InjectedBundleTest.h" + +#include "PlatformUtilities.h" + +namespace TestWebKitAPI { + +class ResponsivenessTimerDoesntFireEarlyTest : public InjectedBundleTest { +public: + ResponsivenessTimerDoesntFireEarlyTest(const std::string& identifier); + +private: + virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody); +}; + +static InjectedBundleTest::Register<ResponsivenessTimerDoesntFireEarlyTest> registrar("ResponsivenessTimerDoesntFireEarlyTest"); + +ResponsivenessTimerDoesntFireEarlyTest::ResponsivenessTimerDoesntFireEarlyTest(const std::string& identifier) + : InjectedBundleTest(identifier) +{ +} + +void ResponsivenessTimerDoesntFireEarlyTest::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef) +{ + if (!WKStringIsEqualToUTF8CString(messageName, "BrieflyPause")) + return; + + // The responsiveness timer is a 3-second timer. Pausing for 0.5 seconds should not cause it to fire. + Util::sleep(0.5); + + WKBundlePostMessage(bundle, Util::toWK("DidBrieflyPause").get(), 0); +} + +} // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/simple-accelerated-compositing.html b/Tools/TestWebKitAPI/Tests/WebKit2/simple-accelerated-compositing.html new file mode 100644 index 0000000..bea6272 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/simple-accelerated-compositing.html @@ -0,0 +1,5 @@ +<html> +<body> + <div style="-webkit-transform: translateZ(0);">Simple HTML file with accelerated compositing</div> +</body> +</html> diff --git a/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm b/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm index 474278f..57ec675 100644 --- a/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm +++ b/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm @@ -39,6 +39,11 @@ void run(bool* done) [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } +void sleep(double seconds) +{ + usleep(seconds * 1000000); +} + WKStringRef createInjectedBundlePath() { NSString *nsString = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundleTestWebKitAPI.bundle"]; diff --git a/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm b/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm index ad901d3..64a7c1c 100644 --- a/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm +++ b/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm @@ -94,4 +94,33 @@ void PlatformWebView::simulateSpacebarKeyPress() [m_view keyUp:event]; } +void PlatformWebView::simulateRightClick(unsigned x, unsigned y) +{ + NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown + location:NSMakePoint(x, y) + modifierFlags:0 + timestamp:GetCurrentEventTime() + windowNumber:[m_window windowNumber] + context:[NSGraphicsContext currentContext] + eventNumber:0 + clickCount:0 + pressure:0]; + + + [m_view rightMouseDown:event]; + + event = [NSEvent mouseEventWithType:NSRightMouseUp + location:NSMakePoint(x, y) + modifierFlags:0 + timestamp:GetCurrentEventTime() + windowNumber:[m_window windowNumber] + context:[NSGraphicsContext currentContext] + eventNumber:0 + clickCount:0 + pressure:0]; + + [m_view rightMouseUp:event]; + +} + } // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp index 6efc9ea..8ed2fbf 100644 --- a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp +++ b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp @@ -33,9 +33,9 @@ namespace TestWebKitAPI { namespace Util { #ifdef DEBUG_ALL -const char* injectedBundleDLL = "\\InjectedBundle_debug.dll"; +const char* injectedBundleDLL = "TestWebKitAPIInjectedBundle_debug.dll"; #else -const char* injectedBundleDLL = "\\InjectedBundle.dll"; +const char* injectedBundleDLL = "TestWebKitAPIInjectedBundle.dll"; #endif void run(bool* done) @@ -50,6 +50,11 @@ void run(bool* done) } } +void sleep(double seconds) +{ + ::Sleep(seconds * 1000); +} + RetainPtr<CFStringRef> cf(const char* utf8String) { return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, utf8String, kCFStringEncodingUTF8)); @@ -59,7 +64,7 @@ WKStringRef createInjectedBundlePath() { RetainPtr<CFURLRef> executableURL(AdoptCF, CFBundleCopyExecutableURL(CFBundleGetMainBundle())); RetainPtr<CFURLRef> executableContainerURL(AdoptCF, CFURLCreateCopyDeletingLastPathComponent(0, executableURL.get())); - RetainPtr<CFStringRef> dllFilename(AdoptCF, CFStringCreateWithCStringNoCopy(0, injectedBundleDLL, kCFStringEncodingWindowsLatin1, 0)); + RetainPtr<CFStringRef> dllFilename(AdoptCF, CFStringCreateWithCStringNoCopy(0, injectedBundleDLL, kCFStringEncodingWindowsLatin1, kCFAllocatorNull)); RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateCopyAppendingPathComponent(0, executableContainerURL.get(), dllFilename.get(), false)); RetainPtr<CFStringRef> bundlePath(AdoptCF, CFURLCopyFileSystemPath(bundleURL.get(), kCFURLWindowsPathStyle)); return WKStringCreateWithCFString(bundlePath.get()); diff --git a/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp b/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp index 01a76eb..132ab2a 100644 --- a/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp +++ b/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp @@ -101,6 +101,14 @@ void PlatformWebView::simulateAltKeyPress() ::SendMessageW(window, WM_SYSKEYUP, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset)); } +void PlatformWebView::simulateRightClick(unsigned x, unsigned y) +{ + HWND window = WKViewGetWindow(m_view); + + ::SendMessageW(window, WM_RBUTTONDOWN, 0, MAKELPARAM(x, y)); + ::SendMessageW(window, WM_RBUTTONUP, 0, MAKELPARAM(x, y)); +} + LRESULT PlatformWebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { PlatformWebView* webView; diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPI.sln b/Tools/TestWebKitAPI/win/TestWebKitAPI.sln index 5354271..4202817 100644 --- a/Tools/TestWebKitAPI/win/TestWebKitAPI.sln +++ b/Tools/TestWebKitAPI/win/TestWebKitAPI.sln @@ -8,9 +8,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPI", "TestWebKit EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPIGenerated", "TestWebKitAPIGenerated.vcproj", "{45C45411-7F0E-404D-919A-4EE9BB60BE86}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPIInjectedBundle", "TestWebKitAPIInjectedBundle.vcproj", "{B0101604-B483-4F8C-9C51-90B46A2B1CD3}" + ProjectSection(ProjectDependencies) = postProject + {3E48AB23-D249-488F-A1C4-43CDF52FBD28} = {3E48AB23-D249-488F-A1C4-43CDF52FBD28} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - all|Win32 = all|Win32 Debug_All|Win32 = Debug_All|Win32 Debug_Cairo_CFLite|Win32 = Debug_Cairo_CFLite|Win32 Debug|Win32 = Debug|Win32 @@ -19,8 +23,6 @@ Global Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.all|Win32.ActiveCfg = Release_Cairo_CFLite|Win32 - {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.all|Win32.Build.0 = Release_Cairo_CFLite|Win32 {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.ActiveCfg = Debug_All|Win32 {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.Build.0 = Debug_All|Win32 {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32 @@ -33,8 +35,6 @@ Global {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.ActiveCfg = Release|Win32 {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.Build.0 = Release|Win32 - {45C45411-7F0E-404D-919A-4EE9BB60BE86}.all|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32 - {45C45411-7F0E-404D-919A-4EE9BB60BE86}.all|Win32.Build.0 = Debug_Cairo_CFLite|Win32 {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.ActiveCfg = Debug_All|Win32 {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.Build.0 = Debug_All|Win32 {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32 @@ -47,6 +47,18 @@ Global {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.ActiveCfg = Release|Win32 {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.Build.0 = Release|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_All|Win32.ActiveCfg = Debug_All|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_All|Win32.Build.0 = Debug_All|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug|Win32.ActiveCfg = Debug|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug|Win32.Build.0 = Debug|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_LTCG|Win32.ActiveCfg = Release_LTCG|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.ActiveCfg = Release|Win32 + {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj b/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj index 0c806a8..a894029 100644 --- a/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj +++ b/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj @@ -17,7 +17,7 @@ <Configuration Name="Debug|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebug.vsprops" CharacterSet="1" > <Tool @@ -78,7 +78,7 @@ <Configuration Name="Release|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops" CharacterSet="1" > <Tool @@ -139,7 +139,7 @@ <Configuration Name="Debug_All|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugAll.vsprops" CharacterSet="1" > <Tool @@ -200,7 +200,7 @@ <Configuration Name="Debug_Cairo_CFLite|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugCairoCFLite.vsprops" CharacterSet="1" > <Tool @@ -261,7 +261,7 @@ <Configuration Name="Release_Cairo_CFLite|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIReleaseCairoCFLite.vsprops" CharacterSet="1" > <Tool @@ -322,7 +322,7 @@ <Configuration Name="Release_LTCG|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops" + InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops" CharacterSet="1" WholeProgramOptimization="1" > @@ -412,6 +412,10 @@ Name="WebKit2" > <File + RelativePath="..\Tests\WebKit2\DocumentStartUserScriptAlertCrash.cpp" + > + </File> + <File RelativePath="..\Tests\WebKit2\EvaluateJavaScript.cpp" > </File> @@ -432,6 +436,10 @@ > </File> <File + RelativePath="..\Tests\WebKit2\ForceRepaint.cpp" + > + </File> + <File RelativePath="..\Tests\WebKit2\FrameMIMETypeHTML.cpp" > </File> @@ -444,6 +452,14 @@ > </File> <File + RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle.cpp" + > + </File> + <File + RelativePath="..\Tests\WebKit2\InjectedBundleBasic.cpp" + > + </File> + <File RelativePath="..\Tests\WebKit2\PageLoadBasic.cpp" > </File> @@ -456,10 +472,18 @@ > </File> <File + RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly.cpp" + > + </File> + <File RelativePath="..\Tests\WebKit2\RestoreSessionStateContainingFormData.cpp" > </File> <File + RelativePath="..\Tests\WebKit2\simple-accelerated-compositing.html" + > + </File> + <File RelativePath="..\Tests\WebKit2\simple-form.html" > </File> diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj b/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj new file mode 100644 index 0000000..3b18238 --- /dev/null +++ b/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj @@ -0,0 +1,447 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="TestWebKitAPIInjectedBundle" + ProjectGUID="{B0101604-B483-4F8C-9C51-90B46A2B1CD3}" + RootNamespace="TestWebKitAPIInjectedBundle" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebug.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug_All|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugAll.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release_LTCG|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug_Cairo_CFLite|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugCairoCFLite.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release_Cairo_CFLite|Win32" + ConfigurationType="2" + InheritedPropertySheets="..\Configurations\TestWebKitAPIReleaseCairoCFLite.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="win" + > + <File + RelativePath=".\PlatformUtilitiesWin.cpp" + > + </File> + </Filter> + <Filter + Name="Tests" + > + <Filter + Name="WebKit2" + > + <File + RelativePath="..\Tests\WebKit2\DocumentStartUserScriptAlertCrash_Bundle.cpp" + > + </File> + <File + RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle_Bundle.cpp" + > + </File> + <File + RelativePath="..\Tests\WebKit2\InjectedBundleBasic_Bundle.cpp" + > + </File> + <File + RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly_Bundle.cpp" + > + </File> + </Filter> + </Filter> + <File + RelativePath="..\InjectedBundleController.cpp" + > + </File> + <File + RelativePath="..\InjectedBundleController.h" + > + </File> + <File + RelativePath="..\InjectedBundleMain.cpp" + > + </File> + <File + RelativePath="..\InjectedBundleTest.h" + > + </File> + <File + RelativePath="..\PlatformUtilities.cpp" + > + </File> + <File + RelativePath="..\PlatformUtilities.h" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/Tools/TestWebKitAPI/win/copy-resources.cmd b/Tools/TestWebKitAPI/win/copy-resources.cmd index b0ef3df..a04df5c 100755 --- a/Tools/TestWebKitAPI/win/copy-resources.cmd +++ b/Tools/TestWebKitAPI/win/copy-resources.cmd @@ -12,6 +12,7 @@ for %%f in ( ..\Tests\WebKit2\find.html ..\Tests\WebKit2\icon.png ..\Tests\WebKit2\simple.html + ..\Tests\WebKit2\simple-accelerated-compositing.html ..\Tests\WebKit2\simple-form.html ..\Tests\WebKit2\spacebar-scrolling.html ) do ( diff --git a/Tools/TestWebKitAPI/win/main.cpp b/Tools/TestWebKitAPI/win/main.cpp index 3091819..8f81f66 100644 --- a/Tools/TestWebKitAPI/win/main.cpp +++ b/Tools/TestWebKitAPI/win/main.cpp @@ -27,6 +27,11 @@ int main(int argc, const char* argv[]) { + // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for + // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the + // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>. + ::SetErrorMode(0); + bool passed = true; std::string argument(argv[1]); |