[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at chromium.org darin at chromium.org
Thu Apr 8 01:02:17 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f69a842c88b5866de333e9e6360e7b7094eaed3b
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 12 18:10:22 2010 +0000

    2010-01-11  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            [Chromium] Re-work webkit_unit_tests so that WebKit is initialized only once
            https://bugs.webkit.org/show_bug.cgi?id=33504
    
            * WebKit.gyp:
            * tests/KURLTest.cpp:
            (ComponentCase::TEST):
            * tests/RunAllTests.cpp: Added.
            (main):
            * tests/WebKitTest.h: Removed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 6200b04..0bddb81 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-11  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [Chromium] Re-work webkit_unit_tests so that WebKit is initialized only once
+        https://bugs.webkit.org/show_bug.cgi?id=33504
+
+        * WebKit.gyp:
+        * tests/KURLTest.cpp:
+        (ComponentCase::TEST):
+        * tests/RunAllTests.cpp: Added.
+        (main):
+        * tests/WebKitTest.h: Removed.
+
 2010-01-09  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 3eb7bdd..f649846 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -417,8 +417,7 @@
             ],
             'sources': [
                 'tests/KURLTest.cpp',
-                'tests/WebKitTest.h',
-                '<(chromium_src_dir)/base/test/run_all_unittests.cc',
+                'tests/RunAllTests.cpp',
             ],
         },
     ], # targets
diff --git a/WebKit/chromium/tests/KURLTest.cpp b/WebKit/chromium/tests/KURLTest.cpp
index cb90c2b..b316683 100644
--- a/WebKit/chromium/tests/KURLTest.cpp
+++ b/WebKit/chromium/tests/KURLTest.cpp
@@ -33,8 +33,9 @@
 
 #include "config.h"
 
+#include <gtest/gtest.h>
+
 #include "KURL.h"
