Title: [160965] trunk/Source/WebKit2
Revision
160965
Author
[email protected]
Date
2013-12-21 06:40:53 -0800 (Sat, 21 Dec 2013)

Log Message

[GTK] Test /webkit2/WebKitWebResource/mime-type fails when run after /webkit2/WebKitWebView/resources
https://bugs.webkit.org/show_bug.cgi?id=126119

Reviewed by Martin Robinson.

The problem is that when the blank.ico resource is loaded from the
disk cache, the mime type is null, because the soup cache doesn't
cache sniffed mime types. This doesn't happen when a resource is
loaded form the memory cache, because the ResourceResponse is
cached, not only the headers. I think the disk cache should also
cache the sniffed content type, but that needs to be done in
soup. For now we can workaround the issue in the unit test by
making sure that resources that can be cached, also include the
Content-Type header, this way the mime type won't be sniffed and
it will be cached as a HTTP header in the disk cache.

* UIProcess/API/gtk/tests/TestResources.cpp:
(serverCallback): Add Content-Type header for resources that can
be cached.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (160964 => 160965)


--- trunk/Source/WebKit2/ChangeLog	2013-12-21 14:36:54 UTC (rev 160964)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-21 14:40:53 UTC (rev 160965)
@@ -1,5 +1,27 @@
 2013-12-21  Carlos Garcia Campos  <[email protected]>
 
+        [GTK] Test /webkit2/WebKitWebResource/mime-type fails when run after /webkit2/WebKitWebView/resources
+        https://bugs.webkit.org/show_bug.cgi?id=126119
+
+        Reviewed by Martin Robinson.
+
+        The problem is that when the blank.ico resource is loaded from the
+        disk cache, the mime type is null, because the soup cache doesn't
+        cache sniffed mime types. This doesn't happen when a resource is
+        loaded form the memory cache, because the ResourceResponse is
+        cached, not only the headers. I think the disk cache should also
+        cache the sniffed content type, but that needs to be done in
+        soup. For now we can workaround the issue in the unit test by
+        making sure that resources that can be cached, also include the
+        Content-Type header, this way the mime type won't be sniffed and
+        it will be cached as a HTTP header in the disk cache.
+
+        * UIProcess/API/gtk/tests/TestResources.cpp:
+        (serverCallback): Add Content-Type header for resources that can
+        be cached.
+
+2013-12-21  Carlos Garcia Campos  <[email protected]>
+
         REGRESSION(r160909): [GTK] Tests /webkit2/WebKitWebView/default-menu and /webkit2/WebKitSettings/webkit-settings fail
         https://bugs.webkit.org/show_bug.cgi?id=126117
 

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp (160964 => 160965)


--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp	2013-12-21 14:36:54 UTC (rev 160964)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp	2013-12-21 14:40:53 UTC (rev 160965)
@@ -677,6 +677,7 @@
     } else if (g_str_equal(path, "/style.css")) {
         soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, kStyleCSS, strlen(kStyleCSS));
         addCacheHTTPHeadersToResponse(message);
+        soup_message_headers_append(message->response_headers, "Content-Type", "text/css");
     } else if (g_str_equal(path, "/_javascript_.js")) {
         soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, kJavascript, strlen(kJavascript));
         soup_message_headers_append(message->response_headers, "Content-Type", "text/_javascript_");
@@ -694,6 +695,7 @@
         g_file_get_contents(filePath.get(), &contents, &contentsLength, 0);
         soup_message_body_append(message->response_body, SOUP_MEMORY_TAKE, contents, contentsLength);
         addCacheHTTPHeadersToResponse(message);
+        soup_message_headers_append(message->response_headers, "Content-Type", "image/vnd.microsoft.icon");
     } else if (g_str_equal(path, "/simple-style.css")) {
         static const char* simpleCSS =
             "body {"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to