Commit 521e388d authored by Chase Phillips's avatar Chase Phillips Committed by Commit Bot

AppCache: Fix remove-cache.html test

This test became flaky after https://crrev.com/c/1891461
which introduced a console deprecation notice for AppCache.
Converting this test to a testharness.js test to mark its
success explicitly once it reaches completion.

Bug: 1022915
Change-Id: I42f707773f9a58bdb0a3a62a5d6d1648aa40dc33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917939
Commit-Queue: Chase Phillips <cmp@chromium.org>
Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716324}
parent c6bc69dd
...@@ -5856,9 +5856,6 @@ crbug.com/1021407 [ Retina Release ] virtual/audio-service/media/video-controls- ...@@ -5856,9 +5856,6 @@ crbug.com/1021407 [ Retina Release ] virtual/audio-service/media/video-controls-
crbug.com/1021407 [ Mac10.11 ] virtual/audio-service/media/controls/video-overlay-cast-dark-rendering.html [ Pass Failure ] crbug.com/1021407 [ Mac10.11 ] virtual/audio-service/media/controls/video-overlay-cast-dark-rendering.html [ Pass Failure ]
crbug.com/1021407 [ Mac10.11 ] media/controls/video-overlay-cast-dark-rendering.html [ Pass Failure ] crbug.com/1021407 [ Mac10.11 ] media/controls/video-overlay-cast-dark-rendering.html [ Pass Failure ]
# Sheriff 2019-11-13
crbug.com/1024398 http/tests/appcache/remove-cache.html [ Pass Failure ]
# Temporarily disabled to land scope changes in DevTools # Temporarily disabled to land scope changes in DevTools
crbug.com/963183 http/tests/devtools/sources/debugger-pause/set-return-value.js [ Pass Failure ] crbug.com/963183 http/tests/devtools/sources/debugger-pause/set-return-value.js [ Pass Failure ]
crbug.com/963183 http/tests/devtools/sources/debugger/debugger-proto-property.js [ Pass Failure ] crbug.com/963183 http/tests/devtools/sources/debugger/debugger-proto-property.js [ Pass Failure ]
......
CONSOLE WARNING: Application Cache API manifest selection is deprecated and will be removed in M82, around April 2020. See https://www.chromestatus.com/features/6192449487634432 for more details.
CONSOLE WARNING: line 13: Application Cache API use is deprecated and will be removed in M82, around April 2020. See https://www.chromestatus.com/features/6192449487634432 for more details.
CONSOLE WARNING: line 22: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Test that a 404 response for manifest results in cache removal.
Frame 1: Manifest is still available, so a new master resource is added to the cache.
Frame 2: Manifest loading results in 404 response, so the cache group becomes obsolete, and an obsolete event is dispatched (because the document in frame was associated with a cache in the group).
Frame 3: Manifest is still 404 - the document is never associated with a cache.
Frame 4: Manifest is now available, so the document gets associated with a cache in a newly created group; the obsolete cache group is not affected.
Should say SUCCESS:
SUCCESS
<html manifest="resources/fail-on-update.php"> <html manifest="resources/fail-on-update.php">
<p>Test that a 404 response for manifest results in cache removal.</p> <head>
<body> <title>remove-cache.html</title>
<ul> <script src="../../../resources/testharness.js"></script>
<li>Frame 1: Manifest is still available, so a new master resource is added to the cache. <script src="../../../resources/testharnessreport.js"></script>
<li>Frame 2: Manifest loading results in 404 response, so the cache group becomes obsolete, and an obsolete event is dispatched (because the document in frame was associated with a cache in the group).
<li>Frame 3: Manifest is still 404 - the document is never associated with a cache.
<li>Frame 4: Manifest is now available, so the document gets associated with a cache in a newly created group; the obsolete cache group is not affected.
</ul>
<p>Should say SUCCESS:</p>
<div id=result></div>
<script> <script>
if (window.testRunner) { setup({ single_test: true });
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function log(message) function log(message)
{ {
...@@ -42,8 +32,8 @@ function test() ...@@ -42,8 +32,8 @@ function test()
function test2() function test2()
{ {
applicationCache.onnoupdate = function() { log("Unexpected noupdate event") } applicationCache.onnoupdate = function() { assert_unreached("Unexpected noupdate event"); }
applicationCache.oncached = function() { log("Unexpected cached event") } applicationCache.oncached = function() { assert_unreached("Unexpected cached event"); }
setManifestDeleted(true, () => { setManifestDeleted(true, () => {
// The frame will be associated to a cache, but update will obsolete it. // The frame will be associated to a cache, but update will obsolete it.
...@@ -57,11 +47,11 @@ function test2() ...@@ -57,11 +47,11 @@ function test2()
function test3() function test3()
{ {
applicationCache.onchecking = function() { log("Unexpected checking event after obsolete event") } applicationCache.onchecking = function() { assert_unreached("Unexpected checking event after obsolete event"); }
applicationCache.onupdateready = function() { log("Unexpected updateready event after obsolete event") } applicationCache.onupdateready = function() { assert_unreached("Unexpected updateready event after obsolete event"); }
applicationCache.onerror = function() { log("Unexpected error event after obsolete event") } applicationCache.onerror = function() { assert_unreached("Unexpected error event after obsolete event"); }
applicationCache.onnoupdate = function() { log("Unexpected noupdate event after obsolete event") } applicationCache.onnoupdate = function() { assert_unreached("Unexpected noupdate event after obsolete event"); }
applicationCache.oncached = function() { log("Unexpected cached event after obsolete event") } applicationCache.oncached = function() { assert_unreached("Unexpected cached event after obsolete event"); }
// The frame will not be associated to a cache. // The frame will not be associated to a cache.
var ifr = document.createElement("iframe"); var ifr = document.createElement("iframe");
...@@ -87,8 +77,7 @@ function test4() ...@@ -87,8 +77,7 @@ function test4()
function test5() function test5()
{ {
log("SUCCESS"); log("SUCCESS");
if (window.testRunner) done();
testRunner.notifyDone();
} }
function resetManifest() function resetManifest()
...@@ -103,7 +92,7 @@ function resetManifest() ...@@ -103,7 +92,7 @@ function resetManifest()
}); });
} }
applicationCache.onupdateready = function() { log("Unexpected updateready event") } applicationCache.onupdateready = function() { assert_unreached("Unexpected updateready event"); }
applicationCache.onnoupdate = test; applicationCache.onnoupdate = test;
applicationCache.oncached = test; applicationCache.oncached = test;
...@@ -111,5 +100,16 @@ applicationCache.oncached = test; ...@@ -111,5 +100,16 @@ applicationCache.oncached = test;
var timeoutId = setTimeout(resetManifest, 100); var timeoutId = setTimeout(resetManifest, 100);
</script> </script>
</head>
<body>
<p>Test that a 404 response for manifest results in cache removal.</p>
<ul>
<li>Frame 1: Manifest is still available, so a new master resource is added to the cache.
<li>Frame 2: Manifest loading results in 404 response, so the cache group becomes obsolete, and an obsolete event is dispatched (because the document in frame was associated with a cache in the group).
<li>Frame 3: Manifest is still 404 - the document is never associated with a cache.
<li>Frame 4: Manifest is now available, so the document gets associated with a cache in a newly created group; the obsolete cache group is not affected.
</ul>
<p>Should say SUCCESS:</p>
<div id=result></div>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment