[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:20:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit df0d76516fc2d47330d1cdfe6d985464d3b4dccd
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 19 23:55:00 2010 +0000

    Remove dependency on getopt from WebKitTestRunner.
    
    Reviewed by Jon Honeycutt.
    
    - Simplify options parsing and eliminate unused options.
    
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::TestController):
    (WTR::TestController::initialize):
    * WebKitTestRunner/TestController.h:
    (WTR::TestController::testPluginPath):
    * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
    * WebKitTestRunner/mac/TestControllerMac.mm:
    (WTR::TestController::platformInitialize):
    (WTR::TestController::initializeTestPluginPath):
    * WebKitTestRunner/win/TestControllerWin.cpp:
    (WTR::TestController::platformInitialize):
    (WTR::TestController::initializeTestPluginPath):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63700 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1c1b9a4..5ac7d3a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-19  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Jon Honeycutt.
+
+        Remove dependency on getopt from WebKitTestRunner.
+
+        - Simplify options parsing and eliminate unused options.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::TestController):
+        (WTR::TestController::initialize):
+        * WebKitTestRunner/TestController.h:
+        (WTR::TestController::testPluginPath):
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformInitialize):
+        (WTR::TestController::initializeTestPluginPath):
+        * WebKitTestRunner/win/TestControllerWin.cpp:
+        (WTR::TestController::platformInitialize):
+        (WTR::TestController::initializeTestPluginPath):
+
 2010-07-19  Diego Gonzalez  <diegohcg at webkit.org>
 
         Reviewed by Antonio Gomes.
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 914043d..fec6b56 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -28,7 +28,6 @@
 #include "PlatformWebView.h"
 #include "TestInvocation.h"
 #include <WebKit2/WKContextPrivate.h>
-#include <getopt.h>
 
 namespace WTR {
 
@@ -39,62 +38,44 @@ TestController& TestController::shared()
 }
 
 TestController::TestController()
-    : m_dumpTree(false)
-    , m_dumpPixels(false)
-    , m_threaded(false)
-    , m_forceComplexText(false)    
+    : m_dumpPixels(false)
     , m_verbose(false)
     , m_printSeparators(false)
     , m_usingServerMode(false)
 {
 }
 
-void TestController::initialize(int argc, const char *argv[])
+void TestController::initialize(int argc, const char* argv[])
 {
-    int dumpTree = 0;
-    int dumpPixels = 0;
-    int threaded = 0;
-    int forceComplexText = 0;
-    int useHTML5Parser = 0;
-    int verbose = 0;
-
-    struct option options[] = {
-        {"notree", no_argument, &dumpTree, false},
-        {"pixel-tests", no_argument, &dumpPixels, true},
-        {"tree", no_argument, &dumpTree, true},
-        {"threaded", no_argument, &threaded, true},
-        {"complex-text", no_argument, &forceComplexText, true},
-        {"legacy-parser", no_argument, &useHTML5Parser, false},
-        {"verbose", no_argument, &verbose, true},
-        {0, 0, 0, 0}
-    };
-    
-    int option;
-    while ((option = getopt_long(argc, (char * const *)argv, "", options, 0)) != -1) {
-        switch (option) {
-            case '?':   // unknown or ambiguous option
-            case ':':   // missing argument
-                exit(1);
-                break;
+    platformInitialize();
+
+    for (int i = 1; i < argc; ++i) {
+        std::string argument(argv[i]);
+
+        if (argument == "--pixel-tests") {
+            m_dumpPixels = true;
+            continue;
         }
-    }
+        if (argument == "--verbose") {
+            m_verbose = true;
+            continue;
+        }
+        
+        // Skip any other arguments that begin with '--'.
+        if (argument.length() >= 2 && argument[0] == '-' && argument[1] == '-')
+            continue;
 
-    m_dumpTree = dumpTree;
-    m_dumpPixels = dumpPixels;
-    m_threaded = threaded;
-    m_forceComplexText = forceComplexText;
-    m_verbose = verbose;
+        m_paths.push_back(argument);
+    }
 
-    m_usingServerMode = (argc == optind + 1 && strcmp(argv[optind], "-") == 0);
+    m_usingServerMode = (m_paths.size() == 1 && m_paths[0] == "-");
     if (m_usingServerMode)
         m_printSeparators = true;
-    else {
-        m_printSeparators = (optind < argc - 1 || (m_dumpPixels && m_dumpTree));
-        for (int i = optind; i != argc; ++i)
-            m_paths.push_back(std::string(argv[i]));
-    }
+    else
+        m_printSeparators = m_paths.size() > 1;
 
     initializeInjectedBundlePath();
+    initializeTestPluginPath();
 
     m_context.adopt(WKContextCreateWithInjectedBundlePath(injectedBundlePath()));
 
@@ -105,7 +86,7 @@ void TestController::initialize(int argc, const char *argv[])
     };
     WKContextSetInjectedBundleClient(m_context.get(), &injectedBundlePathClient);
 
-    _WKContextSetAdditionalPluginPath(m_context.get(), testPluginPath().get());
+    _WKContextSetAdditionalPluginPath(m_context.get(), testPluginPath());
     
     m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get()));
     m_mainWebView = new PlatformWebView(m_pageNamespace.get());
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 96bdec9..7e829b6 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -49,6 +49,7 @@ public:
     bool verbose() const { return m_verbose; }
 
     WKStringRef injectedBundlePath() { return m_injectedBundlePath.get(); }
