[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 11:40:54 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5e6fb6427f4c0263163c5cfba48625202efdb99f
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 3 19:11:00 2010 +0000

    Rollout r64566. It broke all the WebKit2 tests.
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::operator<<):
    (WTR::InjectedBundlePage::shouldInsertNode):
    * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
    * WebKitTestRunner/StringFunctions.h: Removed.
    * WebKitTestRunner/TestInvocation.cpp:
    (WTR::createWKURL):
    (WTR::WKStringToUTF8):
    (WTR::TestInvocation::resetPreferencesToConsistentValues):
    (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
    * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64574 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ccf4785..5e18f1b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,21 @@
 2010-08-03  Sam Weinig  <sam at webkit.org>
 
+        Rollout r64566. It broke all the WebKit2 tests.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::operator<<):
+        (WTR::InjectedBundlePage::shouldInsertNode):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        * WebKitTestRunner/StringFunctions.h: Removed.
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::createWKURL):
+        (WTR::WKStringToUTF8):
+        (WTR::TestInvocation::resetPreferencesToConsistentValues):
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-08-03  Sam Weinig  <sam at webkit.org>
+
         Reviewed by Anders Carlsson.
 
         WTR: Move all the utility functions for working with strings to a shared header.
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index fe6488d..406787e 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -26,7 +26,6 @@
 #include "InjectedBundlePage.h"
 
 #include "InjectedBundle.h"
-#include "StringFunctions.h"
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <WebKit2/WKArray.h>
 #include <WebKit2/WKBundleFrame.h>
@@ -35,11 +34,45 @@
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <WebKit2/WKRetainPtr.h>
 #include <WebKit2/WKBundleRange.h>
