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

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 13:45:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2bebeabc5c28d19578ff66f8d60f7547e5a4fcc9
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 23:33:39 2010 +0000

    2010-09-24  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Gustavo Noronha Silva.
    
            [GTK] opening local files on win32
            https://bugs.webkit.org/show_bug.cgi?id=31066
    
            This is tested by changes to the testmimehandling API test.
    
            * platform/network/soup/ResourceHandleSoup.cpp: Properly convert the GContentType
            of a file into a mime type. This is important for non-Unix platforms.
    2010-09-24  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Gustavo Noronha Silva.
    
            [GTK] opening local files on win32
            https://bugs.webkit.org/show_bug.cgi?id=31066
    
            Add tests that check the mime type returned by local files loaded via file URLs.
    
            * tests/testmimehandling.c:
            (testRemoteMimeType): Added.
            (testLocalMimeType): Added.
            (main): Run tests by using g_test_add_data_func with either
            testRemoteMimeType or testLocalMimeType.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ac5e3cf..2f0f3f1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-24  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] opening local files on win32
+        https://bugs.webkit.org/show_bug.cgi?id=31066
+
+        This is tested by changes to the testmimehandling API test.
+
+        * platform/network/soup/ResourceHandleSoup.cpp: Properly convert the GContentType
+        of a file into a mime type. This is important for non-Unix platforms.
+
 2010-09-24  Pawel Hajdan  <phajdan.jr at chromium.org>
 
         Reviewed by Dumitru Daniliuc.
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 0009e36..0d84388 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -866,7 +866,10 @@ static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
         return;
     }
 
-    response.setMimeType(g_file_info_get_content_type(info));
+    // According to http://library.gnome.org/devel/gio/stable/gio-GContentType.html
+    // GContentType on Unix is the mime type, but not on Win32.
+    GOwnPtr<gchar> mimeType(g_content_type_get_mime_type(g_file_info_get_content_type(info)));
+    response.setMimeType(mimeType.get());
     response.setExpectedContentLength(g_file_info_get_size(info));
 
     GTimeVal tv;
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 24203ef..1a46f23 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-24  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] opening local files on win32
+        https://bugs.webkit.org/show_bug.cgi?id=31066
+
+        Add tests that check the mime type returned by local files loaded via file URLs.
+
+        * tests/testmimehandling.c:
+        (testRemoteMimeType): Added.
+        (testLocalMimeType): Added.
+        (main): Run tests by using g_test_add_data_func with either 
+        testRemoteMimeType or testLocalMimeType.
+
 2010-09-23  Martin Robinson  <mrobinson at igalia.com>
 
         Reviewed by Nate Chapin.
diff --git a/WebKit/gtk/tests/testmimehandling.c b/WebKit/gtk/tests/testmimehandling.c
index 3a0eded..2d6c623 100644
--- a/WebKit/gtk/tests/testmimehandling.c
+++ b/WebKit/gtk/tests/testmimehandling.c
@@ -134,8 +134,9 @@ static gboolean mime_type_policy_decision_requested_cb(WebKitWebView* view, WebK
     return FALSE;
 }
 
-static void test_mime_type(const char* name)
+static void testRemoteMimeType(const void* data)
 {
+    const char* name = (const char*) data;
     WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
     g_object_ref_sink(G_OBJECT(view));
 
@@ -155,24 +156,31 @@ static void test_mime_type(const char* name)
     g_object_unref(view);
 }
 
-static void test_mime_pdf()
+static void testLocalMimeType(const void* data)
 {
-    test_mime_type("pdf");
-}
+     const char* typeName = (const char*) data;
+     WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+     g_object_ref_sink(G_OBJECT(view));
 
-static void test_mime_html()
-{
-    test_mime_type("html");
-}
+     loop = g_main_loop_new(NULL, TRUE);
 
-static void test_mime_text()
-{
-    test_mime_type("text");
-}
+     g_object_connect(G_OBJECT(view),
+                      "signal::notify::load-status", idle_quit_loop_cb, NULL,
+                      "signal::mime-type-policy-decision-requested", mime_type_policy_decision_requested_cb, g_strdup(typeName),
+                      NULL);
 
-static void test_mime_ogg()
-{
-    test_mime_type("ogg");
+     gchar* filename = g_strdup_printf("test.%s", typeName);
+     GFile* file = g_file_new_for_path(filename);
+     g_free(filename);
+
+     gchar* fileURI = g_file_get_uri(file);
+     g_object_unref(file);
+
+     webkit_web_view_load_uri(view, fileURI);
+     g_free(fileURI);
+ 
+     g_main_loop_run(loop);
+     g_object_unref(view);
 }
 
 int main(int argc, char** argv)
@@ -198,10 +206,14 @@ int main(int argc, char** argv)
     soup_uri_free(soup_uri);
 
     g_test_bug_base("https://bugs.webkit.org/");
-    g_test_add_func("/webkit/mime/PDF", test_mime_pdf);
-    g_test_add_func("/webkit/mime/HTML", test_mime_html);
-    g_test_add_func("/webkit/mime/TEXT", test_mime_text);
-    g_test_add_func("/webkit/mime/OGG", test_mime_ogg);
+    g_test_add_data_func("/webkit/mime/remote-PDF", "pdf", testRemoteMimeType);
+    g_test_add_data_func("/webkit/mime/remote-HTML", "html", testRemoteMimeType);
+    g_test_add_data_func("/webkit/mime/remote-TEXT", "text", testRemoteMimeType);
+    g_test_add_data_func("/webkit/mime/remote-OGG", "ogg", testRemoteMimeType);
+    g_test_add_data_func("/webkit/mime/local-PDF", "pdf", testLocalMimeType);
+    g_test_add_data_func("/webkit/mime/local-HTML", "html", testLocalMimeType);
+    g_test_add_data_func("/webkit/mime/local-TEXT", "text", testLocalMimeType);
+    g_test_add_data_func("/webkit/mime/local-OGG", "ogg", testLocalMimeType);
 
     return g_test_run();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list