Name Description Size
abrupt_completion_worker.js 660
activate_event_error_worker.js 109
async_waituntil_worker.js 1328
blocking_install_event_worker.js 588
browser_antitracking_subiframes.js Set up a ServiceWorker on a domain that will be used as 3rd party iframe. That 3rd party frame should be controlled by the ServiceWorker. After that, we open a second iframe into the first one. That should not be controlled. 3383
browser_antitracking.js Set up a no-fetch-optimized ServiceWorker on a domain that will be covered by tracking protection (but is not yet). Once the SW is installed, activate TP and create a tab that embeds that tracking-site in an iframe. 3413
browser_base_force_refresh.html 666
browser_cached_force_refresh.html 1575
browser_devtools_serviceworker_interception.js 7894
browser_download_canceled.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 6594
browser_download.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 2683
browser_force_refresh.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 2794
browser_head.js This file contains common functionality for ServiceWorker browser tests. Note that the normal auto-import mechanics for browser mochitests only handles "head.js", but we currently store all of our different varieties of mochitest in a single directory, which potentially results in a collision for similar heuristics for xpcshell. Many of the storage-related helpers in this file come from: https://searchfox.org/mozilla-central/source/dom/localstorage/test/unit/head.js 9596
browser_intercepted_channel_process_swap.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 3161
browser_intercepted_worker_script.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 2672
browser_navigation_fetch_fault_handling.js This test file tests our automatic recovery and any related mitigating heuristics that occur during intercepted navigation fetch request. Specifically, we should be resetting interception so that we go to the network in these cases and then potentially taking actions like unregistering the ServiceWorker and/or clearing QuotaManager-managed storage for the origin. See specific test permutations for specific details inline in the test. NOTE THAT CURRENTLY THIS TEST IS DISCUSSING MITIGATIONS THAT ARE NOT YET IMPLEMENTED, JUST PLANNED. These will be iterated on and added to the rest of the stack of patches on Bug 1503072. ## Test Mechanics ### Fetch Fault Injection We expose: - On nsIServiceWorkerInfo, the per-ServiceWorker XPCOM interface: - A mechanism for creating synthetic faults by setting the `nsIServiceWorkerInfo::testingInjectCancellation` attribute to a failing nsresult. The fault is applied at the beginning of the steps to dispatch the fetch event on the global. - A count of the number of times we experienced these navigation faults that had to be reset as `nsIServiceWorkerInfo::navigationFaultCount`. (This would also include real faults, but we only expect to see synthetic faults in this test.) - On nsIServiceWorkerRegistrationInfo, the per-registration XPCOM interface: - A readonly attribute that indicates how many times an origin storage usage check has been initiated. We also use: - `nsIServiceWorkerManager::addListener(nsIServiceWorkerManagerListener)` allows our test to listen for the unregistration of registrations. This allows us to be notified when unregistering or origin-clearing actions have been taken as a mitigation. ### General Test Approach For each test we: - Ensure/confirm the testing origin has no QuotaManager storage in use. - Install the ServiceWorker. - If we are testing the situation where we want to simulate the origin being near its quota limit, we also generate Cache API and IDB storage usage sufficient to put our origin over the threshold. - We run a quota check on the origin after doing this in order to make sure that we did this correctly and that we properly constrained the limit for the origin. We fail the test for test implementation reasons if we didn't accomplish this. - Verify a fetch navigation to the SW works without any fault injection, producing a result produced by the ServiceWorker. - Begin fault permutations in a loop, where for each pass of the loop: - We trigger a navigation which will result in an intercepted fetch which will fault. We wait until the navigation completes. - We verify that we got the request from the network. - We verify that the ServiceWorker's navigationFaultCount increased. - If this the count at which we expect a mitigation to take place, we wait for the registration to become unregistered AND: - We check whether the storage for the origin was cleared or not, which indicates which mitigation of the following happened: - Unregister the registration directly. - Clear the origin's data which will also unregister the registration as a side effect. - We check whether the registration indicates an origin quota check happened or not. ### Disk Usage Limits In order to avoid gratuitous disk I/O and related overheads, we limit QM ("temporary") storage to 10 MiB which ends up limiting group usage to 10 MiB. This lets us set a threshold situation where we claim that a SW needs at least 4 MiB of storage for installation/operation, meaning that any usage beyond 6 MiB in the group will constitute a need to clear the group or origin. We fill with the storage with 8 MiB of artificial usage to this end, storing 4 MiB in Cache API and 4 MiB in IDB. 10664
browser_remote_type_process_swap.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 4045
browser_storage_permission.js 9934
browser_storage_recovery.js 5404
browser_unregister_with_containers.js 5064
browser_userContextId_openWindow.js eslint-disable no-shadow 4461
browser-common.ini 1506
browser-dFPI.ini 161
browser.ini 61
bug1151916_driver.html 1663
bug1151916_worker.js 388
bug1240436_worker.js 58
chrome_helpers.js 1773
chrome-common.ini 533
chrome-dFPI.ini 160
chrome.ini 60
claim_clients 1
claim_oninstall_worker.js 189
claim_worker_1.js 795
claim_worker_2.js 880
close_test.js 526
console_monitor.js eslint-env mozilla/chrome-script 1059
controller 1
create_another_sharedWorker.html Shared workers: create antoehr sharedworekr client 189
download 2
download_canceled 3
empty_with_utils.html 256
empty.html 0
empty.js 0
error_reporting_helpers.js Helpers for use in tests that want to verify that localized error messages are logged during the test. Because most of our errors (ex: ServiceWorkerManager) generate nsIScriptError instances with flattened strings (the interpolated arguments aren't kept around), we load the string bundle and use it to derive the exact string message we expect for the given payload. 2616
eval_worker.js 13
eventsource 12
fetch 18
fetch_event_worker.js 12341
fetch.js 1002
file_blob_response_worker.js 1230
file_js_cache_cleanup.js 398
file_js_cache_save_after_load.html Save the bytecode when all scripts are executed 223
file_js_cache_save_after_load.js 440
file_js_cache_syntax_error.html Do not save bytecode on compilation errors 215
file_js_cache_syntax_error.js 43
file_js_cache_with_sri.html Add a tag script to save the bytecode 294
file_js_cache.html Add a tag script to save the bytecode 197
file_js_cache.js 69
file_notification_openWindow.html Bug 1578070 586
file_userContextId_openWindow.js 72
force_refresh_browser_worker.js 1127
force_refresh_worker.js 1353
ForceRefreshChild.jsm 262
ForceRefreshParent.jsm 2289
gtest 2
gzip_redirect_worker.js 328
header_checker.sjs 309
hello.html 116
importscript_worker.js 1066
importscript.sjs 358
install_event_error_worker.js 199
install_event_worker.js 60
intercepted_channel_process_swap_worker.js 139
isolated This directory contains tests that are flaky when run with other tests 2
lazy_worker.js 166
lorem_script.js 467
match_all_advanced_worker.js 128
match_all_client 1
match_all_client_id_worker.js 683
match_all_clients 1
match_all_properties_worker.js 684
match_all_worker.js 189
message_posting_worker.js 204
message_receiver.html 136
mochitest-common.ini 10839
mochitest-dFPI.ini 324
mochitest.ini 1218
network_with_utils.html 264
nofetch_handler_worker.js 425
notification 3
notification_alt 2
notification_constructor_error.js 30
notification_get_sw.js 1401
notification_openWindow_worker.js 783
notificationclick_focus.html Bug 1144660 - controlled page 666
notificationclick_focus.js 1354
notificationclick-otherwindow.html Bug 1114554 - controlled page 809
notificationclick.html Bug 1114554 - controlled page 646
notificationclick.js 651
notificationclose.html Bug 1265841 - controlled page 890
notificationclose.js 868
notify_loaded.js 42
onmessageerror_worker.js 1201
opaque_intercept_worker.js 993
open_window 1
openWindow_worker.js 5059
page_post_controlled.html 617
parse_error_worker.js 41
redirect_post.sjs 1093
redirect_serviceworker.sjs 205
redirect.sjs 181
register_https.html 446
sanitize 3
sanitize_worker.js 129
scope 1
script_file_upload.js eslint-env mozilla/chrome-script 440
self_update_worker.sjs 1186
server_file_upload.sjs 659
service_worker_client.html controlled page 678
service_worker.js 266
serviceworker_not_sharedworker.js 428
serviceworker_wrapper.js 2338
serviceworker.html 211
serviceworkerinfo_iframe.html 693
serviceworkermanager_iframe.html 913
serviceworkerregistrationinfo_iframe.html 772
sharedWorker_fetch.js 858
simple_fetch_worker.js 378
simpleregister 2
skip_waiting_installed_worker.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 192
skip_waiting_scope 1
source_message_posting_worker.js 435
storage_recovery_worker.sjs 705
streamfilter_server.sjs 276
streamfilter_worker.js 244
strict_mode_warning.js 41
sw_bad_mime_type.js 25
sw_bad_mime_type.js^headers^ 25
sw_clients 10
sw_file_upload.js 393
sw_respondwith_serviceworker.js 555
sw_storage_not_allow.js 1014
swa 10
test_abrupt_completion.html 4815
test_async_waituntil.html Test for Bug 1263304 2895
test_bad_script_cache.html Test updating a service worker with a bad script cache. 3224
test_bug1151916.html Bug 1151916 - Test principal is set on cached serviceworkers 2675
test_bug1240436.html Test for encoding of service workers 1017
test_bug1408734.html Bug 1408734 1614
test_claim_oninstall.html Bug 1130684 - Test service worker clients.claim oninstall 2326
test_claim.html Bug 1130684 - Test service worker clients claim onactivate 5418
test_controller.html Bug 1002570 - test controller instance. 2389
test_cookie_fetch.html Bug 1331680 - test access to cookies in the documents synthesized from service worker responses 2400
test_cross_origin_url_after_redirect.html Test access to a cross origin Request.url property from a service worker for a redirected intercepted iframe 1631
test_csp_upgrade-insecure_intercept.html Test that a CSP upgraded request can be intercepted by a service worker 2019
test_devtools_bypass_serviceworker.html Verify devtools can utilize nsIChannel::LOAD_BYPASS_SERVICE_WORKER to bypass the service worker 3315
test_devtools_track_serviceworker_time.html Bug 1251238 - track service worker install time 6977
test_empty_serviceworker.html Test that registering an empty service worker works 1304
test_error_reporting.html Test Error Reporting of Service Worker Failures 8396
test_escapedSlashes.html Test for escaped slashes in navigator.serviceWorker.register 2564
test_eval_allowed.html Bug 1160458 - CSP activated by default in Service Workers 1345
test_eval_allowed.html^headers^ 131
test_event_listener_leaks.html Bug 1447871 - Test some service worker leak conditions 1980
test_eventsource_intercept.html Bug 1182103 - Test EventSource scenarios with fetch interception 3617
test_fetch_event_with_thirdpartypref.html Bug 94048 - test install event. 2586
test_fetch_event.html Bug 94048 - test install event. 2029
test_fetch_integrity.html Test fetch.integrity on console report for serviceWorker and sharedWorker 6138
test_file_blob_response.html Bug 1253777 - Test interception using file blob response body 2259
test_file_blob_upload.html Bug 1203680 - Test interception of file blob uploads 4350
test_file_upload.html Bug 1424701 - Test for service worker + file upload 2073
test_force_refresh.html Bug 982726 - Test service worker post message 3477
test_gzip_redirect.html Bug 982726 - Test service worker post message 2680
test_hsts_upgrade_intercept.html Test that an HSTS upgraded request can be intercepted by a service worker 2460
test_https_fetch_cloned_response.html Bug 1133763 - test fetch event in HTTPS origins with a cloned response 1924
test_https_fetch.html Bug 1133763 - test fetch event in HTTPS origins 2317
test_https_origin_after_redirect_cached.html Test the origin of a redirected response from a service worker 2006
test_https_origin_after_redirect.html Test the origin of a redirected response from a service worker 1999
test_https_synth_fetch_from_cached_sw.html Bug 1156847 - test fetch event generating a synthesized response in HTTPS origins from a cached SW 2576
test_imagecache_max_age.html Test that the image cache respects a synthesized image's Cache headers 2551
test_imagecache.html Bug 1202085 - Test that images from different controllers don't cached together 1898
test_importscript_mixedcontent.html Bug 1198078 - test that we respect mixed content blocking in importScript() inside service workers 1899
test_importscript.html Test service worker - script cache policy 2168
test_install_event_gc.html Test install event being GC'd before waitUntil fulfills 4493
test_install_event.html Bug 94048 - test install event. 5215
test_installation_simple.html Bug 930348 - test stub Navigator ServiceWorker utilities. 7313
test_match_all_advanced.html Bug 982726 - Test matchAll with multiple clients 2882
test_match_all_client_id.html Bug 1058311 - Test matchAll client id 2593
test_match_all_client_properties.html Bug 1058311 - Test matchAll clients properties 2693
test_match_all.html Bug 982726 - test match_all not crashing 2348
test_navigationPreload_disable_crash.html Failure to create a Promise shouldn't crash 1847
test_navigator.html Bug 930348 - test stub Navigator ServiceWorker utilities. 1593
test_nofetch_handler.html Test for Bugs 1181127 and 1325101 1976
test_not_intercept_plugin.html Bug 1187766 - Test loading plugins scenarios with fetch interception. 2090
test_notification_constructor_error.html Bug XXXXXXX - Check that Notification constructor throws in ServiceWorkerGlobalScope 1724
test_notification_get.html ServiceWorkerRegistration.getNotifications() on main thread and worker thread. 7539
test_notification_openWindow.html Bug 1578070 3344
test_notificationclick_focus.html Bug 1144660 - Test client.focus() permissions on notification click 2250
test_notificationclick-otherwindow.html Bug 1114554 - Test ServiceWorkerGlobalScope.notificationclick event. 2227
test_notificationclick.html Bug 1114554 - Test ServiceWorkerGlobalScope.notificationclick event. 2280
test_notificationclose.html Bug 1265841 - Test ServiceWorkerGlobalScope.notificationclose event. 2308
test_onmessageerror.html Test onmessageerror event handlers 4282
test_opaque_intercept.html Bug 982726 - Test service worker post message 3026
test_openWindow.html Bug 1172870 - Test clients.openWindow 3564
test_origin_after_redirect_cached.html Test the origin of a redirected response from a service worker 1967
test_origin_after_redirect_to_https_cached.html Test the origin of a redirected response from a service worker 1934
test_origin_after_redirect_to_https.html Test the origin of a redirected response from a service worker 1927
test_origin_after_redirect.html Test the origin of a redirected response from a service worker 1960
test_post_message_advanced.html Bug 982726 - Test service worker post message advanced 3318
test_post_message_source.html Bug 1142015 - Test service worker post message source 1866
test_post_message.html Bug 982726 - Test service worker post message 2372
test_privateBrowsing.html Test for ServiceWorker - Private Browsing 2882
test_register_base.html Test that registering a service worker uses the docuemnt URI for the secure origin check 1039
test_register_https_in_http.html Bug 1172948 - Test that registering a service worker from inside an HTTPS iframe embedded in an HTTP iframe doesn't work 1259
test_sandbox_intercept.html Bug 1142727 - Test that sandboxed iframes are not intercepted 1870
test_sanitize_domain.html Bug 1080109 - Clear ServiceWorker registrations for specific domains 2985
test_sanitize.html Bug 1080109 - Clear ServiceWorker registrations for all domains 2660
test_scopes.html Bug 984048 - Test scope glob matching. 4720
test_script_loader_intercepted_js_cache.html Test for saving and loading bytecode in/from the necko cache 9546
test_self_update_worker.html Test for Bug 1432846 5008
test_service_worker_allowed.html Test the Service-Worker-Allowed header 2444
test_serviceworker_header.html Test that service worker scripts are fetched with a Service-Worker: script header 1311
test_serviceworker_interfaces.html Validate Interfaces Exposed to Service Workers 4452
test_serviceworker_interfaces.js 21128
test_serviceworker_not_sharedworker.html Bug 1141274 - test that service workers and shared workers are separate 2189
test_serviceworker.html Bug 1137245 - Allow IndexedDB usage in ServiceWorkers 2104
test_serviceworkerinfo.xhtml 3968
test_serviceworkermanager.xhtml 2762
test_serviceworkerregistrationinfo.xhtml 6741
test_skip_waiting.html Bug 1131352 - Add ServiceWorkerGlobalScope skipWaiting() 2467
test_streamfilter.html Test StreamFilter-monitored responses for ServiceWorker-intercepted requests 6400
test_strict_mode_warning.html Bug 1170550 - test registration of service worker scripts with a strict mode warning 1166
test_third_party_iframes.html Bug 1152899 - Disallow the interception of third-party iframes using service workers when the third-party cookie preference is set 7225
test_unregister.html Bug 984048 - Test unregister 3817
test_unresolved_fetch_interception.html Test for Bug 1188545 3814
test_worker_reference_gc_timeout.html Test for Bug 1317266 2273
test_workerUnregister.html Bug 982728 - Test ServiceWorkerGlobalScope.unregister 2398
test_workerUpdate.html Bug 1065366 - Test ServiceWorkerGlobalScope.update 1787
test_workerupdatefoundevent.html Bug 1131327 - Test ServiceWorkerRegistration.onupdatefound on ServiceWorker 2560
test_xslt.html Bug 1182113 - Test service worker XSLT interception 3195
thirdparty 6
unregister 2
unresolved_fetch_worker.js 498
update_worker.sjs " + Date.now() + " 468
updatefoundevent.html Bug 1131327 - Test ServiceWorkerRegistration.onupdatefound on ServiceWorker 319
utils.js Helper for browser tests to issue register calls from the content global and wait for the SW to progress to the active state, as most tests desire. From the ContentTask.spawn, use via `content.wrappedJSObject.registerAndWaitForActive`. 4118
window_party_iframes.html 342
worker_unregister.js 415
worker_update.js 708
worker_updatefoundevent.js Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 551
worker_updatefoundevent2.js 15
worker.js 33
worker2.js 14
worker3.js 14
workerUpdate 1
xslt 2
xslt_worker.js 1558