+#include <WebKit2/WKString.h>
+#include <WebKit2/WKStringCF.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
 
 using namespace std;
 
 namespace WTR {
 
+static ostream& operator<<(ostream& out, CFStringRef stringRef)
+{
+    if (!stringRef)
+        return out;
+    CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef), kCFStringEncodingUTF8) + 1;
+    Vector<char> buffer(bufferLength);
+    if (!CFStringGetCString(stringRef, buffer.data(), bufferLength, kCFStringEncodingUTF8))
+        return out;
+    return out << buffer.data();
+}
+
+static ostream& operator<<(ostream& out, const RetainPtr<CFStringRef>& stringRef)
+{
+    return out << stringRef.get();
+}
+
+static ostream& operator<<(ostream& out, WKStringRef stringRef)
+{
+    if (!stringRef)
+        return out;
+    RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, stringRef));
+    return out << cfString;
+}
+
+static ostream& operator<<(ostream& out, const WKRetainPtr<WKStringRef>& stringRef)
+{
+    return out << stringRef.get();
+}
+
 static string dumpPath(WKBundleNodeRef node)
 {
     if (!node)
@@ -459,7 +492,7 @@ bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range)
 
 bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
 {
-    static const char* insertactionstring[] = {
+    static const char *insertactionstring[] = {
         "WebViewInsertActionTyped",
         "WebViewInsertActionPasted",
         "WebViewInsertActionDropped",
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index 490640c..8fda21e 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -28,11 +28,12 @@
 #include "InjectedBundle.h"
 #include "InjectedBundlePage.h"
 #include "JSLayoutTestController.h"
-#include "StringFunctions.h"
+#include <JavaScriptCore/JSRetainPtr.h>
 #include <WebKit2/WKBundleFrame.h>
 #include <WebKit2/WKBundleFramePrivate.h>
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKStringCF.h>
 #include <WebKit2/WebKit2.h>
 
 namespace WTR {
@@ -41,6 +42,31 @@ namespace WTR {
 // Eventually it should be changed to match.
 static const CFTimeInterval waitToDumpWatchdogInterval = 6.0;
 
+static RetainPtr<CFStringRef> toCF(JSStringRef string)
+{
+    return RetainPtr<CFStringRef>(AdoptCF, JSStringCopyCFString(0, string));
+}
+
+static RetainPtr<CFStringRef> toCF(WKStringRef string)
+{
+    return RetainPtr<CFStringRef>(AdoptCF, WKStringCopyCFString(0, string));
+}
+
+static WKRetainPtr<WKStringRef> toWK(JSStringRef string)
+{
+    return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(toCF(string).get()));
+}
+
+static JSRetainPtr<JSStringRef> toJS(WKStringRef string)
+{
+    return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithCFString(toCF(string).get()));
+}
+
+static JSRetainPtr<JSStringRef> toJS(const WKRetainPtr<WKStringRef>& string)
+{
+    return toJS(string.get());
+}
+
 static void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
 {
     JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
diff --git a/WebKitTools/WebKitTestRunner/StringFunctions.h b/WebKitTools/WebKitTestRunner/StringFunctions.h
deleted file mode 100644
index 2023d5a..0000000
--- a/WebKitTools/WebKitTestRunner/StringFunctions.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2010 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 StringFunctions_h
-#define StringFunctions_h
-
-#include <JavaScriptCore/JSRetainPtr.h>
-#include <JavaScriptCore/JavaScriptCore.h>
-#include <WebKit2/WKRetainPtr.h>
-#include <WebKit2/WKString.h>
-#include <WebKit2/WKStringCF.h>
-#include <WebKit2/WKURL.h>
-#include <WebKit2/WKURLCF.h>
-#include <sstream>
-#include <wtf/Platform.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/Vector.h>
-
-namespace WTR {
-
-// Conversion functions
-
-inline RetainPtr<CFStringRef> toCF(JSStringRef string)
-{
-    return RetainPtr<CFStringRef>(AdoptCF, JSStringCopyCFString(0, string));
-}
-
-inline RetainPtr<CFStringRef> toCF(WKStringRef string)
-{
-    return RetainPtr<CFStringRef>(AdoptCF, WKStringCopyCFString(0, string));
-}
-
-inline WKRetainPtr<WKStringRef> toWK(JSStringRef string)
-{
-    return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(toCF(string).get()));
-}
-
-inline WKRetainPtr<WKStringRef> toWK(JSRetainPtr<JSStringRef> string)
-{
-    return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(toCF(string.get()).get()));
-}
-
-inline JSRetainPtr<JSStringRef> toJS(WKStringRef string)
-{
-    return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithCFString(toCF(string).get()));
-}
-
-inline JSRetainPtr<JSStringRef> toJS(const WKRetainPtr<WKStringRef>& string)
-{
-    return toJS(string.get());
-}
-
-// Streaming functions
-
-inline std::ostream& operator<<(std::ostream& out, CFStringRef stringRef)
-{
-    if (!stringRef)
-        return out;
-    CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef), kCFStringEncodingUTF8) + 1;
-    Vector<char> buffer(bufferLength);
-    if (!CFStringGetCString(stringRef, buffer.data(), bufferLength, kCFStringEncodingUTF8))
-        return out;
-    return out << buffer.data();
-}
-
-inline std::ostream& operator<<(std::ostream& out, WKStringRef stringRef)
-{
-    if (!stringRef)
-        return out;
-    return out << toCF(stringRef).get();
-}
-
-inline std::ostream& operator<<(std::ostream& out, const RetainPtr<CFStringRef>& stringRef)
-{
-    return out << stringRef.get();
-}
-
-// URL creation
-
-inline WKURLRef createWKURL(const char* pathOrURL)
-{
-    RetainPtr<CFStringRef> pathOrURLCFString(AdoptCF, CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingUTF8));
-    RetainPtr<CFURLRef> cfURL;
-    if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://")))
-        cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0));
-    else
-#if PLATFORM(WIN)
-        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLWindowsPathStyle, false));
-#else
-        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false));
-#endif
-    return WKURLCreateWithCFURL(cfURL.get());
-}
-
-
-} // namespace WTR
-
-#endif // StringFunctions_h
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index e65ca8d..658911b 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -26,17 +26,47 @@
 #include "TestInvocation.h"
 
 #include "PlatformWebView.h"