-#include "WebKitTest.h"
 
 namespace {
 
@@ -57,11 +58,8 @@ struct ComponentCase {
     const char* ref;
 };
 
-class KURLTest : public WebKitTest {
-};
-
 // Test the cases where we should be the same as WebKit's old KURL.
-TEST_F(KURLTest, SameGetters)
+TEST(KURLTest, SameGetters)
 {
     struct GetterCase {
         const char* url;
@@ -114,7 +112,7 @@ TEST_F(KURLTest, SameGetters)
 
 // Test a few cases where we're different just to make sure we give reasonable
 // output.
-TEST_F(KURLTest, DifferentGetters)
+TEST(KURLTest, DifferentGetters)
 {
     ComponentCase cases[] = {
         // url                                    protocol      host        port  user  pass    path                lastPath  query      ref
@@ -154,7 +152,7 @@ TEST_F(KURLTest, DifferentGetters)
 
 // Ensures that both ASCII and UTF-8 canonical URLs are handled properly and we
 // get the correct string object out.
-TEST_F(KURLTest, UTF8)
+TEST(KURLTest, UTF8)
 {
     const char asciiURL[] = "http://foo/bar#baz";
     WebCore::KURL asciiKURL(WebCore::ParsedURLString, asciiURL);
@@ -177,7 +175,7 @@ TEST_F(KURLTest, UTF8)
     EXPECT_TRUE(utf8KURL.string() == WebCore::String::fromUTF8(utf8URL));
 }
 
-TEST_F(KURLTest, Setters)
+TEST(KURLTest, Setters)
 {
     // Replace the starting URL with the given components one at a time and
     // verify that we're always the same as the old KURL.
@@ -263,7 +261,7 @@ TEST_F(KURLTest, Setters)
 
 // Tests that KURL::decodeURLEscapeSequences works as expected
 #if USE(GOOGLEURL)
-TEST_F(KURLTest, Decode)
+TEST(KURLTest, Decode)
 {
     struct DecodeCase {
         const char* input;
@@ -303,7 +301,7 @@ TEST_F(KURLTest, Decode)
 }
 #endif
 
-TEST_F(KURLTest, Encode)
+TEST(KURLTest, Encode)
 {
     // Also test that it gets converted to UTF-8 properly.
     char16 wideInputHelper[3] = { 0x4f60, 0x597d, 0 };
@@ -324,7 +322,7 @@ TEST_F(KURLTest, Encode)
     EXPECT_EQ(reference, output);
 }
 
-TEST_F(KURLTest, ResolveEmpty)
+TEST(KURLTest, ResolveEmpty)
 {
     WebCore::KURL emptyBase;
 
@@ -343,7 +341,7 @@ TEST_F(KURLTest, ResolveEmpty)
 
 // WebKit will make empty URLs and set components on them. kurl doesn't allow
 // replacements on invalid URLs, but here we do.
-TEST_F(KURLTest, ReplaceInvalid)
+TEST(KURLTest, ReplaceInvalid)
 {
     WebCore::KURL kurl;
 
@@ -390,7 +388,7 @@ TEST_F(KURLTest, ReplaceInvalid)
 #endif
 }
 
-TEST_F(KURLTest, Path)
+TEST(KURLTest, Path)
 {
     const char initial[] = "http://www.google.com/path/foo";
     WebCore::KURL kurl(WebCore::ParsedURLString, initial);
@@ -404,7 +402,7 @@ TEST_F(KURLTest, Path)
 
 // Test that setting the query to different things works. Thq query is handled
 // a littler differently than some of the other components.
-TEST_F(KURLTest, Query)
+TEST(KURLTest, Query)
 {
     const char initial[] = "http://www.google.com/search?q=awesome";
     WebCore::KURL kurl(WebCore::ParsedURLString, initial);
@@ -435,7 +433,7 @@ TEST_F(KURLTest, Query)
                  kurl.string().utf8().data());
 }
 
-TEST_F(KURLTest, Ref)
+TEST(KURLTest, Ref)
 {
     WebCore::KURL kurl(WebCore::ParsedURLString, "http://foo/bar#baz");
 
@@ -464,7 +462,7 @@ TEST_F(KURLTest, Ref)
     EXPECT_STREQ("http://foo/bar", cur.string().utf8().data());
 }
 
-TEST_F(KURLTest, Empty)
+TEST(KURLTest, Empty)
 {
     WebCore::KURL kurl;
 
@@ -537,7 +535,7 @@ TEST_F(KURLTest, Empty)
     EXPECT_FALSE(kurl7.string().isNull());
 }
 
-TEST_F(KURLTest, UserPass)
+TEST(KURLTest, UserPass)
 {
     const char* src = "http://user:pass@google.com/";
     WebCore::KURL kurl(WebCore::ParsedURLString, src);
@@ -556,7 +554,7 @@ TEST_F(KURLTest, UserPass)
     EXPECT_EQ("http://google.com/", kurl.string());
 }
 
-TEST_F(KURLTest, Offsets)
+TEST(KURLTest, Offsets)
 {
     const char* src1 = "http://user:pass@google.com/foo/bar.html?baz=query#ref";
     WebCore::KURL kurl1(WebCore::ParsedURLString, src1);
@@ -586,7 +584,7 @@ TEST_F(KURLTest, Offsets)
     EXPECT_EQ(11u, kurl3.pathAfterLastSlash());
 }
 
-TEST_F(KURLTest, DeepCopy)
+TEST(KURLTest, DeepCopy)
 {
     const char url[] = "http://www.google.com/";
     WebCore::KURL src(WebCore::ParsedURLString, url);
@@ -599,7 +597,7 @@ TEST_F(KURLTest, DeepCopy)
     EXPECT_NE(dest.utf8String().data(), src.utf8String().data());
 }
 
-TEST_F(KURLTest, ProtocolIs)
+TEST(KURLTest, ProtocolIs)
 {
     WebCore::KURL url1(WebCore::ParsedURLString, "foo://bar");
     EXPECT_TRUE(url1.protocolIs("foo"));
diff --git a/WebKit/chromium/tests/RunAllTests.cpp b/WebKit/chromium/tests/RunAllTests.cpp
new file mode 100644
index 0000000..0f3f82f
--- /dev/null
+++ b/WebKit/chromium/tests/RunAllTests.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+// FIXME: Avoid this source dependency on Chromium's base module.
+#include <base/test/test_suite.h>
+
+#include "WebKit.h"
+#include "WebKitClient.h"
+
+// WebKitClient has a protected destructor, so we need to subclass.
+class DummyWebKitClient : public WebKit::WebKitClient {
+};
+
+int main(int argc, char** argv)
+{
+    DummyWebKitClient dummyClient;
+    WebKit::initialize(&dummyClient);
+
+    int result = TestSuite(argc, argv).Run();
+
+    WebKit::shutdown();
+    return result;
+}
diff --git a/WebKit/chromium/tests/WebKitTest.h b/WebKit/chromium/tests/WebKitTest.h
deleted file mode 100644
index c9e8eab..0000000
--- a/WebKit/chromium/tests/WebKitTest.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2010 Google 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:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 WebKitTest_h
-#define WebKitTest_h
-
-#include <gtest/gtest.h>
-
-#include "WebKit.h"
-#include "WebKitClient.h"
-
-class WebKitTest : public testing::Test {
-public:
-    virtual void SetUp()
-    {
-        WebKit::initialize(&m_dummyClient);
-    }
-
-    virtual void TearDown()
-    {
-        WebKit::shutdown();
-    }
-
-private:
-    // WebKitClient has a protected destructor, so we need to subclass.
-    class DummyClient : public WebKit::WebKitClient {};
-    DummyClient m_dummyClient;
-};
-
-#endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list