ApplicationCache manifest should work with any MIME type.
authormichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 01:46:17 +0000 (01:46 +0000)
committermichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 01:46:17 +0000 (01:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72082

Source/WebCore:

Reviewed by Alexey Proskuryakov.

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveManifestResponse): Remove the test for a particular type.

LayoutTests:

Update the wrong-content-type test to expect the appcache to succeed given a text/plain contentType.

Reviewed by Alexey Proskuryakov.

* http/tests/appcache/wrong-content-type-expected.txt:
* http/tests/appcache/wrong-content-type.html:
* platform/chromium/test_expectations.txt: Temporarily skip this test in chromium.
* platform/chromium-cg-mac/http/tests/appcache/wrong-content-type-expected.txt: Removed.
* platform/chromium-mac/http/tests/appcache/wrong-content-type-expected.txt: Removed.
* platform/chromium-win/http/tests/appcache/wrong-content-type-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100541 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/appcache/wrong-content-type-expected.txt
LayoutTests/http/tests/appcache/wrong-content-type.html
LayoutTests/platform/chromium-cg-mac/http/tests/appcache/wrong-content-type-expected.txt [deleted file]
LayoutTests/platform/chromium-mac/http/tests/appcache/wrong-content-type-expected.txt [deleted file]
LayoutTests/platform/chromium-win/http/tests/appcache/wrong-content-type-expected.txt [deleted file]
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp

index 4ef5397..1b0246b 100644 (file)
@@ -1,3 +1,19 @@
+2011-11-16  Michael Nordman  <michaeln@google.com>
+
+        ApplicationCache manifest should work with any MIME type.
+        https://bugs.webkit.org/show_bug.cgi?id=72082
+
+        Update the wrong-content-type test to expect the appcache to succeed given a text/plain contentType.
+
+        Reviewed by Alexey Proskuryakov.
+
+        * http/tests/appcache/wrong-content-type-expected.txt:
+        * http/tests/appcache/wrong-content-type.html:
+        * platform/chromium/test_expectations.txt: Temporarily skip this test in chromium.
+        * platform/chromium-cg-mac/http/tests/appcache/wrong-content-type-expected.txt: Removed.
+        * platform/chromium-mac/http/tests/appcache/wrong-content-type-expected.txt: Removed.
+        * platform/chromium-win/http/tests/appcache/wrong-content-type-expected.txt: Removed.
+
 2011-11-16  Tony Chang  <tony@chromium.org>
 
         Skip failing ref tests on gtk and mac.
index f707e06..99c5125 100644 (file)
@@ -1,5 +1,4 @@
-CONSOLE MESSAGE: line 0: Application Cache manifest had an incorrect MIME type: text/plain.
-Test that a manifest served with a wrong content-type isn't treated as such.
+Test that a manifest served with an arbitrary content-type is OK.
 
 Should say SUCCESS:
 
index 7b3bf6c..8a527aa 100644 (file)
@@ -1,6 +1,6 @@
 <html manifest="resources/wrong-content-type.manifest">
 <body>
-<p>Test that a manifest served with a wrong content-type isn't treated as such.</p>
+<p>Test that a manifest served with an arbitrary content-type is OK.</p>
 <p>Should say SUCCESS:</p>
 <div id=result></div>
 <script>
@@ -14,15 +14,16 @@ function log(message)
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
-function cacheCallback()
+function errorEventListener()
 {
-    log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+    log("FAILURE: An error event was dispatched on window.applicationCache.");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
 }
 
-function test()
+function verifyStatus()
 {
-    // Wait for cache update to finish.
-    if (window.applicationCache.status != window.applicationCache.UNCACHED)
+    if (window.applicationCache.status != window.applicationCache.IDLE)
         log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
     else
         log("SUCCESS");
@@ -31,9 +32,9 @@ function test()
         layoutTestController.notifyDone();
 }
 
-applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
-applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
-applicationCache.addEventListener('error', test, false);
+applicationCache.addEventListener('cached', verifyStatus, false);
+applicationCache.addEventListener('noupdate', verifyStatus, false);
+applicationCache.addEventListener('error', errorEventListener, false);
 
 </script>
 </body>
diff --git a/LayoutTests/platform/chromium-cg-mac/http/tests/appcache/wrong-content-type-expected.txt b/LayoutTests/platform/chromium-cg-mac/http/tests/appcache/wrong-content-type-expected.txt
deleted file mode 100644 (file)
index d13447a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that a manifest served with a wrong content-type isn't treated as such.
-
-Should say SUCCESS:
-
-SUCCESS
-
diff --git a/LayoutTests/platform/chromium-mac/http/tests/appcache/wrong-content-type-expected.txt b/LayoutTests/platform/chromium-mac/http/tests/appcache/wrong-content-type-expected.txt
deleted file mode 100644 (file)
index d13447a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that a manifest served with a wrong content-type isn't treated as such.
-
-Should say SUCCESS:
-
-SUCCESS
-
diff --git a/LayoutTests/platform/chromium-win/http/tests/appcache/wrong-content-type-expected.txt b/LayoutTests/platform/chromium-win/http/tests/appcache/wrong-content-type-expected.txt
deleted file mode 100644 (file)
index d13447a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that a manifest served with a wrong content-type isn't treated as such.
-
-Should say SUCCESS:
-
-SUCCESS
-
index 50957d4..4cf4a83 100644 (file)
@@ -94,6 +94,9 @@ BUGWK63933 : fast/canvas/canvas-webkitLineDash-invalid.html = FAIL
 // Microdata DOM API is not yet enabled.
 BUGWK68610 SKIP : fast/dom/MicroData = PASS
 
+// Unskip after changes on both sides have landed and rolled together.
+BUGCR103939 SKIP : http/tests/appcache/wrong-content-type.html = TEXT
+
 // -----------------------------------------------------------------
 // WONTFIX TESTS
 // -----------------------------------------------------------------
index c6fe640..37288b9 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-16  Michael Nordman  <michaeln@google.com>
+
+        ApplicationCache manifest should work with any MIME type.
+        https://bugs.webkit.org/show_bug.cgi?id=72082
+
+        Reviewed by Alexey Proskuryakov.
+
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::didReceiveManifestResponse): Remove the test for a particular type.
+
 2011-11-16  Daniel Sievers  <sievers@chromium.org>
 
         [Chromium] Avoid color mask operations for root layers
index 035d0ed..04c2f29 100644 (file)
@@ -682,12 +682,6 @@ void ApplicationCacheGroup::didReceiveManifestResponse(const ResourceResponse& r
         return;
     }
 
-    if (!equalIgnoringCase(response.mimeType(), "text/cache-manifest")) {
-        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest had an incorrect MIME type: " + response.mimeType() + ".", 0, String());
-        cacheUpdateFailed();
-        return;
-    }
-
     m_manifestResource = ApplicationCacheResource::create(m_manifestHandle->firstRequest().url(), response, ApplicationCacheResource::Manifest);
 }