gecko-dev/dom/serviceworkers/test
Blake Kaplan 19781c9ae7 Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth
Summary:

This test first creates a service worker and then an iframe. It expects the
iframe's first load to be through the network (and for the page's script to
fail to load). Once the page is set up and controlled by the SW, it reloads it
(a soft reload) and the script load is intercepted by the service worker and
we load a script that calls back into the test. However, there is currently no
guarantee that the service worker won't activate before the iframe load and
end up controlling the first load of the iframe.

With this patch, we delay the service worker's activation until we start
loading the iframe, allowing the first load to always be uncontrolled, thereby
resolving the race.

Reviewers: asuth

Reviewed By: asuth

Bug #: 1517406

Differential Revision: https://phabricator.services.mozilla.com/D15637

--HG--
extra : rebase_source : ff63b131b1a395289cda85ec4b46daa3022b08b4
2019-01-29 15:41:10 -05:00
..
claim_clients
controller
download
download_canceled
eventsource
fetch
gtest Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
isolated
match_all_client
match_all_clients
notification
notification_alt
open_window
sanitize
scope
simpleregister
skip_waiting_scope
sw_clients
swa
thirdparty
unregister
workerUpdate
xslt
.eslintrc.js Bug 1512052 - Add more .eslintrc.js files for test directories. r=mossop 2018-12-11 13:15:08 +00:00
activate_event_error_worker.js
async_waituntil_worker.js
blocking_install_event_worker.js
browser_antitracking_subiframes.js Bug 1499995 - part 3 - Tests for nested iframes controlled by ServiceWorkers, r=ehsan 2018-10-25 10:44:12 +02:00
browser_antitracking.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
browser_base_force_refresh.html
browser_cached_force_refresh.html
browser_devtools_serviceworker_interception.js
browser_download_canceled.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
browser_download.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
browser_force_refresh.js Bug 1485305 - dom/ Ensure loadURI always passes a triggeringPrincipal() r=Nika 2018-08-29 15:47:29 +01:00
browser_storage_permission.js
browser_storage_recovery.js
browser_unregister_with_containers.js
browser_userContextId_openWindow.js
browser.ini Bug 1499995 - part 3 - Tests for nested iframes controlled by ServiceWorkers, r=ehsan 2018-10-25 10:44:12 +02:00
bug1151916_driver.html
bug1151916_worker.js
bug1240436_worker.js
chrome_helpers.js
chrome.ini
claim_oninstall_worker.js
claim_worker_1.js
claim_worker_2.js
close_test.js
console_monitor.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
create_another_sharedWorker.html
empty_with_utils.html Bug 1495285 - browser test to check how ServiceWorkers intercept tracking resources, r=baku 2018-10-03 17:00:36 -04:00
empty.html
empty.js
error_reporting_helpers.js
eval_worker.js
fetch_event_worker.js
fetch.js
file_blob_response_worker.js
file_js_cache_cleanup.js
file_js_cache_save_after_load.html
file_js_cache_save_after_load.js
file_js_cache_syntax_error.html
file_js_cache_syntax_error.js
file_js_cache_with_sri.html
file_js_cache.html
file_js_cache.js
file_userContextId_openWindow.js
force_refresh_browser_worker.js
force_refresh_worker.js
gzip_redirect_worker.js
header_checker.sjs
hello.html
importscript_worker.js
importscript.sjs
install_event_error_worker.js
install_event_worker.js
lazy_worker.js
lorem_script.js
match_all_advanced_worker.js
match_all_client_id_worker.js
match_all_properties_worker.js
match_all_worker.js
message_posting_worker.js
message_receiver.html
mochitest.ini Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth 2019-01-29 15:41:10 -05:00
nofetch_handler_worker.js
notification_constructor_error.js
notification_get_sw.js
notificationclick_focus.html
notificationclick_focus.js
notificationclick-otherwindow.html
notificationclick.html
notificationclick.js
notificationclose.html
notificationclose.js
notify_loaded.js
onmessageerror_worker.js Bug 1399446 - implement ServiceWorkerGlobalScope and ServiceWorkerContainer onmessageerror event handlers r=edenchuang,baku 2018-10-22 21:22:25 +00:00
opaque_intercept_worker.js Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth 2019-01-29 15:41:10 -05:00
openWindow_worker.js
page_post_controlled.html Bug 1499995 - part 3 - Tests for nested iframes controlled by ServiceWorkers, r=ehsan 2018-10-25 10:44:12 +02:00
parse_error_worker.js
redirect_post.sjs
redirect_serviceworker.sjs
redirect.sjs
register_https.html
sanitize_worker.js
script_file_upload.js
self_update_worker.sjs
server_file_upload.sjs
service_worker_client.html
service_worker.js
serviceworker_not_sharedworker.js
serviceworker_wrapper.js Bug 1506642 - Don't try to test for various Push interfaces on GeckoView r=smaug 2018-12-10 22:19:26 +00:00
serviceworker.html
serviceworkerinfo_iframe.html
serviceworkermanager_iframe.html
serviceworkerregistrationinfo_iframe.html
sharedWorker_fetch.js
skip_waiting_installed_worker.js
source_message_posting_worker.js
storage_recovery_worker.sjs
strict_mode_warning.js
sw_bad_mime_type.js
sw_bad_mime_type.js^headers^
sw_file_upload.js
sw_storage_not_allow.js
test_async_waituntil.html
test_bad_script_cache.html
test_bug1151916.html
test_bug1240436.html
test_bug1408734.html
test_claim_oninstall.html
test_claim.html
test_client_focus.html
test_controller.html
test_cookie_fetch.html
test_cross_origin_url_after_redirect.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_csp_upgrade-insecure_intercept.html
test_devtools_bypass_serviceworker.html
test_devtools_track_serviceworker_time.html
test_empty_serviceworker.html
test_error_reporting.html Bug 1354577 - require ServiceWorkerContainer.register() to only accept JavaScript MIME types r=edenchuang 2018-10-29 15:09:40 +00:00
test_escapedSlashes.html
test_eval_allowed.html
test_eval_allowed.html^headers^
test_event_listener_leaks.html
test_eventsource_intercept.html
test_fetch_event_with_thirdpartypref.html Bug 1491939 - Part 4: Enable streams on a per-realm basis. Drop dom.streams.enabled and dom.workers.options.streams; use only javascript.options.streams. r=baku 2018-09-25 14:11:41 +00:00
test_fetch_event.html Bug 1491939 - Part 4: Enable streams on a per-realm basis. Drop dom.streams.enabled and dom.workers.options.streams; use only javascript.options.streams. r=baku 2018-09-25 14:11:41 +00:00
test_fetch_integrity.html Bug 1438945 - Part 5: SharedWorker browser test. r=asuth 2018-11-19 15:18:21 -08:00
test_file_blob_response.html
test_file_blob_upload.html
test_file_upload.html
test_force_refresh.html
test_gzip_redirect.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_hsts_upgrade_intercept.html
test_https_fetch_cloned_response.html
test_https_fetch.html
test_https_origin_after_redirect_cached.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_https_origin_after_redirect.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_https_synth_fetch_from_cached_sw.html
test_imagecache_max_age.html
test_imagecache.html
test_importscript_mixedcontent.html Bug 1499096 - Update tests using ok() to is();r=Standard8 2018-10-23 07:12:23 +00:00
test_importscript.html
test_install_event_gc.html
test_install_event.html
test_installation_simple.html
test_match_all_advanced.html
test_match_all_client_id.html
test_match_all_client_properties.html
test_match_all.html
test_navigator.html
test_nofetch_handler.html
test_not_intercept_plugin.html
test_notification_constructor_error.html
test_notification_get.html
test_notificationclick_focus.html
test_notificationclick-otherwindow.html
test_notificationclick.html
test_notificationclose.html
test_onmessageerror.html Bug 1399446 - implement ServiceWorkerGlobalScope and ServiceWorkerContainer onmessageerror event handlers r=edenchuang,baku 2018-10-22 21:22:25 +00:00
test_opaque_intercept.html Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth 2019-01-29 15:41:10 -05:00
test_openWindow.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_origin_after_redirect_cached.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_origin_after_redirect_to_https_cached.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_origin_after_redirect_to_https.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_origin_after_redirect.html Backed out changeset 7c1aecbca3dd (bug 1498278) for causing leaks at at mozilla::extensions::ChannelWrapper::Get 2018-10-12 23:12:07 +03:00
test_post_message_advanced.html
test_post_message_source.html
test_post_message.html
test_privateBrowsing.html Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
test_register_base.html
test_register_https_in_http.html
test_sandbox_intercept.html
test_sanitize_domain.html
test_sanitize.html Bug 1499096 - Update tests using ok() to is();r=Standard8 2018-10-23 07:12:23 +00:00
test_scopes.html Bug 1515989 - Fix this test to use the service worker manager in the parent. r=asuth 2018-12-21 21:51:40 +00:00
test_script_loader_intercepted_js_cache.html
test_self_update_worker.html
test_service_worker_allowed.html
test_serviceworker_header.html
test_serviceworker_interfaces.html Bug 1506642 - Don't try to test for various Push interfaces on GeckoView r=smaug 2018-12-10 22:19:26 +00:00
test_serviceworker_interfaces.js Bug 1506642 - Don't try to test for various Push interfaces on GeckoView r=smaug 2018-12-10 22:19:26 +00:00
test_serviceworker_not_sharedworker.html
test_serviceworker.html
test_serviceworkerinfo.xul
test_serviceworkermanager.xul
test_serviceworkerregistrationinfo.xul
test_skip_waiting.html
test_strict_mode_warning.html
test_third_party_iframes.html Bug 1501978 - Part 2: Remove the browser.contentblocking.enabled pref from the tests that set it to true needlessly r=baku 2018-10-30 07:47:56 +00:00
test_unregister.html
test_unresolved_fetch_interception.html
test_worker_reference_gc_timeout.html
test_workerUnregister.html
test_workerUpdate.html
test_workerupdatefoundevent.html
test_xslt.html
unresolved_fetch_worker.js
update_worker.sjs
updatefoundevent.html
utils.js Bug 1499995 - part 3 - Tests for nested iframes controlled by ServiceWorkers, r=ehsan 2018-10-25 10:44:12 +02:00
worker2.js
worker3.js
worker_unregister.js
worker_update.js
worker_updatefoundevent2.js
worker_updatefoundevent.js
worker.js
xslt_worker.js