- Revision
- 90595
- Author
- [email protected]
- Date
- 2011-07-07 15:29:57 -0700 (Thu, 07 Jul 2011)
Log Message
Reviewed by Alexey Proskuryakov.
fast/dom/HTMLLinkElement/link-and-subresource-test.html is flaky on chromium debug bots
https://bugs.webkit.org/show_bug.cgi?id=60097
The culprit was that CachedResource:stopLoading() was using *this
after a call to checkNotify(), which isn't kosher. This patch
uses a CachedResourceHandle to keep the CachedResource alive.
Source/WebCore:
The test is a very close copy of the eponymous
link-and-subresource-test.html, only substituting invalid
resources for the valid ones in that test. The reproduction is
timing related, and happens much more consistantly with an invalid
resource for whatever reason.
Test: fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::stopLoading):
LayoutTests:
The test is a very close copy of the eponymous
link-and-subresource-test.html, only substituting invalid
resources for the valid ones in that test. The reproduction is
timing related, and happens much more consistantly with an invalid
resource for whatever reason.
* fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt: Added.
* fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html: Added.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (90594 => 90595)
--- trunk/LayoutTests/ChangeLog 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/LayoutTests/ChangeLog 2011-07-07 22:29:57 UTC (rev 90595)
@@ -1,3 +1,27 @@
+2011-07-07 Gavin Peters <[email protected]>
+
+ Reviewed by Alexey Proskuryakov.
+
+ fast/dom/HTMLLinkElement/link-and-subresource-test.html is flaky on chromium debug bots
+ https://bugs.webkit.org/show_bug.cgi?id=60097
+
+ The culprit was that CachedResource:stopLoading() was using *this
+ after a call to checkNotify(), which isn't kosher. This patch
+ uses a CachedResourceHandle to keep the CachedResource alive.
+
+ The test is a very close copy of the eponymous
+ link-and-subresource-test.html, only substituting invalid
+ resources for the valid ones in that test. The reproduction is
+ timing related, and happens much more consistantly with an invalid
+ resource for whatever reason.
+
+ * fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt: Added.
+ * fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html: Added.
+ * platform/gtk/Skipped:
+ * platform/mac/Skipped:
+ * platform/qt/Skipped:
+ * platform/win/Skipped:
+
2011-07-07 Jeff Timanus <[email protected]>
Reviewed by Stephen White.
Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html (0 => 90595)
--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html 2011-07-07 22:29:57 UTC (rev 90595)
@@ -0,0 +1,39 @@
+<html>
+<body>
+<script>
+function log(message)
+{
+ var item = document.createElement("li");
+ item.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(item);
+}
+
+dne_error_count = 0
+
+function dne_onerror()
+{
+ log("DNE_ONERROR called");
+ ++dne_error_count;
+ if (dne_error_count == 2) {
+ log("SUCCESS. Two errors.");
+ layoutTestController.notifyDone();
+ }
+}
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+ layoutTestController.dumpResourceResponseMIMETypes();
+}
+</script>
+<p>This test verifies that an image which is prefetched, and which is also contained as a
+subresource of the current document can be loaded correctly as a subresource, even if the URI
+doesn't exist.
+
+<p>When this test succeeds, you will see nothing. When this test fails, you will crash or have another error.
+<link rel="prefetch" href="" _onerror_="dne_onerror()" />
+<img src="" _onerror_="dne_onerror()" />
+<hr>
+<p><ol id="console"></ol></p>
+</body></html>
+
Added: trunk/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt (0 => 90595)
--- trunk/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt 2011-07-07 22:29:57 UTC (rev 90595)
@@ -0,0 +1,8 @@
+This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource, even if the URI doesn't exist.
+
+When this test succeeds, you will see nothing. When this test fails, you will crash or have another error.
+
+DNE_ONERROR called
+DNE_ONERROR called
+SUCCESS. Two errors.
+
Modified: trunk/LayoutTests/platform/gtk/Skipped (90594 => 90595)
--- trunk/LayoutTests/platform/gtk/Skipped 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/LayoutTests/platform/gtk/Skipped 2011-07-07 22:29:57 UTC (rev 90595)
@@ -1018,6 +1018,7 @@
# Link prefetch is disabled by default
fast/dom/HTMLLinkElement/link-and-subresource-test.html
+fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
fast/dom/HTMLLinkElement/prefetch.html
fast/dom/HTMLLinkElement/prefetch-beforeload.html
fast/dom/HTMLLinkElement/prefetch-onerror.html
Modified: trunk/LayoutTests/platform/mac/Skipped (90594 => 90595)
--- trunk/LayoutTests/platform/mac/Skipped 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/LayoutTests/platform/mac/Skipped 2011-07-07 22:29:57 UTC (rev 90595)
@@ -175,6 +175,7 @@
# Link prefetch is disabled by default
fast/dom/HTMLLinkElement/link-and-subresource-test.html
+fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
fast/dom/HTMLLinkElement/prefetch.html
fast/dom/HTMLLinkElement/prefetch-beforeload.html
fast/dom/HTMLLinkElement/prefetch-onerror.html
Modified: trunk/LayoutTests/platform/qt/Skipped (90594 => 90595)
--- trunk/LayoutTests/platform/qt/Skipped 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/LayoutTests/platform/qt/Skipped 2011-07-07 22:29:57 UTC (rev 90595)
@@ -115,6 +115,7 @@
# ENABLE(LINK_PREFETCH) is disabled.
fast/dom/HTMLLinkElement/link-and-subresource-test.html
+fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
fast/dom/HTMLLinkElement/prefetch.html
fast/dom/HTMLLinkElement/prefetch-beforeload.html
fast/dom/HTMLLinkElement/prefetch-onerror.html
Modified: trunk/LayoutTests/platform/win/Skipped (90594 => 90595)
--- trunk/LayoutTests/platform/win/Skipped 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/LayoutTests/platform/win/Skipped 2011-07-07 22:29:57 UTC (rev 90595)
@@ -1030,6 +1030,7 @@
# Link prefetch is disabled by default
fast/dom/HTMLLinkElement/link-and-subresource-test.html
+fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
fast/dom/HTMLLinkElement/prefetch.html
fast/dom/HTMLLinkElement/prefetch-beforeload.html
fast/dom/HTMLLinkElement/prefetch-onerror.html
Modified: trunk/Source/WebCore/ChangeLog (90594 => 90595)
--- trunk/Source/WebCore/ChangeLog 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/Source/WebCore/ChangeLog 2011-07-07 22:29:57 UTC (rev 90595)
@@ -1,3 +1,24 @@
+2011-07-07 Gavin Peters <[email protected]>
+
+ Reviewed by Alexey Proskuryakov.
+
+ fast/dom/HTMLLinkElement/link-and-subresource-test.html is flaky on chromium debug bots
+ https://bugs.webkit.org/show_bug.cgi?id=60097
+
+ The culprit was that CachedResource:stopLoading() was using *this
+ after a call to checkNotify(), which isn't kosher. This patch
+ uses a CachedResourceHandle to keep the CachedResource alive.
+
+ The test is a very close copy of the eponymous
+ link-and-subresource-test.html, only substituting invalid
+ resources for the valid ones in that test. The reproduction is
+ timing related, and happens much more consistantly with an invalid
+ resource for whatever reason.
+ Test: fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
+
+ * loader/cache/CachedResource.cpp:
+ (WebCore::CachedResource::stopLoading):
+
2011-07-07 James Robinson <[email protected]>
Reviewed by Kenneth Russell.
Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (90594 => 90595)
--- trunk/Source/WebCore/loader/cache/CachedResource.cpp 2011-07-07 22:20:21 UTC (rev 90594)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp 2011-07-07 22:29:57 UTC (rev 90595)
@@ -263,6 +263,8 @@
ASSERT(m_request);
m_request.clear();
+ CachedResourceHandle<CachedResource> protect(this);
+
// All loads finish with data(allDataReceived = true) or error(), except for
// canceled loads, which silently set our request to 0. Be sure to notify our
// client in that case, so we don't seem to continue loading forever.
@@ -271,9 +273,6 @@
setStatus(Canceled);
checkNotify();
}
-
- if (canDelete() && !inCache())
- delete this;
}
void CachedResource::addClient(CachedResourceClient* client)