+    WKStringRef testPluginPath() { return m_testPluginPath.get(); }
 
     PlatformWebView* mainWebView() { return m_mainWebView; }
     WKPageNamespaceRef pageNamespace() { return m_pageNamespace.get(); }
@@ -60,9 +61,10 @@ private:
 
     void runTestingServerLoop();
     void runTest(const char* pathOrURL);
-    
+
+    void platformInitialize();
     void initializeInjectedBundlePath();
-    WKRetainPtr<WKStringRef> testPluginPath();
+    void initializeTestPluginPath();
 
     // WKContextInjectedBundleClient
     static void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void*);
@@ -70,15 +72,13 @@ private:
 
     OwnPtr<TestInvocation> m_currentInvocation;
 
-    bool m_dumpTree;
     bool m_dumpPixels;
-    bool m_threaded;
-    bool m_forceComplexText;
     bool m_verbose;
     bool m_printSeparators;
     bool m_usingServerMode;
     std::vector<std::string> m_paths;
     WKRetainPtr<WKStringRef> m_injectedBundlePath;
+    WKRetainPtr<WKStringRef> m_testPluginPath;
 
     PlatformWebView* m_mainWebView;
     WKRetainPtr<WKContextRef> m_context;
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index e13499d..d673149 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -65,7 +65,7 @@
 			isa = PBXContainerItemProxy;
 			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
 			proxyType = 1;
-			remoteGlobalIDString = BC952D7711F3BF5D003398B4 /* Derived Sources */;
+			remoteGlobalIDString = BC952D7711F3BF5D003398B4;
 			remoteInfo = "Derived Sources";
 		};
 /* End PBXContainerItemProxy section */
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index 67cc1f4..ae4cc2f 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -30,15 +30,19 @@
 
 namespace WTR {
 
+void TestController::platformInitialize()
+{
+}
+
 void TestController::initializeInjectedBundlePath()
 {
     NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundle.bundle"];
     m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
 }
 
-WKRetainPtr<WKStringRef> TestController::testPluginPath()
+void TestController::initializeTestPluginPath()
 {
-    return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
+    m_testPluginPath.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
 }
 
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index deb8d42..295be74 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -25,10 +25,17 @@
 
 #include "TestController.h"
 
+#include <io.h>
 #include <WebKit2/WKStringCF.h>
 
 namespace WTR {
 
+void TestController::platformInitialize()
+{
+    _setmode(1, _O_BINARY);
+    _setmode(2, _O_BINARY);
+}
+
 void TestController::initializeInjectedBundlePath()
 {
     CFStringRef exeContainerPath = CFURLCopyFileSystemPath(CFURLCreateCopyDeletingLastPathComponent(0, CFBundleCopyExecutableURL(CFBundleGetMainBundle())), kCFURLWindowsPathStyle);
@@ -42,11 +49,11 @@ void TestController::initializeInjectedBundlePath()
     m_injectedBundlePath.adopt(WKStringCreateWithCFString(bundlePath));
 }
 
-WKRetainPtr<WKStringRef> TestController::testPluginPath()
+void TestController::initializeTestPluginPath()
 {
     CFStringRef exeContainerPath = CFURLCopyFileSystemPath(CFURLCreateCopyDeletingLastPathComponent(0, CFBundleCopyExecutableURL(CFBundleGetMainBundle())), kCFURLWindowsPathStyle);
     CFMutableStringRef bundlePath = CFStringCreateMutableCopy(0, 0, exeContainerPath);
-    return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(bundlePath));
+    m_testPluginPath.adopt(AdoptWK, WKStringCreateWithCFString(bundlePath));
 }
 
 } // namespace WTR

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list