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

Unified Diff: LayoutTests/http/tests/serviceworker/chromium/registration-stress.html

Issue 394133002: ServiceWorker: Add stress test for registration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test failure Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/chromium/registration-stress.html
diff --git a/LayoutTests/http/tests/serviceworker/chromium/registration-stress.html b/LayoutTests/http/tests/serviceworker/chromium/registration-stress.html
new file mode 100644
index 0000000000000000000000000000000000000000..a481ababee5a4037d1529d1861cd3f2ddc148c9e
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/chromium/registration-stress.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Service Worker: registration stress test</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/test-helpers.js"></script>
+<body>
+<script>
+
+async_test(function(t) {
+ var step = t.step_func.bind(t);
+ var url = '../resources/worker-no-op.js';
+ var frames = [];
+
+ var number_of_workers = 50;
+ var register_promises = [];
+
+ for (var i = 0; i < number_of_workers; i++) {
+ var scope = i;
+ register_promises.push(with_iframe(scope)
+ .then(step(function(f) {
+ frames.push(f);
+ return service_worker_unregister_and_register(t, url, scope);
+ })));
+ }
+
+ Promise.all(register_promises)
+ .then(step(function(workers) {
+ var unregister_promises = [];
+ for (var i = 0; i < number_of_workers; i++) {
+ frames[i].remove();
+ unregister_promises.push(
+ navigator.serviceWorker.unregister(workers[i].scope));
+ }
+ return Promise.all(unregister_promises);
+ }))
+ .then(step(function() { t.done(); }))
+ .catch(unreached_rejection(t));
+ }, 'Registration: stress test');
+
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698