Title: [92095] trunk/Tools
Revision
92095
Author
[email protected]
Date
2011-07-31 20:32:07 -0700 (Sun, 31 Jul 2011)

Log Message

Fix SpacebarScrolling WebKit2 API test
https://bugs.webkit.org/show_bug.cgi?id=65431

Reviewed by Sam Weinig.

Add a way to do platform-specific bundle initialization, and use it to disable smooth
scrolling. Also make it possible for a test to load the injected bundle without actually running
a test from it.

* TestWebKitAPI/InjectedBundleController.cpp:
(TestWebKitAPI::InjectedBundleController::initialize):
* TestWebKitAPI/InjectedBundleController.h:
* TestWebKitAPI/PlatformUtilities.cpp:
(TestWebKitAPI::Util::createContextWithInjectedBundle):
* TestWebKitAPI/PlatformUtilities.h:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/mac/InjectedBundleControllerMac.mm: Added.
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/win/InjectedBundleControllerWin.cpp: Added.
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/win/TestWebKitAPI.vcproj:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (92094 => 92095)


--- trunk/Tools/ChangeLog	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/ChangeLog	2011-08-01 03:32:07 UTC (rev 92095)
@@ -1,3 +1,29 @@
+2011-07-31  Anders Carlsson  <[email protected]>
+
+        Fix SpacebarScrolling WebKit2 API test
+        https://bugs.webkit.org/show_bug.cgi?id=65431
+
+        Reviewed by Sam Weinig.
+
+        Add a way to do platform-specific bundle initialization, and use it to disable smooth
+        scrolling. Also make it possible for a test to load the injected bundle without actually running
+        a test from it.
+
+        * TestWebKitAPI/InjectedBundleController.cpp:
+        (TestWebKitAPI::InjectedBundleController::initialize):
+        * TestWebKitAPI/InjectedBundleController.h:
+        * TestWebKitAPI/PlatformUtilities.cpp:
+        (TestWebKitAPI::Util::createContextWithInjectedBundle):
+        * TestWebKitAPI/PlatformUtilities.h:
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/mac/InjectedBundleControllerMac.mm: Added.
+        (TestWebKitAPI::InjectedBundleController::platformInitialize):
+        * TestWebKitAPI/win/InjectedBundleControllerWin.cpp: Added.
+        (TestWebKitAPI::InjectedBundleController::platformInitialize):
+        * TestWebKitAPI/win/TestWebKitAPI.vcproj:
+
 2011-07-31  Dimitri Glazkov  <[email protected]>
 
         Use set comparison to find duplicate or overlapping specifiers in test expectations.

Modified: trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp	2011-08-01 03:32:07 UTC (rev 92095)
@@ -47,8 +47,13 @@
 
 void InjectedBundleController::initialize(WKBundleRef bundle, WKTypeRef initializationUserData)
 {
+    platformInitialize();
+
     m_bundle = bundle;
 
+    if (!initializationUserData)
+        return;
+
     WKBundleClient client = {
         0,
         this,
@@ -65,8 +70,8 @@
     WKDictionaryRef initializationDictionary = static_cast<WKDictionaryRef>(initializationUserData);
 
     WKStringRef testName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initializationDictionary, WKStringCreateWithUTF8CString("TestName")));
+
     WKTypeRef userData = WKDictionaryGetItemForKey(initializationDictionary, WKStringCreateWithUTF8CString("UserData"));
-    
     initializeTestNamed(bundle, Util::toSTD(testName), userData);
 }
 

Modified: trunk/Tools/TestWebKitAPI/InjectedBundleController.h (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/InjectedBundleController.h	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/InjectedBundleController.h	2011-08-01 03:32:07 UTC (rev 92095)
@@ -52,6 +52,8 @@
     InjectedBundleController();
     ~InjectedBundleController();
 
+    void platformInitialize();
+
     static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
     static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
     static void didInitializePageGroup(WKBundleRef, WKBundlePageGroupRef, const void* clientInfo);

Modified: trunk/Tools/TestWebKitAPI/PlatformUtilities.cpp (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/PlatformUtilities.cpp	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/PlatformUtilities.cpp	2011-08-01 03:32:07 UTC (rev 92095)
@@ -31,6 +31,14 @@
 namespace TestWebKitAPI {
 namespace Util {
 
+WKContextRef createContextWithInjectedBundle()
+{
+    WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath());
+    WKContextRef context = WKContextCreateWithInjectedBundlePath(injectedBundlePath.get());
+
+    return context;
+}
+
 WKContextRef createContextForInjectedBundleTest(const std::string& testName, WKTypeRef userData)
 {
     WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath());

Modified: trunk/Tools/TestWebKitAPI/PlatformUtilities.h (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/PlatformUtilities.h	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/PlatformUtilities.h	2011-08-01 03:32:07 UTC (rev 92095)
@@ -44,6 +44,7 @@
 
 void sleep(double seconds);
 
+WKContextRef createContextWithInjectedBundle();
 WKContextRef createContextForInjectedBundleTest(const std::string&, WKTypeRef userData = 0);
 
 WKStringRef createInjectedBundlePath();

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2011-08-01 03:32:07 UTC (rev 92095)
@@ -12,6 +12,7 @@
 		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 */; };
+		1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */; };
 		333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
 		33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */; };
 		33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
@@ -113,6 +114,7 @@
 		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>"; };
+		1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundleControllerMac.mm; sourceTree = "<group>"; };
 		333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
 		33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = "<group>"; };
 		33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = "<group>"; };
@@ -347,6 +349,7 @@
 		BCA61C3A11700B9400460D1E /* mac */ = {
 			isa = PBXGroup;
 			children = (
+				1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */,
 				BC131A9A1171316900B69727 /* main.mm */,
 				BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */,
 				BC90955C125548AA00083756 /* PlatformWebViewMac.mm */,
@@ -492,6 +495,7 @@
 				C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */,
 				BC246D9C132F1FF000B56D7C /* CanHandleRequest_Bundle.cpp in Sources */,
 				33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */,
+				1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp	2011-08-01 03:32:07 UTC (rev 92095)
@@ -48,7 +48,7 @@
 
 TEST(WebKit2, SpacebarScrolling)
 {
-    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+    WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     PlatformWebView webView(context.get());
 
     WKPageLoaderClient loaderClient;

Modified: trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj (92094 => 92095)


--- trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj	2011-08-01 02:53:55 UTC (rev 92094)
+++ trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj	2011-08-01 03:32:07 UTC (rev 92095)
@@ -401,6 +401,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\InjectedBundleControllerWin.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\WindowMessageObserver.h"
 				>
 			</File>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to