Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1500)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/update-served-from-cache.html

Issue 1380323002: Make registration.update() no longer force bypassing the HTTP cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-served-from-cache-worker.php ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/update-served-from-cache.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/update-served-from-cache.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/update-served-from-cache.html
new file mode 100644
index 0000000000000000000000000000000000000000..d6f77e7baddbc659c7dfb7f86605f3bd29b7cf50
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/update-served-from-cache.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Service Worker: Registration update() served from cache</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.js"></script>
+<script>
+promise_test(function(t) {
+ var scope = 'resources/scope/update-served-from-cache';
+ var worker_url = 'resources/update-served-from-cache-worker.php';
+ var registration;
+
+ return service_worker_unregister_and_register(t, worker_url, scope)
+ .then(function(r) {
+ // The script resource for this register() having a non-zero max-age
+ // value was cached.
+ registration = r;
+ return wait_for_state(t, registration.installing, 'activated');
+ })
+ .then(function() {
+ // update() should consult the cache. The returned promise should
+ // resolve when the script is retrieved from the cache.
+ return registration.update();
+ })
+ .then(function() {
+ // installing should be null as update() does not trigger install.
+ assert_equals(
+ registration.installing,
+ null,
+ 'installing should be null as the script was served from cache.');
+ return service_worker_unregister_and_done(t, scope);
+ });
+ }, 'Update a registration served from cache.');
+</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-served-from-cache-worker.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698