-#include "StringFunctions.h"
 #include "TestController.h"
 #include <WebKit2/WKContextPrivate.h>
 #include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKStringCF.h>
+#include <WebKit2/WKURLCF.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
 
 using namespace WebKit;
-using namespace std;
 
 namespace WTR {
 
+static WKURLRef createWKURL(const char* pathOrURL)
+{
+    RetainPtr<CFStringRef> pathOrURLCFString(AdoptCF, CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingUTF8));
+    RetainPtr<CFURLRef> cfURL;
+    if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://")))
+        cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0));
+    else
+#if defined(WIN32) || defined(_WIN32)
+        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLWindowsPathStyle, false));
+#else
+        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false));
+#endif
+    return WKURLCreateWithCFURL(cfURL.get());
+}
+
+static PassOwnPtr<Vector<char> > WKStringToUTF8(WKStringRef wkStringRef)
+{
+    RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, wkStringRef));
+    CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfString.get()), kCFStringEncodingUTF8) + 1;
+    OwnPtr<Vector<char> > buffer(new Vector<char>(bufferLength));
+    if (!CFStringGetCString(cfString.get(), buffer->data(), bufferLength, kCFStringEncodingUTF8)) {
+        buffer->shrink(1);
+        (*buffer)[0] = 0;
+    } else
+        buffer->shrink(strlen(buffer->data()) + 1);
+    return buffer.release();
+}
+
 TestInvocation::TestInvocation(const char* pathOrURL)
     : m_url(AdoptWK, createWKURL(pathOrURL))
     , m_pathOrURL(fastStrDup(pathOrURL))
@@ -69,6 +99,7 @@ static void sizeWebViewForCurrentTest(char* pathOrURL)
 void TestInvocation::resetPreferencesToConsistentValues()
 {
     WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context());
+    
     WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
 }
 
@@ -134,11 +165,8 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
 
     if (CFEqual(cfMessageName.get(), CFSTR("Done"))) {
         ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
-        ostringstream out;
-        out << static_cast<WKStringRef>(messageBody);
-
-        dump(out.str().c_str());
-
+        OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(static_cast<WKStringRef>(messageBody));
+        dump(utf8Message->data());
         m_gotFinalMessage = true;
         return;
     }
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 145729d..eccf330 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -109,7 +109,6 @@
 		BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; };
 		BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSLayoutTestController.cpp; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
 		BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSLayoutTestController.h; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.h; sourceTree = BUILT_PRODUCTS_DIR; };
-		BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; };
 		BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; };
 		BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; };
 		BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; };
@@ -150,8 +149,7 @@
 			isa = PBXGroup;
 			children = (
 				BC952EC511F3C10F003398B4 /* DerivedSources.make */,
-				BC99CBF11207642D00FDEE76 /* Shared */,
-				08FB7795FE84155DC02AAC07 /* TestRunner */,
+				08FB7795FE84155DC02AAC07 /* Source */,
 				BC25183511D1571D002EBC01 /* InjectedBundle */,
 				BC793401118F7C8A005EA8E2 /* Configurations */,
 				08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
@@ -161,7 +159,7 @@
 			name = WebKitTestRunner;
 			sourceTree = "<group>";
 		};
-		08FB7795FE84155DC02AAC07 /* TestRunner */ = {
+		08FB7795FE84155DC02AAC07 /* Source */ = {
 			isa = PBXGroup;
 			children = (
 				BC7933FE118F7C74005EA8E2 /* mac */,
@@ -172,7 +170,7 @@
 				BCD7D2F611921278006DB7EE /* TestInvocation.h */,
 				BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
 			);
-			name = TestRunner;
+			name = Source;
 			sourceTree = "<group>";
 		};
 		08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
@@ -282,14 +280,6 @@
 			name = "Derived Sources";
 			sourceTree = "<group>";
 		};
-		BC99CBF11207642D00FDEE76 /* Shared */ = {
-			isa = PBXGroup;
-			children = (
-				BC99A4841208901A007E9F08 /* StringFunctions.h */,
-			);
-			name = Shared;
-			sourceTree = "<group>";
-		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list