Diff
Modified: trunk/Source/WebCore/ChangeLog (104670 => 104671)
--- trunk/Source/WebCore/ChangeLog 2012-01-11 06:07:37 UTC (rev 104670)
+++ trunk/Source/WebCore/ChangeLog 2012-01-11 06:07:52 UTC (rev 104671)
@@ -1,3 +1,13 @@
+2012-01-10 David Kilzer <[email protected]>
+
+ Add TestWebKitAPI tests for KURL
+ <http://webkit.org/b/75774>
+
+ Reviewed by Adam Barth.
+
+ * WebCore.exp.in: Export additional KURL methods used in
+ testing.
+
2012-01-10 Jer Noble <[email protected]>
Crash in HTMLMediaElement::shouldDisableSleep()
Modified: trunk/Source/WebCore/WebCore.exp.in (104670 => 104671)
--- trunk/Source/WebCore/WebCore.exp.in 2012-01-11 06:07:37 UTC (rev 104670)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-01-11 06:07:52 UTC (rev 104671)
@@ -1325,8 +1325,14 @@
__ZNK7WebCore4KURL12baseAsStringEv
__ZNK7WebCore4KURL14fileSystemPathEv
__ZNK7WebCore4KURL17lastPathComponentEv
+__ZNK7WebCore4KURL18fragmentIdentifierEv
+__ZNK7WebCore4KURL21hasFragmentIdentifierEv
__ZNK7WebCore4KURL4hostEv
+__ZNK7WebCore4KURL4passEv
__ZNK7WebCore4KURL4pathEv
+__ZNK7WebCore4KURL4portEv
+__ZNK7WebCore4KURL4userEv
+__ZNK7WebCore4KURL5queryEv
__ZNK7WebCore4KURL8protocolEv
__ZNK7WebCore4KURLcvP5NSURLEv
__ZNK7WebCore4Node14isDescendantOfEPKS0_
Modified: trunk/Tools/ChangeLog (104670 => 104671)
--- trunk/Tools/ChangeLog 2012-01-11 06:07:37 UTC (rev 104670)
+++ trunk/Tools/ChangeLog 2012-01-11 06:07:52 UTC (rev 104671)
@@ -1,5 +1,20 @@
2012-01-10 David Kilzer <[email protected]>
+ Add TestWebKitAPI tests for KURL
+ <http://webkit.org/b/75774>
+
+ Reviewed by Adam Barth.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add a
+ WebCore folder and KURL.cpp source file to the project.
+ * TestWebKitAPI/Tests/WebCore/KURL.cpp: Added.
+ (TestWebKitAPI::WebCore::SetUp): Initialize the main thread
+ during setup since this test doesn't go through WebKit or
+ WebKit2.
+ (TestWebKitAPI::TEST_F): Add two basic tests.
+
+2012-01-10 David Kilzer <[email protected]>
+
Extract common code for comparing WTF::String objects into WTFStringUtilities.h
Reviewed by Adam Barth.
Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (104670 => 104671)
--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2012-01-11 06:07:37 UTC (rev 104670)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2012-01-11 06:07:52 UTC (rev 104671)
@@ -32,6 +32,7 @@
37A6895F148A9B50005100FA /* SubresourceErrorCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */; };
37DC678D140D7C5000ABCCDB /* DOMRangeOfString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */; };
37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
+ 440A1D3914A0103A008A66F2 /* KURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 440A1D3814A0103A008A66F2 /* KURL.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 */; };
520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */; };
@@ -181,6 +182,7 @@
37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = "<group>"; };
37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRangeOfString.mm; sourceTree = "<group>"; };
37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DOMRangeOfString.html; sourceTree = "<group>"; };
+ 440A1D3814A0103A008A66F2 /* KURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KURL.cpp; sourceTree = "<group>"; };
44A622C114A0E2B60048515B /* WTFStringUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFStringUtilities.h; 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>"; };
@@ -355,6 +357,14 @@
name = Products;
sourceTree = "<group>";
};
+ 440A1D3614A01000008A66F2 /* WebCore */ = {
+ isa = PBXGroup;
+ children = (
+ 440A1D3814A0103A008A66F2 /* KURL.cpp */,
+ );
+ path = WebCore;
+ sourceTree = "<group>";
+ };
BC029B1A1486B23800817DA9 /* ns */ = {
isa = PBXGroup;
children = (
@@ -504,6 +514,7 @@
children = (
C08587F913FEC39B001EF4E5 /* TestWebKitAPI */,
C07E6CAD13FD67650038B22B /* mac */,
+ 440A1D3614A01000008A66F2 /* WebCore */,
BC9096411255616000083756 /* WebKit2 */,
BC3C4C6F14575B1D0025FB62 /* WebKit2 Objective-C */,
BC9096461255618900083756 /* WTF */,
@@ -713,6 +724,7 @@
1AA9E55914980A9900001A8A /* Functional.cpp in Sources */,
BCAA485814A044D40088FAC4 /* EditorCommands.mm in Sources */,
BC55F5F914AD78EE00484BE1 /* Vector.cpp in Sources */,
+ 440A1D3914A0103A008A66F2 /* KURL.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp (0 => 104671)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp 2012-01-11 06:07:52 UTC (rev 104671)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2011, 2012 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 "WTFStringUtilities.h"
+#include <WebCore/KURL.h>
+#include <wtf/MainThread.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+class WebCore: public testing::Test {
+public:
+ virtual void SetUp()
+ {
+ WTF::initializeMainThread();
+ }
+};
+
+TEST_F(WebCore, KURLConstructorDefault)
+{
+ KURL kurl;
+
+ EXPECT_FALSE(kurl.hasPath());
+ EXPECT_TRUE(kurl.isEmpty());
+ EXPECT_TRUE(kurl.isNull());
+ EXPECT_FALSE(kurl.isValid());
+}
+
+TEST_F(WebCore, KURLConstructorConstChar)
+{
+ KURL kurl(ParsedURLString, "http://username:[email protected]:8080/index.html?var=val#fragment");
+
+ EXPECT_TRUE(kurl.hasPath());
+ EXPECT_FALSE(kurl.isEmpty());
+ EXPECT_FALSE(kurl.isNull());
+ EXPECT_TRUE(kurl.isValid());
+
+ EXPECT_EQ(String("http"), kurl.protocol());
+ EXPECT_EQ(String("www.example.com"), kurl.host());
+ EXPECT_TRUE(kurl.hasPort());
+ EXPECT_EQ(8080, kurl.port());
+ EXPECT_EQ(String("username"), kurl.user());
+ EXPECT_EQ(String("password"), kurl.pass());
+ EXPECT_EQ(String("/index.html"), kurl.path());
+ EXPECT_EQ(String("index.html"), kurl.lastPathComponent());
+ EXPECT_EQ(String("var=val"), kurl.query());
+ EXPECT_TRUE(kurl.hasFragmentIdentifier());
+ EXPECT_EQ(String("fragment"), kurl.fragmentIdentifier());
+}
+
+} // namespace TestWebKitAPI