From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/base/test/.eslintrc.js | 12 + dom/base/test/345339_iframe.html | 29 + dom/base/test/Ahem.ttf | Bin 0 -> 12480 bytes dom/base/test/FAIL.html | 1 + dom/base/test/PASS.html | 1 + dom/base/test/accesscontrol.resource | 7 + dom/base/test/accesscontrol.resource^headers^ | 5 + dom/base/test/audio.ogg | Bin 0 -> 14293 bytes dom/base/test/badContentType.eventsource | 5 + dom/base/test/badContentType.eventsource^headers^ | 1 + dom/base/test/badHTTPResponseCode.eventsource | 5 + .../test/badHTTPResponseCode.eventsource^headers^ | 2 + dom/base/test/badMessageEvent.eventsource | 4 + dom/base/test/badMessageEvent.eventsource^headers^ | 1 + dom/base/test/badMessageEvent2.eventsource | 5 + .../test/badMessageEvent2.eventsource^headers^ | 1 + dom/base/test/browser.ini | 112 + .../test/browser_aboutnewtab_process_selection.js | 137 + dom/base/test/browser_blocking_image.js | 183 + dom/base/test/browser_bug1011748.js | 31 + dom/base/test/browser_bug1058164.js | 238 + dom/base/test/browser_bug1303838.js | 368 ++ dom/base/test/browser_bug1554070.js | 49 + dom/base/test/browser_bug1691214.js | 122 + dom/base/test/browser_bug1703472.js | 68 + dom/base/test/browser_bug902350.js | 56 + .../test/browser_chromeutils_getalldomprocesses.js | 62 + dom/base/test/browser_chromeutils_isdomobject.js | 115 + .../test/browser_data_documents_aboutmemory.js | 20 + dom/base/test/browser_force_process_selector.js | 38 + .../test/browser_form_validity_popup_submit.js | 55 + .../test/browser_inputStream_structuredClone.js | 72 + .../browser_messagemanager_loadprocessscript.js | 193 + .../browser_messagemanager_targetframeloader.js | 36 + dom/base/test/browser_messagemanager_unload.js | 131 + dom/base/test/browser_multiple_popups.html | 63 + dom/base/test/browser_multiple_popups.js | 296 ++ dom/base/test/browser_outline_refocus.js | 65 + dom/base/test/browser_page_load_event_telemetry.js | 46 + dom/base/test/browser_pagehide_on_tab_close.js | 21 + dom/base/test/browser_promiseDocumentFlushed.js | 292 ++ dom/base/test/browser_refresh_content.js | 127 + dom/base/test/browser_state_notifications.js | 193 + ...owser_timeout_throttling_with_audio_playback.js | 73 + dom/base/test/browser_use_counters.js | 348 ++ dom/base/test/browser_user_input_handling_delay.js | 82 + ...browser_user_input_handling_delay_aboutblank.js | 58 + .../browser_user_input_handling_delay_bfcache.js | 107 + ...r_user_input_handling_delay_invisible_iframe.js | 78 + ...owser_user_input_handling_delay_reload_ticks.js | 54 + dom/base/test/browser_xml_toggle.js | 24 + dom/base/test/bug1576154.sjs | 8 + dom/base/test/bug1739957.sjs | 10 + dom/base/test/bug282547.sjs | 8 + dom/base/test/bug298064-subframe.html | 24 + dom/base/test/bug313646.txt | 1 + dom/base/test/bug382113_object.html | 6 + dom/base/test/bug403852_fileOpener.js | 24 + dom/base/test/bug419132.html | 22 + dom/base/test/bug426308-redirect.sjs | 4 + dom/base/test/bug435425.sjs | 25 + dom/base/test/bug435425_redirect.sjs | 4 + dom/base/test/bug444322.js | 0 dom/base/test/bug444322.txt | 0 dom/base/test/bug444546.sjs | 21 + dom/base/test/bug455629-helper.svg | 6 + dom/base/test/bug457746.sjs | 10 + dom/base/test/bug461735-post-redirect.js | 3 + dom/base/test/bug461735-redirect1.sjs | 8 + dom/base/test/bug461735-redirect2.sjs | 8 + dom/base/test/bug466080.sjs | 14 + dom/base/test/bug466409-empty.css | 0 dom/base/test/bug466409-page.html | 12 + dom/base/test/bug475156.sjs | 23 + dom/base/test/bug482935.sjs | 12 + dom/base/test/bug540854.sjs | 21 + dom/base/test/bug578096LoadChromeScript.js | 20 + dom/base/test/bug638112-response.txt | Bin 0 -> 247 bytes dom/base/test/bug638112.sjs | 24 + dom/base/test/bug696301-script-1.js | 3 + dom/base/test/bug696301-script-1.js^headers^ | 1 + dom/base/test/bug696301-script-2.js | 3 + dom/base/test/bug704320.sjs | 396 ++ dom/base/test/bug704320_counter.sjs | 96 + dom/base/test/bug819051.sjs | 9 + dom/base/test/chrome.ini | 42 + dom/base/test/chrome/bug418986-1.js | 88 + dom/base/test/chrome/bug421622-referer.sjs | 9 + dom/base/test/chrome/bug884693.sjs | 8 + dom/base/test/chrome/chrome.ini | 84 + dom/base/test/chrome/clonedoc/chrome.manifest | 1 + dom/base/test/chrome/clonedoc/content/doc.xml | 4 + dom/base/test/chrome/custom_element_ep.js | 14 + dom/base/test/chrome/file_bug1139964.xhtml | 60 + dom/base/test/chrome/file_bug1209621.xhtml | 85 + dom/base/test/chrome/file_bug549682.xhtml | 214 + dom/base/test/chrome/file_bug616841.xhtml | 63 + dom/base/test/chrome/file_bug816340.xhtml | 70 + dom/base/test/chrome/file_bug990812-1.xhtml | 61 + dom/base/test/chrome/file_bug990812-2.xhtml | 56 + dom/base/test/chrome/file_bug990812-3.xhtml | 68 + dom/base/test/chrome/file_bug990812-4.xhtml | 63 + dom/base/test/chrome/file_bug990812-5.xhtml | 74 + dom/base/test/chrome/file_bug990812.xhtml | 55 + .../file_document-element-inserted-inner.xhtml | 1 + .../chrome/file_document-element-inserted.xhtml | 3 + dom/base/test/chrome/file_title.xhtml | 1 + dom/base/test/chrome/fileconstructor_file.png | Bin 0 -> 95 bytes .../test/chrome/frame_custom_element_content.html | 5 + dom/base/test/chrome/nochrome_bug1346936.html | 3 + dom/base/test/chrome/nochrome_bug1346936.js | 4 + .../test/chrome/nochrome_bug1346936.js^headers^ | 1 + dom/base/test/chrome/nochrome_bug765993.html | 3 + dom/base/test/chrome/nochrome_bug765993.js | 4 + .../test/chrome/nochrome_bug765993.js^headers^ | 1 + dom/base/test/chrome/test_bug1063837.xhtml | 36 + ...test_bug1098074_throw_from_ReceiveMessage.xhtml | 46 + dom/base/test/chrome/test_bug1139964.xhtml | 32 + dom/base/test/chrome/test_bug120684.xhtml | 80 + dom/base/test/chrome/test_bug1209621.xhtml | 34 + dom/base/test/chrome/test_bug1339722.html | 86 + dom/base/test/chrome/test_bug1346936.html | 61 + dom/base/test/chrome/test_bug206691.xhtml | 32 + dom/base/test/chrome/test_bug289714.xhtml | 33 + dom/base/test/chrome/test_bug339494.xhtml | 62 + dom/base/test/chrome/test_bug357450.xhtml | 56 + dom/base/test/chrome/test_bug380418.html | 37 + dom/base/test/chrome/test_bug380418.html^headers^ | 4 + dom/base/test/chrome/test_bug383430.html | 38 + dom/base/test/chrome/test_bug418986-1.xhtml | 25 + dom/base/test/chrome/test_bug421622.xhtml | 34 + dom/base/test/chrome/test_bug429785.xhtml | 55 + dom/base/test/chrome/test_bug430050.xhtml | 50 + dom/base/test/chrome/test_bug467123.xhtml | 44 + dom/base/test/chrome/test_bug473284.xhtml | 83 + dom/base/test/chrome/test_bug549682.xhtml | 32 + dom/base/test/chrome/test_bug571390.xhtml | 42 + dom/base/test/chrome/test_bug616841.xhtml | 30 + dom/base/test/chrome/test_bug635835.xhtml | 36 + dom/base/test/chrome/test_bug682305.html | 150 + dom/base/test/chrome/test_bug683852.xhtml | 87 + dom/base/test/chrome/test_bug752226-3.xhtml | 28 + dom/base/test/chrome/test_bug752226-4.xhtml | 28 + dom/base/test/chrome/test_bug765993.html | 61 + dom/base/test/chrome/test_bug780199.xhtml | 51 + dom/base/test/chrome/test_bug780529.xhtml | 36 + dom/base/test/chrome/test_bug800386.xhtml | 65 + dom/base/test/chrome/test_bug816340.xhtml | 30 + dom/base/test/chrome/test_bug884693.xhtml | 82 + dom/base/test/chrome/test_bug914381.html | 58 + dom/base/test/chrome/test_bug990812.xhtml | 42 + .../test/chrome/test_chromeOuterWindowID.xhtml | 137 + .../test/chrome/test_custom_element_content.xhtml | 55 + dom/base/test/chrome/test_custom_element_ep.xhtml | 41 + .../chrome/test_document-element-inserted.xhtml | 54 + dom/base/test/chrome/test_domparsing.xhtml | 145 + dom/base/test/chrome/test_fileconstructor.xhtml | 86 + dom/base/test/chrome/test_getElementsWithGrid.html | 121 + .../test_input_value_set_preserve_undo.xhtml | 37 + .../test/chrome/test_nsITextInputProcessor.xhtml | 29 + ...ermission_hasValidTransientUserActivation.xhtml | 91 + .../chrome/test_range_getClientRectsAndTexts.html | 74 + dom/base/test/chrome/test_swapFrameLoaders.xhtml | 25 + dom/base/test/chrome/test_title.xhtml | 29 + dom/base/test/chrome/test_windowroot.xhtml | 18 + dom/base/test/chrome/title_window.xhtml | 197 + .../test/chrome/window_chromeOuterWindowID.xhtml | 14 + .../test/chrome/window_nsITextInputProcessor.xhtml | 4750 ++++++++++++++++++++ dom/base/test/chrome/window_swapFrameLoaders.xhtml | 225 + dom/base/test/common_postMessages.js | 393 ++ dom/base/test/copypaste.js | 553 +++ dom/base/test/delayedServerEvents.sjs | 56 + dom/base/test/dummy.html | 9 + dom/base/test/embed_bug455472.html | 1 + dom/base/test/empty.html | 0 dom/base/test/eventsource.resource | 22 + dom/base/test/eventsource.resource^headers^ | 3 + dom/base/test/eventsource_message.sjs | 12 + dom/base/test/eventsource_reconnect.sjs | 18 + dom/base/test/eventsource_redirect.resource | 2 + .../test/eventsource_redirect.resource^headers^ | 3 + dom/base/test/eventsource_redirect_to.resource | 4 + .../test/eventsource_redirect_to.resource^headers^ | 3 + dom/base/test/eventsource_worker.js | 6 + dom/base/test/fake_plugin.tst | 1 + dom/base/test/file1_setting_opener.html | 1 + dom/base/test/file2_setting_opener.html | 1 + dom/base/test/file3_setting_opener.html | 1 + dom/base/test/file4_setting_opener.html | 1 + dom/base/test/file_audioLoop.html | 2 + dom/base/test/file_audioLoopInIframe.html | 2 + dom/base/test/file_blocking_image.html | 10 + dom/base/test/file_browser_refresh_content.html | 41 + .../test/file_browser_refresh_expired_resource.sjs | 13 + dom/base/test/file_browser_refresh_iframe.sjs | 13 + dom/base/test/file_browser_refresh_image.sjs | 38 + .../test/file_browser_refresh_non_cacheable.sjs | 6 + dom/base/test/file_bug1008126_worker.js | 151 + dom/base/test/file_bug1011748_OK.sjs | 4 + dom/base/test/file_bug1011748_redirect.sjs | 5 + dom/base/test/file_bug1091883_frame.html | 13 + dom/base/test/file_bug1091883_subframe.html | 6 + dom/base/test/file_bug1091883_target.html | 13 + dom/base/test/file_bug1100912.html | 150 + dom/base/test/file_bug1198095.js | 38 + dom/base/test/file_bug1250148.sjs | 73 + dom/base/test/file_bug1268962.sjs | 92 + dom/base/test/file_bug1274806.html | 33 + dom/base/test/file_bug1303838.html | 34 + dom/base/test/file_bug1303838_target.html | 21 + dom/base/test/file_bug1303838_target_bar.html | 1 + dom/base/test/file_bug1303838_target_baz.html | 1 + dom/base/test/file_bug1303838_target_foo.html | 1 + dom/base/test/file_bug1303838_target_ibar.html | 1 + dom/base/test/file_bug1303838_target_ibaz.html | 1 + dom/base/test/file_bug1303838_target_ifoo.html | 1 + dom/base/test/file_bug1303838_with_iframe.html | 13 + dom/base/test/file_bug1554070_1.html | 14 + dom/base/test/file_bug1554070_2.html | 13 + dom/base/test/file_bug1639328.html | 8 + dom/base/test/file_bug1691214.html | 4 + dom/base/test/file_bug1700871.html | 18 + dom/base/test/file_bug1703472.html | 6 + dom/base/test/file_bug28293.sjs | 4 + dom/base/test/file_bug326337.xml | 1 + dom/base/test/file_bug326337_inner.html | 44 + dom/base/test/file_bug326337_outer.html | 15 + dom/base/test/file_bug357450.js | 74 + dom/base/test/file_bug416317.xhtml | 1468 ++++++ dom/base/test/file_bug426646-1.html | 37 + dom/base/test/file_bug426646-2.html | 65 + dom/base/test/file_bug428847-1.xhtml | 4 + dom/base/test/file_bug428847-2.xhtml | 4 + dom/base/test/file_bug498897.css | 1 + dom/base/test/file_bug498897.html | 23 + dom/base/test/file_bug498897.html^headers^ | 1 + dom/base/test/file_bug503473-frame.sjs | 22 + dom/base/test/file_bug503481.sjs | 54 + dom/base/test/file_bug503481b_inner.html | 62 + dom/base/test/file_bug518104.js | 3 + dom/base/test/file_bug541937.html | 7 + dom/base/test/file_bug541937.xhtml | 12 + dom/base/test/file_bug557892.html | 25 + dom/base/test/file_bug562137.txt | 1 + dom/base/test/file_bug590812-ref.xhtml | 3 + dom/base/test/file_bug590812.xml | 1 + dom/base/test/file_bug590870.html | 16 + dom/base/test/file_bug601803a.html | 22 + dom/base/test/file_bug601803b.html | 11 + dom/base/test/file_bug604660-1.xml | 3 + dom/base/test/file_bug604660-2.xsl | 19 + dom/base/test/file_bug604660-3.js | 1 + dom/base/test/file_bug604660-4.js | 1 + dom/base/test/file_bug604660-5.xml | 2 + dom/base/test/file_bug604660-6.xsl | 9 + dom/base/test/file_bug622088.sjs | 5 + dom/base/test/file_bug622088_inner.html | 38 + dom/base/test/file_bug675121.sjs | 19 + dom/base/test/file_bug687859-16.js | Bin 0 -> 64 bytes dom/base/test/file_bug687859-16.js^headers^ | 1 + dom/base/test/file_bug687859-bom.js | 1 + dom/base/test/file_bug687859-bom.js^headers^ | 1 + dom/base/test/file_bug687859-charset.js | 1 + dom/base/test/file_bug687859-http.js | 1 + dom/base/test/file_bug687859-http.js^headers^ | 1 + dom/base/test/file_bug687859-inherit.js | 1 + dom/base/test/file_bug692434.xml | 1 + dom/base/test/file_bug704320_preload_attr.html | 32 + dom/base/test/file_bug704320_preload_common.js | 32 + dom/base/test/file_bug704320_preload_reuse.html | 31 + dom/base/test/file_bug704320_redirect.html | 10 + dom/base/test/file_bug707142_baseline.json | 1 + dom/base/test/file_bug707142_bom.json | 1 + dom/base/test/file_bug707142_utf-16.json | Bin 0 -> 32 bytes dom/base/test/file_bug708620-2.html | 4 + dom/base/test/file_bug708620.html | 7 + dom/base/test/file_bug753278.html | 1 + dom/base/test/file_bug769117.html | 16 + dom/base/test/file_bug782342.txt | 1 + dom/base/test/file_bug787778.sjs | 7 + dom/base/test/file_bug869432.eventsource | 4 + dom/base/test/file_bug869432.eventsource^headers^ | 3 + dom/base/test/file_bug902350.html | 19 + dom/base/test/file_bug902350_frame.html | 14 + dom/base/test/file_bug907892.html | 12 + dom/base/test/file_bug945152.jar | Bin 0 -> 92275 bytes dom/base/test/file_bug945152_worker.js | 99 + dom/base/test/file_change_policy_redirect.html | 10 + dom/base/test/file_current_inner_window.html | 24 + dom/base/test/file_delazification_strategy.html | 10 + dom/base/test/file_delazification_strategy.js | 91 + dom/base/test/file_domwindowutils_animation.html | 217 + .../test/file_domwindowutils_dynamic_toolbar.html | 23 + dom/base/test/file_empty.html | 1 + dom/base/test/file_explicit_user_agent.sjs | 6 + dom/base/test/file_external_script.html | 11 + dom/base/test/file_external_script.xhtml | 11 + dom/base/test/file_focus_design_mode_inner.html | 32 + ...le_focus_display_none_xorigin_iframe_inner.html | 15 + dom/base/test/file_focus_shadow_dom.html | 999 ++++ dom/base/test/file_general_document.html | 10 + dom/base/test/file_history_document_open.html | 1 + dom/base/test/file_htmlserializer_1.html | 44 + dom/base/test/file_htmlserializer_1_bodyonly.html | 43 + dom/base/test/file_htmlserializer_1_format.html | 57 + dom/base/test/file_htmlserializer_1_linebreak.html | 47 + dom/base/test/file_htmlserializer_1_links.html | 47 + .../test/file_htmlserializer_1_nested_body.html | 47 + dom/base/test/file_htmlserializer_1_no_body.html | 5 + dom/base/test/file_htmlserializer_1_noflag.html | 47 + .../test/file_htmlserializer_1_noformatpre.html | 51 + dom/base/test/file_htmlserializer_1_raw.html | 45 + .../test/file_htmlserializer_1_sibling_body.html | 47 + ...le_htmlserializer_1_sibling_body_only_body.html | 43 + dom/base/test/file_htmlserializer_1_wrap.html | 52 + dom/base/test/file_htmlserializer_2.html | 22 + dom/base/test/file_htmlserializer_2_basic.html | 24 + dom/base/test/file_htmlserializer_ipv6.html | 5 + dom/base/test/file_htmlserializer_ipv6_out.html | 6 + dom/base/test/file_inline_script.html | 11 + dom/base/test/file_inline_script.xhtml | 11 + dom/base/test/file_js_cache.html | 10 + dom/base/test/file_js_cache.js | 5 + dom/base/test/file_js_cache_module.html | 13 + dom/base/test/file_js_cache_save_after_load.html | 10 + dom/base/test/file_js_cache_save_after_load.js | 15 + dom/base/test/file_js_cache_syntax_error.html | 10 + dom/base/test/file_js_cache_syntax_error.js | 1 + dom/base/test/file_js_cache_with_sri.html | 12 + .../test/file_location_href_unknown_protocol.html | 15 + ...e_lock_orientation_with_pending_fullscreen.html | 22 + dom/base/test/file_messagemanager_unload.html | 6 + dom/base/test/file_module_js_cache.html | 10 + dom/base/test/file_module_js_cache.js | 6 + dom/base/test/file_module_js_cache_no_module.html | 10 + dom/base/test/file_module_js_cache_with_sri.html | 12 + dom/base/test/file_mozfiledataurl_img.jpg | Bin 0 -> 2711 bytes .../file_navigator_resolve_identity_xrays.xhtml | 29 + dom/base/test/file_receiveMessage.html | 13 + dom/base/test/file_restrictedEventSource.sjs | 69 + dom/base/test/file_sandbox_and_document_uri.html | 34 + dom/base/test/file_script.js | 1 + .../file_script_module_dynamic_and_element.html | 10 + .../test/file_script_module_dynamic_and_element.js | 19 + ...script_module_dynamic_and_element_imported_1.js | 6 + ...script_module_dynamic_and_element_imported_2.js | 1 + ...script_module_dynamic_and_element_imported_3.js | 1 + .../file_script_module_dynamic_and_static.html | 10 + .../test/file_script_module_dynamic_and_static.js | 10 + ..._script_module_dynamic_and_static_imported_1.js | 4 + ..._script_module_dynamic_and_static_imported_2.js | 4 + ..._script_module_dynamic_and_static_imported_3.js | 1 + .../test/file_script_module_dynamic_import.html | 10 + dom/base/test/file_script_module_dynamic_import.js | 4 + .../file_script_module_dynamic_import_imported.js | 1 + .../file_script_module_element_and_dynamic.html | 10 + .../test/file_script_module_element_and_dynamic.js | 10 + ...script_module_element_and_dynamic_imported_1.js | 12 + ...script_module_element_and_dynamic_imported_2.js | 1 + ...script_module_element_and_dynamic_imported_3.js | 1 + .../file_script_module_element_and_import.html | 10 + .../test/file_script_module_element_and_import.js | 8 + ..._script_module_element_and_import_imported_1.js | 12 + ..._script_module_element_and_import_imported_2.js | 1 + ..._script_module_element_and_import_imported_3.js | 1 + .../test/file_script_module_frames_dynamic.html | 24 + .../file_script_module_frames_dynamic_load.html | 19 + .../test/file_script_module_frames_dynamic_load.js | 4 + .../file_script_module_frames_dynamic_save.html | 19 + .../test/file_script_module_frames_dynamic_save.js | 4 + .../file_script_module_frames_dynamic_shared.js | 1 + .../test/file_script_module_frames_element.html | 24 + .../file_script_module_frames_element_load.html | 19 + .../file_script_module_frames_element_save.html | 19 + .../file_script_module_frames_element_shared.js | 1 + .../test/file_script_module_frames_import.html | 24 + .../file_script_module_frames_import_load.html | 19 + .../test/file_script_module_frames_import_load.js | 4 + .../file_script_module_frames_import_save.html | 19 + .../test/file_script_module_frames_import_save.js | 4 + .../file_script_module_frames_import_shared.js | 1 + dom/base/test/file_script_module_frames_relay.js | 22 + dom/base/test/file_script_module_import.html | 10 + dom/base/test/file_script_module_import.js | 4 + .../file_script_module_import_and_element.html | 10 + .../test/file_script_module_import_and_element.js | 17 + ..._script_module_import_and_element_imported_1.js | 6 + ..._script_module_import_and_element_imported_2.js | 1 + ..._script_module_import_and_element_imported_3.js | 1 + .../test/file_script_module_import_imported.js | 1 + dom/base/test/file_script_module_import_multi.html | 10 + dom/base/test/file_script_module_import_multi.js | 6 + .../file_script_module_import_multi_elems.html | 10 + .../file_script_module_import_multi_elems_1.js | 14 + .../file_script_module_import_multi_elems_2.js | 6 + ...pt_module_import_multi_elems_imported_once_1.js | 1 + ...pt_module_import_multi_elems_imported_once_2.js | 1 + ...pt_module_import_multi_elems_imported_once_3.js | 1 + ...ipt_module_import_multi_elems_imported_twice.js | 3 + ...ile_script_module_import_multi_imported_once.js | 4 + ...le_script_module_import_multi_imported_twice.js | 1 + dom/base/test/file_script_module_single.html | 10 + dom/base/test/file_script_module_single.js | 8 + dom/base/test/file_script_module_sri_basic.html | 11 + dom/base/test/file_script_module_sri_basic.js | 1 + .../test/file_script_module_sri_basic_prep.html | 11 + .../test/file_script_module_sri_dynamic_elem.html | 12 + .../test/file_script_module_sri_dynamic_elem.js | 4 + ...file_script_module_sri_dynamic_elem_imported.js | 3 + ...e_script_module_sri_dynamic_elem_nopreload.html | 10 + ...ile_script_module_sri_dynamic_elem_nopreload.js | 20 + ...t_module_sri_dynamic_elem_nopreload_imported.js | 3 + ...ipt_module_sri_dynamic_elem_nopreload_prep.html | 10 + .../file_script_module_sri_dynamic_elem_prep.html | 10 + .../test/file_script_module_sri_elem_dynamic.html | 12 + .../test/file_script_module_sri_elem_dynamic.js | 4 + ...file_script_module_sri_elem_dynamic_imported.js | 3 + .../file_script_module_sri_elem_dynamic_prep.html | 10 + .../test/file_script_module_sri_elem_elem_1.html | 12 + .../test/file_script_module_sri_elem_elem_1.js | 1 + .../file_script_module_sri_elem_elem_1_prep.html | 10 + .../test/file_script_module_sri_elem_elem_2.html | 12 + .../test/file_script_module_sri_elem_elem_2.js | 1 + .../file_script_module_sri_elem_elem_2_prep.html | 10 + .../test/file_script_module_sri_elem_import.html | 12 + .../test/file_script_module_sri_elem_import.js | 4 + .../file_script_module_sri_elem_import_imported.js | 3 + .../file_script_module_sri_elem_import_prep.html | 10 + dom/base/test/file_script_module_sri_fallback.html | 11 + dom/base/test/file_script_module_sri_fallback.js | 1 + .../file_script_module_sri_fallback_failure.html | 15 + .../file_script_module_sri_fallback_failure.js | 1 + ...le_script_module_sri_fallback_failure_prep.html | 10 + .../test/file_script_module_sri_fallback_prep.html | 10 + .../test/file_script_module_sri_import_elem.html | 12 + .../test/file_script_module_sri_import_elem.js | 4 + .../file_script_module_sri_import_elem_imported.js | 3 + ...le_script_module_sri_import_elem_nopreload.html | 10 + ...file_script_module_sri_import_elem_nopreload.js | 18 + ...pt_module_sri_import_elem_nopreload_imported.js | 3 + ...ript_module_sri_import_elem_nopreload_prep.html | 10 + .../file_script_module_sri_import_elem_prep.html | 10 + .../file_script_module_static_and_dynamic.html | 10 + .../test/file_script_module_static_and_dynamic.js | 8 + ..._script_module_static_and_dynamic_imported_1.js | 4 + ..._script_module_static_and_dynamic_imported_2.js | 6 + ..._script_module_static_and_dynamic_imported_3.js | 1 + dom/base/test/file_serializer_noscript.html | 1 + dom/base/test/file_setname.html | 8 + dom/base/test/file_settimeout_inner.html | 1 + .../test/file_suppressed_events_and_scrolling.html | 30 + dom/base/test/file_suppressed_events_inner.html | 16 + dom/base/test/file_suppressed_events_middle.html | 10 + dom/base/test/file_suppressed_events_top.html | 79 + .../file_suppressed_events_top_modalstate.html | 79 + dom/base/test/file_suppressed_events_top_xhr.html | 82 + dom/base/test/file_timer_flood.html | 19 + dom/base/test/file_title.xhtml | 1 + dom/base/test/file_toScreenRect.html | 48 + dom/base/test/file_use_counter_bfcache.html | 38 + dom/base/test/file_use_counter_bfcache_helper.html | 40 + dom/base/test/file_use_counter_outer.html | 17 + .../test/file_use_counter_outer_display_none.html | 16 + dom/base/test/file_use_counter_style.html | 14 + .../test/file_use_counter_svg_currentScale.svg | 17 + .../test/file_use_counter_svg_fill_pattern.svg | 16 + .../file_use_counter_svg_fill_pattern_data.svg | 13 + ...ile_use_counter_svg_fill_pattern_definition.svg | 12 + .../file_use_counter_svg_fill_pattern_internal.svg | 24 + .../test/file_use_counter_svg_getElementById.svg | 22 + ...file_viewport_metrics_on_landscape_content.html | 65 + dom/base/test/file_viewport_scroll_quirks.html | 1 + dom/base/test/file_viewport_scroll_xml.xml | 1 + dom/base/test/file_webaudio_startstop.html | 36 + dom/base/test/file_window_close.html | 68 + dom/base/test/file_window_close_2.html | 4 + .../test/file_window_focus_by_close_and_open.html | 13 + dom/base/test/file_x-frame-options_main.html | 44 + dom/base/test/file_x-frame-options_page.sjs | 67 + dom/base/test/file_xhtmlserializer_1.xhtml | 60 + .../test/file_xhtmlserializer_1_bodyonly.xhtml | 56 + dom/base/test/file_xhtmlserializer_1_format.xhtml | 71 + .../test/file_xhtmlserializer_1_linebreak.xhtml | 65 + dom/base/test/file_xhtmlserializer_1_links.xhtml | 65 + .../test/file_xhtmlserializer_1_nested_body.xhtml | 65 + dom/base/test/file_xhtmlserializer_1_no_body.xhtml | 10 + dom/base/test/file_xhtmlserializer_1_noflag.xhtml | 65 + .../test/file_xhtmlserializer_1_noformatpre.xhtml | 69 + dom/base/test/file_xhtmlserializer_1_raw.xhtml | 60 + .../test/file_xhtmlserializer_1_sibling_body.xhtml | 65 + ..._xhtmlserializer_1_sibling_body_only_body.xhtml | 56 + dom/base/test/file_xhtmlserializer_1_wrap.xhtml | 70 + dom/base/test/file_xhtmlserializer_2.xhtml | 30 + dom/base/test/file_xhtmlserializer_2_basic.xhtml | 31 + dom/base/test/file_xhtmlserializer_2_enthtml.xhtml | 55 + dom/base/test/file_xhtmlserializer_2_entw3c.xhtml | 55 + dom/base/test/file_xhtmlserializer_2_latin1.xhtml | 41 + dom/base/test/file_youtube_flash_embed.html | 65 + dom/base/test/fmm/browser.ini | 1 + .../fmm/browser_frame_message_manager_cache.js | 23 + dom/base/test/forRemoval.resource | 24 + dom/base/test/forRemoval.resource^headers^ | 3 + dom/base/test/formReset.html | 15 + .../test/fullscreen/MozDomFullscreen_chrome.xhtml | 108 + dom/base/test/fullscreen/browser.ini | 40 + .../test/fullscreen/browser_fullscreen-api-keys.js | 218 + .../fullscreen/browser_fullscreen-bug-1798219.js | 127 + .../browser_fullscreen-contextmenu-esc.js | 128 + ...wser_fullscreen-document-mutation-navigation.js | 141 + .../browser_fullscreen-document-mutation-race.js | 122 + .../browser_fullscreen-document-mutation.js | 118 + .../browser_fullscreen-navigation-history.js | 100 + .../browser_fullscreen-navigation-race.js | 162 + .../fullscreen/browser_fullscreen-navigation.js | 142 + .../test/fullscreen/browser_fullscreen-newtab.js | 91 + .../test/fullscreen/browser_fullscreen-sizemode.js | 225 + .../browser_fullscreen-tab-close-race.js | 101 + .../fullscreen/browser_fullscreen-tab-close.js | 65 + .../browser_fullscreen-window-open-race.js | 73 + ...browser_fullscreen_exit_on_external_protocol.js | 215 + dom/base/test/fullscreen/chrome.ini | 10 + dom/base/test/fullscreen/dummy_page.html | 10 + .../test/fullscreen/file_MozDomFullscreen.html | 8 + .../test/fullscreen/file_fullscreen-api-keys.html | 41 + .../test/fullscreen/file_fullscreen-api-race.html | 8 + dom/base/test/fullscreen/file_fullscreen-api.html | 340 ++ .../test/fullscreen/file_fullscreen-async.html | 50 + .../test/fullscreen/file_fullscreen-backdrop.html | 107 + .../fullscreen/file_fullscreen-bug-1798219-2.html | 22 + .../fullscreen/file_fullscreen-bug-1798219.html | 14 + .../fullscreen/file_fullscreen-denied-inner.html | 24 + .../test/fullscreen/file_fullscreen-denied.html | 171 + .../fullscreen/file_fullscreen-esc-exit-inner.html | 58 + .../test/fullscreen/file_fullscreen-esc-exit.html | 63 + .../fullscreen/file_fullscreen-event-order.html | 50 + .../file_fullscreen-featurePolicy-inner.html | 34 + .../fullscreen/file_fullscreen-featurePolicy.html | 90 + .../fullscreen/file_fullscreen-focus-inner.html | 24 + .../test/fullscreen/file_fullscreen-focus.html | 67 + .../test/fullscreen/file_fullscreen-hidden.html | 56 + .../fullscreen/file_fullscreen-iframe-inner.html | 5 + .../fullscreen/file_fullscreen-iframe-middle.html | 5 + .../fullscreen/file_fullscreen-iframe-top.html | 5 + .../file_fullscreen-lenient-setters.html | 61 + .../fullscreen/file_fullscreen-multiple-inner.html | 25 + .../test/fullscreen/file_fullscreen-multiple.html | 67 + .../fullscreen/file_fullscreen-navigation.html | 52 + .../test/fullscreen/file_fullscreen-nested.html | 130 + .../test/fullscreen/file_fullscreen-newtab.html | 4 + .../test/fullscreen/file_fullscreen-prefixed.html | 153 + .../test/fullscreen/file_fullscreen-resize.html | 39 + .../test/fullscreen/file_fullscreen-rollback.html | 140 + .../test/fullscreen/file_fullscreen-scrollbar.html | 147 + .../test/fullscreen/file_fullscreen-selector.html | 183 + .../test/fullscreen/file_fullscreen-shadowdom.html | 52 + .../test/fullscreen/file_fullscreen-single.html | 78 + .../fullscreen/file_fullscreen-sub-iframe.html | 53 + .../fullscreen/file_fullscreen-svg-element.html | 49 + .../test/fullscreen/file_fullscreen-table.html | 52 + .../test/fullscreen/file_fullscreen-top-layer.html | 160 + dom/base/test/fullscreen/file_fullscreen-utils.js | 87 + .../fullscreen/file_fullscreen-with-full-zoom.html | 36 + .../fullscreen/file_fullscreen_meta_viewport.html | 12 + dom/base/test/fullscreen/fullscreen.xhtml | 27 + dom/base/test/fullscreen/fullscreen_helpers.js | 174 + dom/base/test/fullscreen/head.js | 65 + dom/base/test/fullscreen/mochitest.ini | 51 + dom/base/test/fullscreen/moz.build | 17 + .../fullscreen/test_MozDomFullscreen_event.xhtml | 46 + .../test/fullscreen/test_fullscreen-api-race.html | 177 + .../test_fullscreen-api-rapid-cycle.html | 167 + dom/base/test/fullscreen/test_fullscreen-api.html | 150 + dom/base/test/fullscreen/test_fullscreen.xhtml | 37 + .../fullscreen/test_fullscreen_meta_viewport.html | 33 + .../test/fullscreen/test_fullscreen_modal.html | 68 + dom/base/test/green.png | Bin 0 -> 255 bytes dom/base/test/gtest/TestContentUtils.cpp | 146 + dom/base/test/gtest/TestMimeType.cpp | 816 ++++ dom/base/test/gtest/TestParser.cpp | 52 + dom/base/test/gtest/TestPlainTextSerializer.cpp | 309 ++ dom/base/test/gtest/TestScheduler.cpp | 348 ++ .../test/gtest/TestXMLSerializerNoBreakLink.cpp | 69 + dom/base/test/gtest/TestXPathGenerator.cpp | 150 + dom/base/test/gtest/moz.build | 21 + dom/base/test/head.js | 15 + dom/base/test/iframe1_bug1640766.html | 20 + dom/base/test/iframe1_bug426646.html | 1 + dom/base/test/iframe1_bug431701.html | 1 + dom/base/test/iframe2_bug1640766.html | 10 + dom/base/test/iframe2_bug426646.html | 1 + dom/base/test/iframe2_bug431701.html | 1 + dom/base/test/iframe3_bug431701.html | 1 + dom/base/test/iframe4_bug431701.xml | 1 + dom/base/test/iframe5_bug431701.xml | 1 + dom/base/test/iframe6_bug431701.xml | 1 + dom/base/test/iframe7_bug431701.xml | 1 + dom/base/test/iframe_bug962251.html | 25 + dom/base/test/iframe_bug976673.html | 26 + dom/base/test/iframe_main_bug1022229.html | 33 + dom/base/test/iframe_meta_refresh.sjs | 92 + dom/base/test/iframe_postMessage_solidus.html | 15 + dom/base/test/iframe_postMessages.html | 14 + dom/base/test/iframe_sandbox_bug1022229.html | 13 + dom/base/test/iframe_shared_compartment2a.html | 2 + dom/base/test/iframe_shared_compartment2b.html | 3 + .../intersectionobserver_cross_domain_iframe.html | 24 + dom/base/test/intersectionobserver_iframe.html | 17 + dom/base/test/intersectionobserver_window.html | 46 + dom/base/test/invalid_accesscontrol.resource | 7 + .../test/invalid_accesscontrol.resource^headers^ | 4 + dom/base/test/jsmodules/.eslintrc.js | 7 + dom/base/test/jsmodules/chrome.ini | 53 + .../test/jsmodules/iframe_extractIntroType.html | 14 + dom/base/test/jsmodules/importmaps/chrome.ini | 29 + .../jsmodules/importmaps/external_importMap.js | 5 + .../jsmodules/importmaps/insert_a_base_element.js | 4 + .../jsmodules/importmaps/module_simpleExport.js | 1 + .../jsmodules/importmaps/module_simpleImportMap.js | 2 + .../importmaps/module_simpleImportMap_dir.js | 2 + .../importmaps/module_simpleImportMap_remap.js | 2 + .../module_simpleImportMap_remap_https.js | 2 + .../jsmodules/importmaps/module_sortedImportMap.js | 4 + dom/base/test/jsmodules/importmaps/moz.build | 7 + .../importmaps/scope1/module_simpleExport.js | 1 + .../importmaps/scope1/module_simpleImportMap.js | 2 + .../scope1/scope2/module_simpleExport.js | 1 + .../scope1/scope2/module_simpleImportMap.js | 2 + .../test_dynamic_import_reject_importMap.html | 46 + .../importmaps/test_externalImportMap.html | 43 + .../test_import_meta_resolve_importMap.html | 49 + .../test_inline_module_reject_importMap.html | 61 + .../importmaps/test_load_importMap_with_base.html | 51 + .../importmaps/test_load_importMap_with_base2.html | 51 + .../test_module_script_reject_importMap.html | 45 + .../importmaps/test_parse_importMap_failed.html | 40 + .../test_reject_multiple_importMaps.html | 64 + .../jsmodules/importmaps/test_simpleImportMap.html | 62 + .../jsmodules/importmaps/test_sortedImportMap.html | 62 + dom/base/test/jsmodules/module_badImport.js | 1 + dom/base/test/jsmodules/module_badSyntax.js | 3 + dom/base/test/jsmodules/module_cyclic1.js | 8 + dom/base/test/jsmodules/module_cyclic2.js | 8 + dom/base/test/jsmodules/module_cyclic3.js | 8 + dom/base/test/jsmodules/module_extractIntroType.js | 5 + dom/base/test/jsmodules/module_large1.js | 78 + dom/base/test/jsmodules/module_large2.js | 78 + dom/base/test/jsmodules/module_large3.js | 78 + dom/base/test/jsmodules/module_missingImport.js | 1 + dom/base/test/jsmodules/module_multiImports.js | 4 + .../test/jsmodules/module_multiLargeImports.js | 4 + dom/base/test/jsmodules/module_setRan.js | 2 + dom/base/test/jsmodules/module_simple1.js | 1 + dom/base/test/jsmodules/module_simple2.js | 1 + dom/base/test/jsmodules/module_simple3.js | 1 + dom/base/test/jsmodules/module_simpleExport.js | 1 + dom/base/test/jsmodules/module_simpleImport.js | 2 + dom/base/test/jsmodules/module_testSyntax.js | 3 + dom/base/test/jsmodules/moz.build | 7 + dom/base/test/jsmodules/script_simple2.js | 1 + .../test/jsmodules/test_asyncInlineModules.html | 36 + dom/base/test/jsmodules/test_cyclicImport.html | 18 + .../jsmodules/test_dynamicImportErrorMessage.html | 16 + dom/base/test/jsmodules/test_importIntroType.html | 22 + dom/base/test/jsmodules/test_importNotFound.html | 27 + .../test/jsmodules/test_importResolveFailed.html | 21 + .../test/jsmodules/test_import_meta_resolve.html | 65 + .../jsmodules/test_importedModuleMemoization.html | 30 + .../test/jsmodules/test_linkErrorInCommon1.html | 32 + .../test/jsmodules/test_linkErrorInCommon2.html | 32 + dom/base/test/jsmodules/test_moduleNotFound.html | 24 + .../test/jsmodules/test_moduleParsedAsModule.html | 23 + dom/base/test/jsmodules/test_moduleScriptsRun.html | 19 + .../test/jsmodules/test_multiAsyncImports.html | 30 + .../test/jsmodules/test_multiModuleImports.html | 28 + .../jsmodules/test_multiModuleLargeImports.html | 28 + .../test/jsmodules/test_multiTopLevelImports.html | 30 + .../jsmodules/test_multiTopLevelLargeImports.html | 30 + .../test/jsmodules/test_scriptInsertedModule.html | 20 + .../test/jsmodules/test_scriptModuleOrder.html | 30 + .../jsmodules/test_scriptNotParsedAsModule.html | 23 + dom/base/test/jsmodules/test_simpleImport.html | 16 + dom/base/test/jsmodules/test_syntaxError.html | 30 + dom/base/test/jsmodules/test_syntaxErrorAsync.html | 30 + .../test/jsmodules/test_syntaxErrorInline.html | 34 + .../jsmodules/test_syntaxErrorInlineAsync.html | 34 + .../test/jsmodules/test_topLevelIntroType.html | 21 + .../jsmodules/test_toplevelModuleMemoization.html | 30 + .../jsmodules/test_typeAttrCaseInsensitive.html | 19 + dom/base/test/meta_viewport/mochitest.ini | 54 + dom/base/test/meta_viewport/moz.build | 9 + .../test/meta_viewport/test_meta_viewport0.html | 41 + .../test/meta_viewport/test_meta_viewport1.html | 41 + .../test/meta_viewport/test_meta_viewport2.html | 41 + .../test/meta_viewport/test_meta_viewport3.html | 43 + .../test/meta_viewport/test_meta_viewport4.html | 42 + .../test/meta_viewport/test_meta_viewport5.html | 24 + .../test/meta_viewport/test_meta_viewport6.html | 47 + .../test/meta_viewport/test_meta_viewport7.html | 71 + .../test/meta_viewport/test_meta_viewport8.html | 27 + ...t_meta_viewport_auto_size_by_device_height.html | 24 + ...st_meta_viewport_auto_size_by_device_width.html | 24 + ...o_size_by_fixed_height_and_initial_scale_1.html | 25 + ...auto_size_by_fixed_width_and_device_height.html | 25 + ...to_size_by_fixed_width_and_initial_scale_1.html | 25 + ...ta_viewport_auto_size_by_initial_scale_0_5.html | 25 + ...meta_viewport_auto_size_by_initial_scale_1.html | 25 + ...t_meta_viewport_auto_size_by_invalid_width.html | 24 + ...uto_size_by_invalid_width_and_fixed_height.html | 25 + ...eta_viewport_change_content_among_multiple.html | 52 + .../test_meta_viewport_change_name.html | 47 + ...t_meta_viewport_change_name_among_multiple.html | 44 + .../test_meta_viewport_device_width.html | 25 + ...ewport_device_width_with_initial_scale_0_5.html | 26 + ...viewport_device_width_with_initial_scale_2.html | 31 + ...wport_empty_content_and_valid_content_tags.html | 26 + .../test/meta_viewport/test_meta_viewport_fit.html | 34 + .../test_meta_viewport_fit_multiple.html | 25 + ...iewport_fixed_width_and_zero_display_width.html | 29 + .../test_meta_viewport_initial_scale_0_5.html | 33 + .../test_meta_viewport_initial_scale_2.html | 26 + ...ort_initial_scale_with_trailing_characters.html | 26 + ...t_meta_viewport_insert_before_existing_tag.html | 32 + .../test_meta_viewport_maximum_scale_0.html | 28 + .../test_meta_viewport_maximum_scale_0_5.html | 29 + .../test_meta_viewport_maximum_scale_2.html | 26 + .../test_meta_viewport_multiple_tags.html | 28 + ...iewport_negative_width_and_negative_height.html | 27 + ...meta_viewport_negative_width_and_no_height.html | 25 + ...a_viewport_negative_width_and_valid_height.html | 25 + ...viewport_no_content_and_valid_content_tags.html | 25 + ...meta_viewport_no_width_and_negative_height.html | 26 + ...st_meta_viewport_no_width_and_valid_height.html | 25 + .../test_meta_viewport_remove_node.html | 34 + ...st_meta_viewport_remove_node_from_multiple.html | 44 + ...t_meta_viewport_removing_content_attribute.html | 33 + .../test_meta_viewport_replace_content.html | 39 + .../test_meta_viewport_tiny_display_size.html | 28 + ...a_viewport_valid_width_and_negative_height.html | 26 + ...st_meta_viewport_valid_width_and_no_height.html | 26 + ...ta_viewport_width_with_trailing_characters.html | 26 + dom/base/test/meta_viewport/viewport_helpers.js | 44 + dom/base/test/mochitest.ini | 1111 +++++ dom/base/test/moz.build | 44 + dom/base/test/object_bug353334.html | 1 + dom/base/test/object_bug455472.html | 1 + dom/base/test/red.png | Bin 0 -> 87 bytes dom/base/test/referrerHelper.js | 343 ++ dom/base/test/referrer_change_server.sjs | 166 + dom/base/test/referrer_header.sjs | 6 + dom/base/test/referrer_helper.js | 133 + dom/base/test/referrer_testserver.sjs | 693 +++ dom/base/test/reftest/mixed-bmp-png.ico | Bin 0 -> 17542 bytes dom/base/test/reftest/reftest.list | 7 + dom/base/test/reftest/test_bug1525662-ref.html | 15 + dom/base/test/reftest/test_bug1525662.txt | 7 + dom/base/test/reftest/test_bug920877-ref.html | 20 + dom/base/test/reftest/test_bug920877.html | 38 + .../test/reftest/test_xmlPrettyPrint_csp-ref.xml | 4 + dom/base/test/reftest/test_xmlPrettyPrint_csp.xml | 4 + .../reftest/test_xmlPrettyPrint_csp.xml^headers^ | 1 + dom/base/test/script-1_bug597345.sjs | 22 + dom/base/test/script-2_bug597345.js | 1 + dom/base/test/script_bug1238440.js | 33 + dom/base/test/script_bug602838.sjs | 43 + dom/base/test/script_postmessages_fileList.js | 26 + dom/base/test/send_gzip_content.sjs | 46 + dom/base/test/slow.sjs | 15 + dom/base/test/somedatas.resource | 16 + dom/base/test/somedatas.resource^headers^ | 3 + dom/base/test/test_EventSource_redirects.html | 53 + dom/base/test/test_Image_constructor.html | 32 + .../test/test_NodeIterator_basics_filters.xhtml | 178 + dom/base/test/test_NodeIterator_mutations_1.xhtml | 204 + dom/base/test/test_NodeIterator_mutations_2.html | 112 + dom/base/test/test_NodeIterator_mutations_3.html | 160 + dom/base/test/test_anchor_area_referrer.html | 127 + .../test/test_anchor_area_referrer_changing.html | 66 + .../test/test_anchor_area_referrer_invalid.html | 74 + dom/base/test/test_anchor_area_referrer_rel.html | 50 + .../test/test_anchor_target_blank_referrer.html | 134 + dom/base/test/test_anonymousContent_api.html | 56 + .../test_anonymousContent_append_after_reflow.html | 40 + dom/base/test/test_anonymousContent_canvas.html | 59 + dom/base/test/test_anonymousContent_insert.html | 45 + .../test_anonymousContent_manipulate_content.html | 74 + dom/base/test/test_anonymousContent_set_style.html | 35 + dom/base/test/test_anonymousContent_style_csp.html | 28 + .../test_anonymousContent_style_csp.html^headers^ | 1 + .../test/test_anonymousContent_xul_window.xhtml | 23 + dom/base/test/test_appname_override.html | 26 + dom/base/test/test_async_setTimeout_stack.html | 60 + ...test_async_setTimeout_stack_across_globals.html | 60 + dom/base/test/test_base.xhtml | 39 + dom/base/test/test_blockParsing.html | 134 + dom/base/test/test_blocking_image.html | 94 + dom/base/test/test_bug1008126.html | 62 + dom/base/test/test_bug1016960.html | 30 + dom/base/test/test_bug1022229.html | 33 + dom/base/test/test_bug1025933.html | 41 + dom/base/test/test_bug1037687.html | 32 + dom/base/test/test_bug1037687_subframe.html | 46 + dom/base/test/test_bug1043106.html | 44 + dom/base/test/test_bug1057176.html | 32 + dom/base/test/test_bug1060938.html | 44 + dom/base/test/test_bug1064481.html | 24 + dom/base/test/test_bug1070015.html | 53 + dom/base/test/test_bug1075702.html | 77 + dom/base/test/test_bug1091883.html | 89 + dom/base/test/test_bug1100912.html | 35 + dom/base/test/test_bug1101364.html | 93 + dom/base/test/test_bug1118689.html | 40 + dom/base/test/test_bug1120222.html | 31 + dom/base/test/test_bug1126851.html | 44 + dom/base/test/test_bug116083.html | 120 + dom/base/test/test_bug1163743.html | 44 + dom/base/test/test_bug1165501.html | 51 + dom/base/test/test_bug1187157.html | 30 + dom/base/test/test_bug1198095.html | 71 + dom/base/test/test_bug1222633.html | 112 + dom/base/test/test_bug1222633_link_update.html | 129 + dom/base/test/test_bug1238440.html | 88 + dom/base/test/test_bug1250148.html | 64 + dom/base/test/test_bug1259588.html | 13 + dom/base/test/test_bug1268962.html | 104 + dom/base/test/test_bug1274806.html | 31 + dom/base/test/test_bug1281963.html | 56 + dom/base/test/test_bug1295852.html | 23 + dom/base/test/test_bug1307730.html | 44 + dom/base/test/test_bug1308069.html | 87 + dom/base/test/test_bug1314032.html | 38 + dom/base/test/test_bug1318303.html | 49 + dom/base/test/test_bug1375050.html | 33 + dom/base/test/test_bug1381710.html | 40 + dom/base/test/test_bug1399605.html | 32 + dom/base/test/test_bug1404385.html | 31 + dom/base/test/test_bug1406102.html | 41 + dom/base/test/test_bug1421568.html | 48 + dom/base/test/test_bug1433073.html | 89 + dom/base/test/test_bug1472427.html | 89 + dom/base/test/test_bug1499169.html | 32 + dom/base/test/test_bug1576154.html | 36 + dom/base/test/test_bug1632975.html | 54 + dom/base/test/test_bug1639328.html | 68 + dom/base/test/test_bug1640766.html | 67 + dom/base/test/test_bug1648887.html | 34 + dom/base/test/test_bug166235.html | 156 + dom/base/test/test_bug1667316.html | 153 + dom/base/test/test_bug1730284.html | 71 + dom/base/test/test_bug1739957.html | 40 + dom/base/test/test_bug1784187.html | 38 + dom/base/test/test_bug1799354.html | 77 + dom/base/test/test_bug199959.html | 39 + dom/base/test/test_bug218236.html | 139 + dom/base/test/test_bug218277.html | 28 + dom/base/test/test_bug238409.html | 45 + dom/base/test/test_bug254337.html | 42 + dom/base/test/test_bug270145.xhtml | 51 + dom/base/test/test_bug276037-1.html | 105 + dom/base/test/test_bug276037-2.xhtml | 106 + dom/base/test/test_bug282547.html | 104 + dom/base/test/test_bug28293.html | 86 + dom/base/test/test_bug28293.xhtml | 87 + dom/base/test/test_bug298064.html | 32 + dom/base/test/test_bug300992.html | 45 + dom/base/test/test_bug311681.xml | 103 + dom/base/test/test_bug313646.html | 62 + dom/base/test/test_bug320799.html | 74 + dom/base/test/test_bug322317.html | 33 + dom/base/test/test_bug326337.html | 35 + dom/base/test/test_bug331959.html | 151 + dom/base/test/test_bug333064.html | 59 + dom/base/test/test_bug333198.html | 84 + dom/base/test/test_bug333673.html | 30 + dom/base/test/test_bug337631.html | 99 + dom/base/test/test_bug338541.xhtml | 49 + dom/base/test/test_bug338583.html | 665 +++ dom/base/test/test_bug338679.html | 82 + dom/base/test/test_bug339494.html | 59 + dom/base/test/test_bug339494.xhtml | 58 + dom/base/test/test_bug343596.html | 51 + dom/base/test/test_bug345339.html | 93 + dom/base/test/test_bug346485.html | 77 + dom/base/test/test_bug352728.html | 122 + dom/base/test/test_bug352728.xhtml | 188 + dom/base/test/test_bug353334.html | 67 + dom/base/test/test_bug355026.html | 29 + dom/base/test/test_bug357450.html | 41 + dom/base/test/test_bug357450.xhtml | 39 + dom/base/test/test_bug357450_svg.xhtml | 46 + dom/base/test/test_bug357509.html | 36 + dom/base/test/test_bug358660.html | 37 + dom/base/test/test_bug362391.xhtml | 75 + dom/base/test/test_bug364092.xhtml | 46 + dom/base/test/test_bug364413.xhtml | 48 + dom/base/test/test_bug366944.html | 49 + dom/base/test/test_bug366946.html | 79 + dom/base/test/test_bug367164.html | 47 + dom/base/test/test_bug368972.html | 120 + dom/base/test/test_bug371576-2.html | 32 + dom/base/test/test_bug371576-3.html | 29 + dom/base/test/test_bug371576-4.html | 21 + dom/base/test/test_bug371576-5.html | 36 + dom/base/test/test_bug372086.html | 96 + dom/base/test/test_bug372964-2.html | 58 + dom/base/test/test_bug372964.html | 144 + dom/base/test/test_bug373181.xhtml | 17 + dom/base/test/test_bug375314-2.html | 151 + dom/base/test/test_bug375314.html | 160 + dom/base/test/test_bug378969.html | 47 + dom/base/test/test_bug380418.html | 34 + dom/base/test/test_bug380418.html^headers^ | 4 + dom/base/test/test_bug382113.html | 35 + dom/base/test/test_bug382871.html | 46 + dom/base/test/test_bug384003.xhtml | 84 + dom/base/test/test_bug390219.html | 38 + dom/base/test/test_bug390735.html | 28 + dom/base/test/test_bug392318.html | 44 + dom/base/test/test_bug392511.html | 53 + dom/base/test/test_bug393968.html | 41 + dom/base/test/test_bug395915.html | 43 + dom/base/test/test_bug397234.html | 42 + dom/base/test/test_bug398243.html | 56 + dom/base/test/test_bug401662.html | 51 + dom/base/test/test_bug402150.html | 24 + dom/base/test/test_bug402150.html^headers^ | 1 + dom/base/test/test_bug403841.html | 29 + dom/base/test/test_bug403852.html | 66 + dom/base/test/test_bug403868.xml | 85 + dom/base/test/test_bug405182.html | 47 + dom/base/test/test_bug409380.html | 378 ++ dom/base/test/test_bug410229.html | 108 + dom/base/test/test_bug413974.html | 35 + dom/base/test/test_bug414190.html | 70 + dom/base/test/test_bug415860.html | 240 + dom/base/test/test_bug416317-1.html | 32 + dom/base/test/test_bug416317-2.html | 32 + dom/base/test/test_bug416383.html | 43 + dom/base/test/test_bug417255.html | 60 + dom/base/test/test_bug417384.html | 50 + dom/base/test/test_bug418214.html | 105 + dom/base/test/test_bug418986-1.html | 24 + dom/base/test/test_bug419132.html | 48 + dom/base/test/test_bug419527.xhtml | 68 + dom/base/test/test_bug420609.xhtml | 34 + dom/base/test/test_bug420700.html | 35 + dom/base/test/test_bug421602.html | 53 + dom/base/test/test_bug422403-1.html | 204 + dom/base/test/test_bug422403-2.xhtml | 296 ++ dom/base/test/test_bug422537.html | 55 + dom/base/test/test_bug424212.html | 35 + dom/base/test/test_bug424359-1.html | 213 + dom/base/test/test_bug424359-2.html | 301 ++ dom/base/test/test_bug426308.html | 42 + dom/base/test/test_bug426646.html | 41 + dom/base/test/test_bug428847.html | 33 + dom/base/test/test_bug431082.html | 51 + dom/base/test/test_bug431701.html | 119 + dom/base/test/test_bug431833.html | 51 + dom/base/test/test_bug433533.html | 300 ++ dom/base/test/test_bug433662.html | 31 + dom/base/test/test_bug435425.html | 430 ++ dom/base/test/test_bug444322.html | 2588 +++++++++++ dom/base/test/test_bug444546.html | 160 + dom/base/test/test_bug444722.html | 65 + dom/base/test/test_bug448993.html | 46 + dom/base/test/test_bug450160.html | 100 + dom/base/test/test_bug451376.html | 86 + dom/base/test/test_bug453521.html | 36 + dom/base/test/test_bug453736.html | 58 + dom/base/test/test_bug454325.html | 147 + dom/base/test/test_bug454326.html | 135 + dom/base/test/test_bug455472.html | 41 + dom/base/test/test_bug455629.html | 63 + dom/base/test/test_bug456262.html | 39 + dom/base/test/test_bug457746.html | 38 + dom/base/test/test_bug459424.html | 31 + dom/base/test/test_bug461555.html | 46 + dom/base/test/test_bug461735.html | 50 + dom/base/test/test_bug465767.html | 42 + dom/base/test/test_bug466080.html | 150 + dom/base/test/test_bug466409.html | 34 + dom/base/test/test_bug466751.xhtml | 40 + dom/base/test/test_bug469020.html | 128 + dom/base/test/test_bug469304.html | 187 + dom/base/test/test_bug473162-1.html | 30 + dom/base/test/test_bug473162-2.html | 33 + dom/base/test/test_bug475156.html | 301 ++ dom/base/test/test_bug482935.html | 72 + dom/base/test/test_bug484396.html | 48 + dom/base/test/test_bug493881.html | 31 + dom/base/test/test_bug493881.js | 100 + dom/base/test/test_bug498240.html | 254 ++ dom/base/test/test_bug498433.html | 104 + dom/base/test/test_bug498897.html | 97 + dom/base/test/test_bug499656.html | 57 + dom/base/test/test_bug499656.xhtml | 57 + dom/base/test/test_bug500937.html | 54 + dom/base/test/test_bug503473.html | 37 + dom/base/test/test_bug503481.html | 69 + dom/base/test/test_bug503481b.html | 22 + dom/base/test/test_bug51034.html | 42 + dom/base/test/test_bug513194.html | 28 + dom/base/test/test_bug5141.html | 30 + dom/base/test/test_bug514487.html | 49 + dom/base/test/test_bug515401.html | 141 + dom/base/test/test_bug518104.html | 41 + dom/base/test/test_bug527896.html | 61 + dom/base/test/test_bug540854.html | 47 + dom/base/test/test_bug541937.html | 118 + dom/base/test/test_bug544642.html | 42 + dom/base/test/test_bug545644.html | 42 + dom/base/test/test_bug545644.xhtml | 49 + dom/base/test/test_bug548463.html | 66 + dom/base/test/test_bug553896.xhtml | 69 + dom/base/test/test_bug557892.html | 34 + dom/base/test/test_bug558726.html | 40 + dom/base/test/test_bug559526.html | 93 + dom/base/test/test_bug560780.html | 99 + dom/base/test/test_bug562137.html | 32 + dom/base/test/test_bug562169-1.html | 44 + dom/base/test/test_bug562169-2.html | 29 + dom/base/test/test_bug562652.html | 51 + dom/base/test/test_bug564047.html | 31 + dom/base/test/test_bug564863-2.xhtml | 159 + dom/base/test/test_bug564863.xhtml | 305 ++ dom/base/test/test_bug567350.html | 24 + dom/base/test/test_bug574596.html | 94 + dom/base/test/test_bug578096.html | 49 + dom/base/test/test_bug585978.html | 38 + dom/base/test/test_bug587931.html | 102 + dom/base/test/test_bug588990.html | 332 ++ dom/base/test/test_bug590812.html | 48 + dom/base/test/test_bug590870.html | 44 + dom/base/test/test_bug592366.html | 59 + dom/base/test/test_bug592829.html | 40 + dom/base/test/test_bug597345.html | 27 + dom/base/test/test_bug599295.html | 47 + dom/base/test/test_bug599588.html | 39 + dom/base/test/test_bug601803.html | 35 + dom/base/test/test_bug602838.html | 68 + dom/base/test/test_bug604592.html | 37 + dom/base/test/test_bug604660.html | 77 + dom/base/test/test_bug605982.html | 34 + dom/base/test/test_bug606729.html | 52 + dom/base/test/test_bug614058.html | 29 + dom/base/test/test_bug622088.html | 96 + dom/base/test/test_bug622117.html | 49 + dom/base/test/test_bug622246.html | 49 + dom/base/test/test_bug625722.html | 39 + dom/base/test/test_bug626262.html | 54 + dom/base/test/test_bug628938.html | 239 + dom/base/test/test_bug631615.html | 39 + dom/base/test/test_bug638112.html | 46 + dom/base/test/test_bug647518.html | 45 + dom/base/test/test_bug650001.html | 30 + dom/base/test/test_bug650776.html | 109 + dom/base/test/test_bug650784.html | 37 + dom/base/test/test_bug656283.html | 58 + dom/base/test/test_bug664916.html | 39 + dom/base/test/test_bug666604.html | 149 + dom/base/test/test_bug675121.html | 45 + dom/base/test/test_bug675166.html | 57 + dom/base/test/test_bug682463.html | 156 + dom/base/test/test_bug682554.html | 30 + dom/base/test/test_bug682592.html | 178 + dom/base/test/test_bug684671.html | 45 + dom/base/test/test_bug685798.html | 45 + dom/base/test/test_bug686449.xhtml | 79 + dom/base/test/test_bug687859.html | 33 + dom/base/test/test_bug690056.html | 54 + dom/base/test/test_bug692434.html | 44 + dom/base/test/test_bug693615.html | 41 + dom/base/test/test_bug693875.html | 34 + dom/base/test/test_bug694754.xhtml | 70 + dom/base/test/test_bug696301-1.html | 78 + dom/base/test/test_bug696301-2.html | 80 + dom/base/test/test_bug698381.html | 55 + dom/base/test/test_bug698384.html | 61 + dom/base/test/test_bug704063.html | 56 + dom/base/test/test_bug704320-1.html | 90 + dom/base/test/test_bug704320-2.html | 90 + dom/base/test/test_bug704320_policyset.html | 104 + dom/base/test/test_bug704320_policyset2.html | 45 + dom/base/test/test_bug704320_preload.html | 136 + dom/base/test/test_bug707142.html | 51 + dom/base/test/test_bug708620.html | 41 + dom/base/test/test_bug711047.html | 16 + dom/base/test/test_bug711180.html | 25 + dom/base/test/test_bug719533.html | 27 + dom/base/test/test_bug726364.html | 48 + dom/base/test/test_bug737087.html | 37 + dom/base/test/test_bug737565.html | 64 + dom/base/test/test_bug737612.html | 29 + dom/base/test/test_bug738108.html | 39 + dom/base/test/test_bug744830.html | 132 + dom/base/test/test_bug749367.html | 29 + dom/base/test/test_bug750096.html | 44 + dom/base/test/test_bug753278.html | 46 + dom/base/test/test_bug761120.html | 41 + dom/base/test/test_bug769117.html | 55 + dom/base/test/test_bug782342.html | 85 + dom/base/test/test_bug787778.html | 25 + dom/base/test/test_bug789315.html | 49 + dom/base/test/test_bug789856.html | 42 + dom/base/test/test_bug809003.html | 47 + dom/base/test/test_bug810494.html | 46 + dom/base/test/test_bug811701.html | 48 + dom/base/test/test_bug811701.xhtml | 52 + dom/base/test/test_bug813919.html | 46 + dom/base/test/test_bug814576.html | 41 + dom/base/test/test_bug819051.html | 59 + dom/base/test/test_bug820909.html | 87 + dom/base/test/test_bug864595.html | 34 + dom/base/test/test_bug868999.html | 39 + dom/base/test/test_bug869000.html | 37 + dom/base/test/test_bug869002.html | 32 + dom/base/test/test_bug869006.html | 37 + dom/base/test/test_bug876282.html | 45 + dom/base/test/test_bug891952.html | 61 + dom/base/test/test_bug894874.html | 45 + dom/base/test/test_bug895974.html | 69 + dom/base/test/test_bug907892.html | 49 + dom/base/test/test_bug913761.html | 40 + dom/base/test/test_bug922681.html | 113 + dom/base/test/test_bug927196.html | 56 + dom/base/test/test_bug945152.html | 58 + dom/base/test/test_bug962251.html | 244 + dom/base/test/test_bug976673.html | 105 + dom/base/test/test_bug982153.html | 29 + dom/base/test/test_bug999456.html | 32 + dom/base/test/test_caretPositionFromPoint.html | 131 + dom/base/test/test_change_policy.html | 134 + dom/base/test/test_clearTimeoutIntervalNoArg.html | 14 + dom/base/test/test_clipboard_nbsp.html | 116 + dom/base/test/test_constructor-assignment.html | 61 + dom/base/test/test_constructor.html | 61 + .../test/test_content_iterator_post_order.html | 875 ++++ dom/base/test/test_content_iterator_pre_order.html | 869 ++++ dom/base/test/test_content_iterator_subtree.html | 690 +++ dom/base/test/test_copyimage.html | 87 + dom/base/test/test_copypaste.html | 125 + dom/base/test/test_copypaste.xhtml | 112 + dom/base/test/test_copypaste_disabled.html | 116 + dom/base/test/test_createHTMLDocument.html | 52 + dom/base/test/test_current_inner_window.html | 61 + dom/base/test/test_custom_element.html | 29 + dom/base/test/test_custom_element_reflector.html | 27 + dom/base/test/test_data_uri.html | 189 + dom/base/test/test_delazification_strategy.html | 175 + dom/base/test/test_document.all_iteration.html | 11 + dom/base/test/test_document.all_unqualified.html | 35 + dom/base/test/test_document_constructor.html | 31 + .../test/test_document_importNode_document.html | 32 + dom/base/test/test_document_wireframe.html | 354 ++ dom/base/test/test_domparser_null_char.html | 27 + dom/base/test/test_domparsing.html | 84 + dom/base/test/test_domrequest.html | 233 + dom/base/test/test_domrequesthelper.xhtml | 547 +++ dom/base/test/test_domwindowutils.html | 128 + dom/base/test/test_element.matches.html | 28 + dom/base/test/test_elementTraversal.html | 111 + dom/base/test/test_element_closest.html | 84 + dom/base/test/test_embed_xorigin_document.html | 103 + .../test/test_encodeToStringWithMaxLength.html | 60 + ...ncodeToStringWithRequiresReinitAfterOutput.html | 87 + .../test_eventsource_event_listener_leaks.html | 40 + dom/base/test/test_eventsourceservice_basic.html | 69 + .../test_eventsourceservice_reconnect_error.html | 72 + .../test/test_eventsourceservice_status_error.html | 67 + dom/base/test/test_eventsourceservice_worker.html | 61 + dom/base/test/test_explicit_user_agent.html | 64 + dom/base/test/test_find.html | 204 + dom/base/test/test_find_bug1601118.html | 61 + dom/base/test/test_find_bug1654683.html | 30 + dom/base/test/test_find_nac.html | 13 + dom/base/test/test_focus_design_mode.html | 62 + .../test_focus_display_none_xorigin_iframe.html | 134 + dom/base/test/test_focus_keyboard_event.html | 48 + dom/base/test/test_focus_scroll_padding_tab.html | 74 + dom/base/test/test_focus_scrollable_fieldset.html | 60 + dom/base/test/test_focus_scrollable_input.html | 56 + dom/base/test/test_focus_shadow_dom.html | 36 + dom/base/test/test_focus_shadow_dom_root.html | 41 + dom/base/test/test_fragment_sanitization.xhtml | 98 + .../test_getAttribute_after_createAttribute.html | 15 + dom/base/test/test_getElementById.html | 58 + ...etLastOverWindowPointerLocationInCSSPixels.html | 83 + dom/base/test/test_getTranslationNodes.html | 225 + dom/base/test/test_getTranslationNodes_limit.html | 31 + dom/base/test/test_gsp-qualified.html | 38 + dom/base/test/test_gsp-quirks.html | 27 + dom/base/test/test_gsp-standards.html | 27 + dom/base/test/test_history_document_open.html | 37 + dom/base/test/test_history_state_null.html | 25 + dom/base/test/test_html_colors_quirks.html | 711 +++ dom/base/test/test_html_colors_standards.html | 712 +++ dom/base/test/test_htmlcopyencoder.html | 195 + dom/base/test/test_htmlcopyencoder.xhtml | 179 + .../test/test_iframe_event_listener_leaks.html | 41 + dom/base/test/test_iframe_referrer.html | 107 + dom/base/test/test_iframe_referrer_changing.html | 50 + dom/base/test/test_iframe_referrer_invalid.html | 81 + dom/base/test/test_innersize_scrollport.html | 38 + ...est_input_vsync_alignment_inner_event_loop.html | 49 + ...st_input_vsync_alignment_input_while_vsync.html | 47 + ...st_input_vsync_alignment_lower_than_normal.html | 51 + .../test/test_integer_attr_with_leading_zero.html | 64 + dom/base/test/test_intersectionobservers.html | 1221 +++++ dom/base/test/test_link_prefetch.html | 220 + dom/base/test/test_link_preload.html | 220 + dom/base/test/test_link_stylesheet.html | 221 + .../test/test_location_href_unknown_protocol.html | 27 + .../test_lock_orientation_after_fullscreen.html | 58 + ...t_lock_orientation_with_pending_fullscreen.html | 126 + dom/base/test/test_messagePort.html | 114 + .../test/test_messagemanager_send_principal.html | 108 + dom/base/test/test_meta_refresh_referrer.html | 98 + dom/base/test/test_mozMatchesSelector.html | 14 + dom/base/test/test_mutationobservers.html | 862 ++++ dom/base/test/test_named_frames.html | 38 + dom/base/test/test_navigatorPrefOverride.html | 54 + dom/base/test/test_navigator_cookieEnabled.html | 124 + .../test/test_navigator_hardwareConcurrency.html | 42 + dom/base/test/test_navigator_language.html | 213 + .../test_navigator_resolve_identity_xrays.xhtml | 39 + ...test_nested_event_loop_spin_and_idle_tasks.html | 34 + dom/base/test/test_nodelist_holes.html | 42 + dom/base/test/test_openDialogChromeOnly.html | 38 + dom/base/test/test_open_null_features.html | 54 + dom/base/test/test_pasting_svg_image.html | 99 + dom/base/test/test_pdf_print.html | 62 + dom/base/test/test_plugin_freezing.html | 68 + .../test/test_postMessage_originAttributes.html | 53 + dom/base/test/test_postMessage_solidus.html | 93 + .../test/test_postMessages_broadcastChannel.html | 167 + dom/base/test/test_postMessages_messagePort.html | 114 + dom/base/test/test_postMessages_window.html | 124 + dom/base/test/test_postMessages_workers.html | 111 + ..._processing_instruction_update_stylesheet.xhtml | 46 + .../test/test_progress_events_for_gzip_data.html | 44 + dom/base/test/test_pushState_structuredclone.html | 51 + dom/base/test/test_range_bounds.html | 305 ++ dom/base/test/test_reentrant_flush.html | 60 + dom/base/test/test_root_iframe.html | 27 + dom/base/test/test_sandbox_and_document_uri.html | 31 + dom/base/test/test_sandboxed_blob_uri.html | 22 + dom/base/test/test_sanitize_xhr.html | 35 + dom/base/test/test_screen_orientation.html | 86 + .../test_script_loader_crossorigin_data_url.html | 38 + dom/base/test/test_script_loader_js_cache.html | 264 ++ .../test/test_script_loader_js_cache_frames.html | 202 + .../test/test_script_loader_js_cache_module.html | 537 +++ .../test_script_loader_js_cache_module_sri.html | 425 ++ .../test_sendQueryContentAndSelectionSetEvent.html | 253 ++ ...test_sendSelectionSetEvent_with_same_range.html | 100 + dom/base/test/test_serializer_noscript.html | 38 + dom/base/test/test_setInterval_from_start.html | 57 + .../test_setInterval_uncatchable_exception.html | 55 + dom/base/test/test_setTimeoutWith0.html | 22 + dom/base/test/test_settimeout_extra_arguments.html | 12 + dom/base/test/test_settimeout_inner.html | 59 + dom/base/test/test_setting_opener.html | 125 + dom/base/test/test_shared_compartment1.html | 77 + dom/base/test/test_shared_compartment2.html | 47 + dom/base/test/test_structuredclone_backref.html | 32 + dom/base/test/test_structuredclone_error.html | 23 + dom/base/test/test_style_cssText.html | 85 + .../test/test_suppressed_events_and_scrolling.html | 47 + .../test/test_suppressed_events_nested_iframe.html | 71 + dom/base/test/test_suppressed_microtasks.html | 62 + dom/base/test/test_text_wholeText.html | 232 + .../test/test_textnode_normalize_in_selection.html | 201 + .../test/test_textnode_split_in_selection.html | 221 + dom/base/test/test_timeout_clamp.html | 163 + dom/base/test/test_timer_flood.html | 118 + dom/base/test/test_title.html | 52 + dom/base/test/test_toScreenRect.html | 9 + dom/base/test/test_treewalker_nextsibling.xml | 96 + dom/base/test/test_urgent_start.html | 269 ++ dom/base/test/test_user_select.html | 357 ++ ...test_viewport_metrics_on_landscape_content.html | 20 + dom/base/test/test_viewport_scroll.html | 89 + .../test/test_viewsource_forbidden_in_object.html | 62 + dom/base/test/test_w3element_traversal.html | 148 + dom/base/test/test_w3element_traversal.xhtml | 149 + dom/base/test/test_w3element_traversal_svg.html | 107 + ...est_warning_for_blocked_cross_site_request.html | 129 + dom/base/test/test_window_close.html | 93 + dom/base/test/test_window_constructor.html | 36 + dom/base/test/test_window_content.html | 28 + dom/base/test/test_window_cross_origin_props.html | 101 + .../test/test_window_define_nonconfigurable.html | 115 + dom/base/test/test_window_define_symbol.html | 29 + dom/base/test/test_window_element_enumeration.html | 70 + dom/base/test/test_window_enumeration.html | 33 + dom/base/test/test_window_extensible.html | 46 + .../test/test_window_focus_by_close_and_open.html | 34 + dom/base/test/test_window_indexing.html | 139 + dom/base/test/test_window_keys.html | 28 + .../test/test_window_named_frame_enumeration.html | 96 + dom/base/test/test_window_own_props.html | 29 + dom/base/test/test_window_proto.html | 17 + dom/base/test/test_writable-replaceable.html | 49 + dom/base/test/test_x-frame-options.html | 195 + dom/base/test/test_youtube_flash_embed.html | 32 + dom/base/test/unit/1_original.xml | 3 + dom/base/test/unit/1_result.xml | 3 + dom/base/test/unit/2_original.xml | 13 + dom/base/test/unit/2_result_1.xml | 13 + dom/base/test/unit/2_result_2.xml | 14 + dom/base/test/unit/2_result_3.xml | 23 + dom/base/test/unit/2_result_4.xml | 21 + dom/base/test/unit/3_original.xml | 4 + dom/base/test/unit/3_result.xml | 7 + dom/base/test/unit/3_result_2.xml | 7 + dom/base/test/unit/4_original.xml | 32 + dom/base/test/unit/4_result_1.xml | 32 + dom/base/test/unit/4_result_2.xml | 7 + dom/base/test/unit/4_result_3.xml | 4 + dom/base/test/unit/4_result_4.xml | 4 + dom/base/test/unit/4_result_5.xml | 46 + dom/base/test/unit/4_result_6.xml | 48 + dom/base/test/unit/empty_document.xml | 3 + dom/base/test/unit/head_utilities.js | 69 + dom/base/test/unit/head_xml.js | 152 + dom/base/test/unit/isequalnode_data.xml | 150 + dom/base/test/unit/nodelist_data_1.xml | 58 + dom/base/test/unit/nodelist_data_2.xhtml | 45 + dom/base/test/unit/test_blockParsing.js | 113 + dom/base/test/unit/test_bug553888.js | 57 + dom/base/test/unit/test_bug737966.js | 16 + dom/base/test/unit/test_cancelPrefetch.js | 149 + dom/base/test/unit/test_chromeutils_base64.js | 140 + .../unit/test_chromeutils_getXPCOMErrorName.js | 40 + .../test/unit/test_chromeutils_shallowclone.js | 60 + dom/base/test/unit/test_delete_range.xml | 125 + dom/base/test/unit/test_error_codes.js | 64 + dom/base/test/unit/test_generate_xpath.js | 85 + dom/base/test/unit/test_htmlserializer.js | 70 + dom/base/test/unit/test_isequalnode.js | 390 ++ .../test/unit/test_js_dev_error_interceptor.js | 53 + dom/base/test/unit/test_nodelist.js | 345 ++ dom/base/test/unit/test_normalize.js | 100 + dom/base/test/unit/test_range.js | 465 ++ dom/base/test/unit/test_serializers_entities.js | 99 + .../test/unit/test_serializers_entities_in_attr.js | 108 + dom/base/test/unit/test_structuredcloneholder.js | 159 + dom/base/test/unit/test_thirdpartyutil.js | 99 + dom/base/test/unit/test_treewalker.js | 23 + dom/base/test/unit/test_xhr_document.js | 45 + dom/base/test/unit/test_xhr_origin_attributes.js | 53 + dom/base/test/unit/test_xhr_standalone.js | 19 + dom/base/test/unit/test_xml_parser.js | 48 + dom/base/test/unit/test_xml_serializer.js | 421 ++ dom/base/test/unit/test_xmlserializer.js | 179 + dom/base/test/unit/xpcshell.ini | 70 + dom/base/test/unit_ipc/test_bug553888_wrap.js | 3 + dom/base/test/unit_ipc/test_xhr_document_ipc.js | 3 + dom/base/test/unit_ipc/xpcshell.ini | 11 + .../test/useractivation/file_clipboard_common.js | 505 +++ dom/base/test/useractivation/file_empty.html | 0 .../file_iframe_check_user_activation.html | 22 + .../file_iframe_consume_user_activation.html | 15 + .../useractivation/file_iframe_user_activated.html | 14 + ...ile_useractivation_sandbox_transient_popup.html | 20 + dom/base/test/useractivation/mochitest.ini | 23 + dom/base/test/useractivation/moz.build | 9 + .../test/useractivation/test_clipboard_editor.html | 31 + .../useractivation/test_clipboard_noeditor.html | 29 + .../test_popup_blocker_async_callback.html | 83 + .../test_popup_blocker_mouse_event.html | 98 + .../test_popup_blocker_pointer_event.html | 122 + .../test_useractivation_has_been_activated.html | 115 + .../test_useractivation_key_events.html | 91 + .../test_useractivation_sandbox_transient.html | 90 + .../test_useractivation_scrollbar.html | 135 + .../test_useractivation_transient.html | 155 + .../test_useractivation_transient_consuming.html | 151 + dom/base/test/variable_style_sheet.sjs | 18 + dom/base/test/w3element_traversal.svg | 70 + dom/base/test/wholeTexty-helper.xml | 6 + dom/base/test/worker_postMessages.js | 73 + 1382 files changed, 94517 insertions(+) create mode 100644 dom/base/test/.eslintrc.js create mode 100644 dom/base/test/345339_iframe.html create mode 100644 dom/base/test/Ahem.ttf create mode 100644 dom/base/test/FAIL.html create mode 100644 dom/base/test/PASS.html create mode 100644 dom/base/test/accesscontrol.resource create mode 100644 dom/base/test/accesscontrol.resource^headers^ create mode 100644 dom/base/test/audio.ogg create mode 100644 dom/base/test/badContentType.eventsource create mode 100644 dom/base/test/badContentType.eventsource^headers^ create mode 100644 dom/base/test/badHTTPResponseCode.eventsource create mode 100644 dom/base/test/badHTTPResponseCode.eventsource^headers^ create mode 100644 dom/base/test/badMessageEvent.eventsource create mode 100644 dom/base/test/badMessageEvent.eventsource^headers^ create mode 100644 dom/base/test/badMessageEvent2.eventsource create mode 100644 dom/base/test/badMessageEvent2.eventsource^headers^ create mode 100644 dom/base/test/browser.ini create mode 100644 dom/base/test/browser_aboutnewtab_process_selection.js create mode 100644 dom/base/test/browser_blocking_image.js create mode 100644 dom/base/test/browser_bug1011748.js create mode 100644 dom/base/test/browser_bug1058164.js create mode 100644 dom/base/test/browser_bug1303838.js create mode 100644 dom/base/test/browser_bug1554070.js create mode 100644 dom/base/test/browser_bug1691214.js create mode 100644 dom/base/test/browser_bug1703472.js create mode 100644 dom/base/test/browser_bug902350.js create mode 100644 dom/base/test/browser_chromeutils_getalldomprocesses.js create mode 100644 dom/base/test/browser_chromeutils_isdomobject.js create mode 100644 dom/base/test/browser_data_documents_aboutmemory.js create mode 100644 dom/base/test/browser_force_process_selector.js create mode 100644 dom/base/test/browser_form_validity_popup_submit.js create mode 100644 dom/base/test/browser_inputStream_structuredClone.js create mode 100644 dom/base/test/browser_messagemanager_loadprocessscript.js create mode 100644 dom/base/test/browser_messagemanager_targetframeloader.js create mode 100644 dom/base/test/browser_messagemanager_unload.js create mode 100644 dom/base/test/browser_multiple_popups.html create mode 100644 dom/base/test/browser_multiple_popups.js create mode 100644 dom/base/test/browser_outline_refocus.js create mode 100644 dom/base/test/browser_page_load_event_telemetry.js create mode 100644 dom/base/test/browser_pagehide_on_tab_close.js create mode 100644 dom/base/test/browser_promiseDocumentFlushed.js create mode 100644 dom/base/test/browser_refresh_content.js create mode 100644 dom/base/test/browser_state_notifications.js create mode 100644 dom/base/test/browser_timeout_throttling_with_audio_playback.js create mode 100644 dom/base/test/browser_use_counters.js create mode 100644 dom/base/test/browser_user_input_handling_delay.js create mode 100644 dom/base/test/browser_user_input_handling_delay_aboutblank.js create mode 100644 dom/base/test/browser_user_input_handling_delay_bfcache.js create mode 100644 dom/base/test/browser_user_input_handling_delay_invisible_iframe.js create mode 100644 dom/base/test/browser_user_input_handling_delay_reload_ticks.js create mode 100644 dom/base/test/browser_xml_toggle.js create mode 100644 dom/base/test/bug1576154.sjs create mode 100644 dom/base/test/bug1739957.sjs create mode 100644 dom/base/test/bug282547.sjs create mode 100644 dom/base/test/bug298064-subframe.html create mode 100644 dom/base/test/bug313646.txt create mode 100644 dom/base/test/bug382113_object.html create mode 100644 dom/base/test/bug403852_fileOpener.js create mode 100644 dom/base/test/bug419132.html create mode 100644 dom/base/test/bug426308-redirect.sjs create mode 100644 dom/base/test/bug435425.sjs create mode 100644 dom/base/test/bug435425_redirect.sjs create mode 100644 dom/base/test/bug444322.js create mode 100644 dom/base/test/bug444322.txt create mode 100644 dom/base/test/bug444546.sjs create mode 100644 dom/base/test/bug455629-helper.svg create mode 100644 dom/base/test/bug457746.sjs create mode 100644 dom/base/test/bug461735-post-redirect.js create mode 100644 dom/base/test/bug461735-redirect1.sjs create mode 100644 dom/base/test/bug461735-redirect2.sjs create mode 100644 dom/base/test/bug466080.sjs create mode 100644 dom/base/test/bug466409-empty.css create mode 100644 dom/base/test/bug466409-page.html create mode 100644 dom/base/test/bug475156.sjs create mode 100644 dom/base/test/bug482935.sjs create mode 100644 dom/base/test/bug540854.sjs create mode 100644 dom/base/test/bug578096LoadChromeScript.js create mode 100644 dom/base/test/bug638112-response.txt create mode 100644 dom/base/test/bug638112.sjs create mode 100644 dom/base/test/bug696301-script-1.js create mode 100644 dom/base/test/bug696301-script-1.js^headers^ create mode 100644 dom/base/test/bug696301-script-2.js create mode 100644 dom/base/test/bug704320.sjs create mode 100644 dom/base/test/bug704320_counter.sjs create mode 100644 dom/base/test/bug819051.sjs create mode 100644 dom/base/test/chrome.ini create mode 100644 dom/base/test/chrome/bug418986-1.js create mode 100644 dom/base/test/chrome/bug421622-referer.sjs create mode 100644 dom/base/test/chrome/bug884693.sjs create mode 100644 dom/base/test/chrome/chrome.ini create mode 100644 dom/base/test/chrome/clonedoc/chrome.manifest create mode 100644 dom/base/test/chrome/clonedoc/content/doc.xml create mode 100644 dom/base/test/chrome/custom_element_ep.js create mode 100644 dom/base/test/chrome/file_bug1139964.xhtml create mode 100644 dom/base/test/chrome/file_bug1209621.xhtml create mode 100644 dom/base/test/chrome/file_bug549682.xhtml create mode 100644 dom/base/test/chrome/file_bug616841.xhtml create mode 100644 dom/base/test/chrome/file_bug816340.xhtml create mode 100644 dom/base/test/chrome/file_bug990812-1.xhtml create mode 100644 dom/base/test/chrome/file_bug990812-2.xhtml create mode 100644 dom/base/test/chrome/file_bug990812-3.xhtml create mode 100644 dom/base/test/chrome/file_bug990812-4.xhtml create mode 100644 dom/base/test/chrome/file_bug990812-5.xhtml create mode 100644 dom/base/test/chrome/file_bug990812.xhtml create mode 100644 dom/base/test/chrome/file_document-element-inserted-inner.xhtml create mode 100644 dom/base/test/chrome/file_document-element-inserted.xhtml create mode 100644 dom/base/test/chrome/file_title.xhtml create mode 100644 dom/base/test/chrome/fileconstructor_file.png create mode 100644 dom/base/test/chrome/frame_custom_element_content.html create mode 100644 dom/base/test/chrome/nochrome_bug1346936.html create mode 100644 dom/base/test/chrome/nochrome_bug1346936.js create mode 100644 dom/base/test/chrome/nochrome_bug1346936.js^headers^ create mode 100644 dom/base/test/chrome/nochrome_bug765993.html create mode 100644 dom/base/test/chrome/nochrome_bug765993.js create mode 100644 dom/base/test/chrome/nochrome_bug765993.js^headers^ create mode 100644 dom/base/test/chrome/test_bug1063837.xhtml create mode 100644 dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml create mode 100644 dom/base/test/chrome/test_bug1139964.xhtml create mode 100644 dom/base/test/chrome/test_bug120684.xhtml create mode 100644 dom/base/test/chrome/test_bug1209621.xhtml create mode 100644 dom/base/test/chrome/test_bug1339722.html create mode 100644 dom/base/test/chrome/test_bug1346936.html create mode 100644 dom/base/test/chrome/test_bug206691.xhtml create mode 100644 dom/base/test/chrome/test_bug289714.xhtml create mode 100644 dom/base/test/chrome/test_bug339494.xhtml create mode 100644 dom/base/test/chrome/test_bug357450.xhtml create mode 100644 dom/base/test/chrome/test_bug380418.html create mode 100644 dom/base/test/chrome/test_bug380418.html^headers^ create mode 100644 dom/base/test/chrome/test_bug383430.html create mode 100644 dom/base/test/chrome/test_bug418986-1.xhtml create mode 100644 dom/base/test/chrome/test_bug421622.xhtml create mode 100644 dom/base/test/chrome/test_bug429785.xhtml create mode 100644 dom/base/test/chrome/test_bug430050.xhtml create mode 100644 dom/base/test/chrome/test_bug467123.xhtml create mode 100644 dom/base/test/chrome/test_bug473284.xhtml create mode 100644 dom/base/test/chrome/test_bug549682.xhtml create mode 100644 dom/base/test/chrome/test_bug571390.xhtml create mode 100644 dom/base/test/chrome/test_bug616841.xhtml create mode 100644 dom/base/test/chrome/test_bug635835.xhtml create mode 100644 dom/base/test/chrome/test_bug682305.html create mode 100644 dom/base/test/chrome/test_bug683852.xhtml create mode 100644 dom/base/test/chrome/test_bug752226-3.xhtml create mode 100644 dom/base/test/chrome/test_bug752226-4.xhtml create mode 100644 dom/base/test/chrome/test_bug765993.html create mode 100644 dom/base/test/chrome/test_bug780199.xhtml create mode 100644 dom/base/test/chrome/test_bug780529.xhtml create mode 100644 dom/base/test/chrome/test_bug800386.xhtml create mode 100644 dom/base/test/chrome/test_bug816340.xhtml create mode 100644 dom/base/test/chrome/test_bug884693.xhtml create mode 100644 dom/base/test/chrome/test_bug914381.html create mode 100644 dom/base/test/chrome/test_bug990812.xhtml create mode 100644 dom/base/test/chrome/test_chromeOuterWindowID.xhtml create mode 100644 dom/base/test/chrome/test_custom_element_content.xhtml create mode 100644 dom/base/test/chrome/test_custom_element_ep.xhtml create mode 100644 dom/base/test/chrome/test_document-element-inserted.xhtml create mode 100644 dom/base/test/chrome/test_domparsing.xhtml create mode 100644 dom/base/test/chrome/test_fileconstructor.xhtml create mode 100644 dom/base/test/chrome/test_getElementsWithGrid.html create mode 100644 dom/base/test/chrome/test_input_value_set_preserve_undo.xhtml create mode 100644 dom/base/test/chrome/test_nsITextInputProcessor.xhtml create mode 100644 dom/base/test/chrome/test_permission_hasValidTransientUserActivation.xhtml create mode 100644 dom/base/test/chrome/test_range_getClientRectsAndTexts.html create mode 100644 dom/base/test/chrome/test_swapFrameLoaders.xhtml create mode 100644 dom/base/test/chrome/test_title.xhtml create mode 100644 dom/base/test/chrome/test_windowroot.xhtml create mode 100644 dom/base/test/chrome/title_window.xhtml create mode 100644 dom/base/test/chrome/window_chromeOuterWindowID.xhtml create mode 100644 dom/base/test/chrome/window_nsITextInputProcessor.xhtml create mode 100644 dom/base/test/chrome/window_swapFrameLoaders.xhtml create mode 100644 dom/base/test/common_postMessages.js create mode 100644 dom/base/test/copypaste.js create mode 100644 dom/base/test/delayedServerEvents.sjs create mode 100644 dom/base/test/dummy.html create mode 100644 dom/base/test/embed_bug455472.html create mode 100644 dom/base/test/empty.html create mode 100644 dom/base/test/eventsource.resource create mode 100644 dom/base/test/eventsource.resource^headers^ create mode 100644 dom/base/test/eventsource_message.sjs create mode 100644 dom/base/test/eventsource_reconnect.sjs create mode 100644 dom/base/test/eventsource_redirect.resource create mode 100644 dom/base/test/eventsource_redirect.resource^headers^ create mode 100644 dom/base/test/eventsource_redirect_to.resource create mode 100644 dom/base/test/eventsource_redirect_to.resource^headers^ create mode 100644 dom/base/test/eventsource_worker.js create mode 100644 dom/base/test/fake_plugin.tst create mode 100644 dom/base/test/file1_setting_opener.html create mode 100644 dom/base/test/file2_setting_opener.html create mode 100644 dom/base/test/file3_setting_opener.html create mode 100644 dom/base/test/file4_setting_opener.html create mode 100644 dom/base/test/file_audioLoop.html create mode 100644 dom/base/test/file_audioLoopInIframe.html create mode 100644 dom/base/test/file_blocking_image.html create mode 100644 dom/base/test/file_browser_refresh_content.html create mode 100644 dom/base/test/file_browser_refresh_expired_resource.sjs create mode 100644 dom/base/test/file_browser_refresh_iframe.sjs create mode 100644 dom/base/test/file_browser_refresh_image.sjs create mode 100644 dom/base/test/file_browser_refresh_non_cacheable.sjs create mode 100644 dom/base/test/file_bug1008126_worker.js create mode 100644 dom/base/test/file_bug1011748_OK.sjs create mode 100644 dom/base/test/file_bug1011748_redirect.sjs create mode 100644 dom/base/test/file_bug1091883_frame.html create mode 100644 dom/base/test/file_bug1091883_subframe.html create mode 100644 dom/base/test/file_bug1091883_target.html create mode 100644 dom/base/test/file_bug1100912.html create mode 100644 dom/base/test/file_bug1198095.js create mode 100644 dom/base/test/file_bug1250148.sjs create mode 100644 dom/base/test/file_bug1268962.sjs create mode 100644 dom/base/test/file_bug1274806.html create mode 100644 dom/base/test/file_bug1303838.html create mode 100644 dom/base/test/file_bug1303838_target.html create mode 100644 dom/base/test/file_bug1303838_target_bar.html create mode 100644 dom/base/test/file_bug1303838_target_baz.html create mode 100644 dom/base/test/file_bug1303838_target_foo.html create mode 100644 dom/base/test/file_bug1303838_target_ibar.html create mode 100644 dom/base/test/file_bug1303838_target_ibaz.html create mode 100644 dom/base/test/file_bug1303838_target_ifoo.html create mode 100644 dom/base/test/file_bug1303838_with_iframe.html create mode 100644 dom/base/test/file_bug1554070_1.html create mode 100644 dom/base/test/file_bug1554070_2.html create mode 100644 dom/base/test/file_bug1639328.html create mode 100644 dom/base/test/file_bug1691214.html create mode 100644 dom/base/test/file_bug1700871.html create mode 100644 dom/base/test/file_bug1703472.html create mode 100644 dom/base/test/file_bug28293.sjs create mode 100644 dom/base/test/file_bug326337.xml create mode 100644 dom/base/test/file_bug326337_inner.html create mode 100644 dom/base/test/file_bug326337_outer.html create mode 100644 dom/base/test/file_bug357450.js create mode 100644 dom/base/test/file_bug416317.xhtml create mode 100644 dom/base/test/file_bug426646-1.html create mode 100644 dom/base/test/file_bug426646-2.html create mode 100644 dom/base/test/file_bug428847-1.xhtml create mode 100644 dom/base/test/file_bug428847-2.xhtml create mode 100644 dom/base/test/file_bug498897.css create mode 100644 dom/base/test/file_bug498897.html create mode 100644 dom/base/test/file_bug498897.html^headers^ create mode 100644 dom/base/test/file_bug503473-frame.sjs create mode 100644 dom/base/test/file_bug503481.sjs create mode 100644 dom/base/test/file_bug503481b_inner.html create mode 100644 dom/base/test/file_bug518104.js create mode 100644 dom/base/test/file_bug541937.html create mode 100644 dom/base/test/file_bug541937.xhtml create mode 100644 dom/base/test/file_bug557892.html create mode 100644 dom/base/test/file_bug562137.txt create mode 100644 dom/base/test/file_bug590812-ref.xhtml create mode 100644 dom/base/test/file_bug590812.xml create mode 100644 dom/base/test/file_bug590870.html create mode 100644 dom/base/test/file_bug601803a.html create mode 100644 dom/base/test/file_bug601803b.html create mode 100644 dom/base/test/file_bug604660-1.xml create mode 100644 dom/base/test/file_bug604660-2.xsl create mode 100644 dom/base/test/file_bug604660-3.js create mode 100644 dom/base/test/file_bug604660-4.js create mode 100644 dom/base/test/file_bug604660-5.xml create mode 100644 dom/base/test/file_bug604660-6.xsl create mode 100644 dom/base/test/file_bug622088.sjs create mode 100644 dom/base/test/file_bug622088_inner.html create mode 100644 dom/base/test/file_bug675121.sjs create mode 100644 dom/base/test/file_bug687859-16.js create mode 100644 dom/base/test/file_bug687859-16.js^headers^ create mode 100644 dom/base/test/file_bug687859-bom.js create mode 100644 dom/base/test/file_bug687859-bom.js^headers^ create mode 100644 dom/base/test/file_bug687859-charset.js create mode 100644 dom/base/test/file_bug687859-http.js create mode 100644 dom/base/test/file_bug687859-http.js^headers^ create mode 100644 dom/base/test/file_bug687859-inherit.js create mode 100644 dom/base/test/file_bug692434.xml create mode 100644 dom/base/test/file_bug704320_preload_attr.html create mode 100644 dom/base/test/file_bug704320_preload_common.js create mode 100644 dom/base/test/file_bug704320_preload_reuse.html create mode 100644 dom/base/test/file_bug704320_redirect.html create mode 100644 dom/base/test/file_bug707142_baseline.json create mode 100644 dom/base/test/file_bug707142_bom.json create mode 100644 dom/base/test/file_bug707142_utf-16.json create mode 100644 dom/base/test/file_bug708620-2.html create mode 100644 dom/base/test/file_bug708620.html create mode 100644 dom/base/test/file_bug753278.html create mode 100644 dom/base/test/file_bug769117.html create mode 100644 dom/base/test/file_bug782342.txt create mode 100644 dom/base/test/file_bug787778.sjs create mode 100644 dom/base/test/file_bug869432.eventsource create mode 100644 dom/base/test/file_bug869432.eventsource^headers^ create mode 100644 dom/base/test/file_bug902350.html create mode 100644 dom/base/test/file_bug902350_frame.html create mode 100644 dom/base/test/file_bug907892.html create mode 100644 dom/base/test/file_bug945152.jar create mode 100644 dom/base/test/file_bug945152_worker.js create mode 100644 dom/base/test/file_change_policy_redirect.html create mode 100644 dom/base/test/file_current_inner_window.html create mode 100644 dom/base/test/file_delazification_strategy.html create mode 100644 dom/base/test/file_delazification_strategy.js create mode 100644 dom/base/test/file_domwindowutils_animation.html create mode 100644 dom/base/test/file_domwindowutils_dynamic_toolbar.html create mode 100644 dom/base/test/file_empty.html create mode 100644 dom/base/test/file_explicit_user_agent.sjs create mode 100644 dom/base/test/file_external_script.html create mode 100644 dom/base/test/file_external_script.xhtml create mode 100644 dom/base/test/file_focus_design_mode_inner.html create mode 100644 dom/base/test/file_focus_display_none_xorigin_iframe_inner.html create mode 100644 dom/base/test/file_focus_shadow_dom.html create mode 100644 dom/base/test/file_general_document.html create mode 100644 dom/base/test/file_history_document_open.html create mode 100644 dom/base/test/file_htmlserializer_1.html create mode 100644 dom/base/test/file_htmlserializer_1_bodyonly.html create mode 100644 dom/base/test/file_htmlserializer_1_format.html create mode 100644 dom/base/test/file_htmlserializer_1_linebreak.html create mode 100644 dom/base/test/file_htmlserializer_1_links.html create mode 100644 dom/base/test/file_htmlserializer_1_nested_body.html create mode 100644 dom/base/test/file_htmlserializer_1_no_body.html create mode 100644 dom/base/test/file_htmlserializer_1_noflag.html create mode 100644 dom/base/test/file_htmlserializer_1_noformatpre.html create mode 100644 dom/base/test/file_htmlserializer_1_raw.html create mode 100644 dom/base/test/file_htmlserializer_1_sibling_body.html create mode 100644 dom/base/test/file_htmlserializer_1_sibling_body_only_body.html create mode 100644 dom/base/test/file_htmlserializer_1_wrap.html create mode 100644 dom/base/test/file_htmlserializer_2.html create mode 100644 dom/base/test/file_htmlserializer_2_basic.html create mode 100644 dom/base/test/file_htmlserializer_ipv6.html create mode 100644 dom/base/test/file_htmlserializer_ipv6_out.html create mode 100644 dom/base/test/file_inline_script.html create mode 100644 dom/base/test/file_inline_script.xhtml create mode 100644 dom/base/test/file_js_cache.html create mode 100644 dom/base/test/file_js_cache.js create mode 100644 dom/base/test/file_js_cache_module.html create mode 100644 dom/base/test/file_js_cache_save_after_load.html create mode 100644 dom/base/test/file_js_cache_save_after_load.js create mode 100644 dom/base/test/file_js_cache_syntax_error.html create mode 100644 dom/base/test/file_js_cache_syntax_error.js create mode 100644 dom/base/test/file_js_cache_with_sri.html create mode 100644 dom/base/test/file_location_href_unknown_protocol.html create mode 100644 dom/base/test/file_lock_orientation_with_pending_fullscreen.html create mode 100644 dom/base/test/file_messagemanager_unload.html create mode 100644 dom/base/test/file_module_js_cache.html create mode 100644 dom/base/test/file_module_js_cache.js create mode 100644 dom/base/test/file_module_js_cache_no_module.html create mode 100644 dom/base/test/file_module_js_cache_with_sri.html create mode 100644 dom/base/test/file_mozfiledataurl_img.jpg create mode 100644 dom/base/test/file_navigator_resolve_identity_xrays.xhtml create mode 100644 dom/base/test/file_receiveMessage.html create mode 100644 dom/base/test/file_restrictedEventSource.sjs create mode 100644 dom/base/test/file_sandbox_and_document_uri.html create mode 100644 dom/base/test/file_script.js create mode 100644 dom/base/test/file_script_module_dynamic_and_element.html create mode 100644 dom/base/test/file_script_module_dynamic_and_element.js create mode 100644 dom/base/test/file_script_module_dynamic_and_element_imported_1.js create mode 100644 dom/base/test/file_script_module_dynamic_and_element_imported_2.js create mode 100644 dom/base/test/file_script_module_dynamic_and_element_imported_3.js create mode 100644 dom/base/test/file_script_module_dynamic_and_static.html create mode 100644 dom/base/test/file_script_module_dynamic_and_static.js create mode 100644 dom/base/test/file_script_module_dynamic_and_static_imported_1.js create mode 100644 dom/base/test/file_script_module_dynamic_and_static_imported_2.js create mode 100644 dom/base/test/file_script_module_dynamic_and_static_imported_3.js create mode 100644 dom/base/test/file_script_module_dynamic_import.html create mode 100644 dom/base/test/file_script_module_dynamic_import.js create mode 100644 dom/base/test/file_script_module_dynamic_import_imported.js create mode 100644 dom/base/test/file_script_module_element_and_dynamic.html create mode 100644 dom/base/test/file_script_module_element_and_dynamic.js create mode 100644 dom/base/test/file_script_module_element_and_dynamic_imported_1.js create mode 100644 dom/base/test/file_script_module_element_and_dynamic_imported_2.js create mode 100644 dom/base/test/file_script_module_element_and_dynamic_imported_3.js create mode 100644 dom/base/test/file_script_module_element_and_import.html create mode 100644 dom/base/test/file_script_module_element_and_import.js create mode 100644 dom/base/test/file_script_module_element_and_import_imported_1.js create mode 100644 dom/base/test/file_script_module_element_and_import_imported_2.js create mode 100644 dom/base/test/file_script_module_element_and_import_imported_3.js create mode 100644 dom/base/test/file_script_module_frames_dynamic.html create mode 100644 dom/base/test/file_script_module_frames_dynamic_load.html create mode 100644 dom/base/test/file_script_module_frames_dynamic_load.js create mode 100644 dom/base/test/file_script_module_frames_dynamic_save.html create mode 100644 dom/base/test/file_script_module_frames_dynamic_save.js create mode 100644 dom/base/test/file_script_module_frames_dynamic_shared.js create mode 100644 dom/base/test/file_script_module_frames_element.html create mode 100644 dom/base/test/file_script_module_frames_element_load.html create mode 100644 dom/base/test/file_script_module_frames_element_save.html create mode 100644 dom/base/test/file_script_module_frames_element_shared.js create mode 100644 dom/base/test/file_script_module_frames_import.html create mode 100644 dom/base/test/file_script_module_frames_import_load.html create mode 100644 dom/base/test/file_script_module_frames_import_load.js create mode 100644 dom/base/test/file_script_module_frames_import_save.html create mode 100644 dom/base/test/file_script_module_frames_import_save.js create mode 100644 dom/base/test/file_script_module_frames_import_shared.js create mode 100644 dom/base/test/file_script_module_frames_relay.js create mode 100644 dom/base/test/file_script_module_import.html create mode 100644 dom/base/test/file_script_module_import.js create mode 100644 dom/base/test/file_script_module_import_and_element.html create mode 100644 dom/base/test/file_script_module_import_and_element.js create mode 100644 dom/base/test/file_script_module_import_and_element_imported_1.js create mode 100644 dom/base/test/file_script_module_import_and_element_imported_2.js create mode 100644 dom/base/test/file_script_module_import_and_element_imported_3.js create mode 100644 dom/base/test/file_script_module_import_imported.js create mode 100644 dom/base/test/file_script_module_import_multi.html create mode 100644 dom/base/test/file_script_module_import_multi.js create mode 100644 dom/base/test/file_script_module_import_multi_elems.html create mode 100644 dom/base/test/file_script_module_import_multi_elems_1.js create mode 100644 dom/base/test/file_script_module_import_multi_elems_2.js create mode 100644 dom/base/test/file_script_module_import_multi_elems_imported_once_1.js create mode 100644 dom/base/test/file_script_module_import_multi_elems_imported_once_2.js create mode 100644 dom/base/test/file_script_module_import_multi_elems_imported_once_3.js create mode 100644 dom/base/test/file_script_module_import_multi_elems_imported_twice.js create mode 100644 dom/base/test/file_script_module_import_multi_imported_once.js create mode 100644 dom/base/test/file_script_module_import_multi_imported_twice.js create mode 100644 dom/base/test/file_script_module_single.html create mode 100644 dom/base/test/file_script_module_single.js create mode 100644 dom/base/test/file_script_module_sri_basic.html create mode 100644 dom/base/test/file_script_module_sri_basic.js create mode 100644 dom/base/test/file_script_module_sri_basic_prep.html create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem.html create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem.js create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_imported.js create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_nopreload.html create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_nopreload.js create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_nopreload_imported.js create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_nopreload_prep.html create mode 100644 dom/base/test/file_script_module_sri_dynamic_elem_prep.html create mode 100644 dom/base/test/file_script_module_sri_elem_dynamic.html create mode 100644 dom/base/test/file_script_module_sri_elem_dynamic.js create mode 100644 dom/base/test/file_script_module_sri_elem_dynamic_imported.js create mode 100644 dom/base/test/file_script_module_sri_elem_dynamic_prep.html create mode 100644 dom/base/test/file_script_module_sri_elem_elem_1.html create mode 100644 dom/base/test/file_script_module_sri_elem_elem_1.js create mode 100644 dom/base/test/file_script_module_sri_elem_elem_1_prep.html create mode 100644 dom/base/test/file_script_module_sri_elem_elem_2.html create mode 100644 dom/base/test/file_script_module_sri_elem_elem_2.js create mode 100644 dom/base/test/file_script_module_sri_elem_elem_2_prep.html create mode 100644 dom/base/test/file_script_module_sri_elem_import.html create mode 100644 dom/base/test/file_script_module_sri_elem_import.js create mode 100644 dom/base/test/file_script_module_sri_elem_import_imported.js create mode 100644 dom/base/test/file_script_module_sri_elem_import_prep.html create mode 100644 dom/base/test/file_script_module_sri_fallback.html create mode 100644 dom/base/test/file_script_module_sri_fallback.js create mode 100644 dom/base/test/file_script_module_sri_fallback_failure.html create mode 100644 dom/base/test/file_script_module_sri_fallback_failure.js create mode 100644 dom/base/test/file_script_module_sri_fallback_failure_prep.html create mode 100644 dom/base/test/file_script_module_sri_fallback_prep.html create mode 100644 dom/base/test/file_script_module_sri_import_elem.html create mode 100644 dom/base/test/file_script_module_sri_import_elem.js create mode 100644 dom/base/test/file_script_module_sri_import_elem_imported.js create mode 100644 dom/base/test/file_script_module_sri_import_elem_nopreload.html create mode 100644 dom/base/test/file_script_module_sri_import_elem_nopreload.js create mode 100644 dom/base/test/file_script_module_sri_import_elem_nopreload_imported.js create mode 100644 dom/base/test/file_script_module_sri_import_elem_nopreload_prep.html create mode 100644 dom/base/test/file_script_module_sri_import_elem_prep.html create mode 100644 dom/base/test/file_script_module_static_and_dynamic.html create mode 100644 dom/base/test/file_script_module_static_and_dynamic.js create mode 100644 dom/base/test/file_script_module_static_and_dynamic_imported_1.js create mode 100644 dom/base/test/file_script_module_static_and_dynamic_imported_2.js create mode 100644 dom/base/test/file_script_module_static_and_dynamic_imported_3.js create mode 100644 dom/base/test/file_serializer_noscript.html create mode 100644 dom/base/test/file_setname.html create mode 100644 dom/base/test/file_settimeout_inner.html create mode 100644 dom/base/test/file_suppressed_events_and_scrolling.html create mode 100644 dom/base/test/file_suppressed_events_inner.html create mode 100644 dom/base/test/file_suppressed_events_middle.html create mode 100644 dom/base/test/file_suppressed_events_top.html create mode 100644 dom/base/test/file_suppressed_events_top_modalstate.html create mode 100644 dom/base/test/file_suppressed_events_top_xhr.html create mode 100644 dom/base/test/file_timer_flood.html create mode 100644 dom/base/test/file_title.xhtml create mode 100644 dom/base/test/file_toScreenRect.html create mode 100644 dom/base/test/file_use_counter_bfcache.html create mode 100644 dom/base/test/file_use_counter_bfcache_helper.html create mode 100644 dom/base/test/file_use_counter_outer.html create mode 100644 dom/base/test/file_use_counter_outer_display_none.html create mode 100644 dom/base/test/file_use_counter_style.html create mode 100644 dom/base/test/file_use_counter_svg_currentScale.svg create mode 100644 dom/base/test/file_use_counter_svg_fill_pattern.svg create mode 100644 dom/base/test/file_use_counter_svg_fill_pattern_data.svg create mode 100644 dom/base/test/file_use_counter_svg_fill_pattern_definition.svg create mode 100644 dom/base/test/file_use_counter_svg_fill_pattern_internal.svg create mode 100644 dom/base/test/file_use_counter_svg_getElementById.svg create mode 100644 dom/base/test/file_viewport_metrics_on_landscape_content.html create mode 100644 dom/base/test/file_viewport_scroll_quirks.html create mode 100644 dom/base/test/file_viewport_scroll_xml.xml create mode 100644 dom/base/test/file_webaudio_startstop.html create mode 100644 dom/base/test/file_window_close.html create mode 100644 dom/base/test/file_window_close_2.html create mode 100644 dom/base/test/file_window_focus_by_close_and_open.html create mode 100644 dom/base/test/file_x-frame-options_main.html create mode 100644 dom/base/test/file_x-frame-options_page.sjs create mode 100644 dom/base/test/file_xhtmlserializer_1.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_bodyonly.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_format.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_linebreak.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_links.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_nested_body.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_no_body.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_noflag.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_noformatpre.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_raw.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_sibling_body.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_1_wrap.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_2.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_2_basic.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_2_enthtml.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_2_entw3c.xhtml create mode 100644 dom/base/test/file_xhtmlserializer_2_latin1.xhtml create mode 100644 dom/base/test/file_youtube_flash_embed.html create mode 100644 dom/base/test/fmm/browser.ini create mode 100644 dom/base/test/fmm/browser_frame_message_manager_cache.js create mode 100644 dom/base/test/forRemoval.resource create mode 100644 dom/base/test/forRemoval.resource^headers^ create mode 100644 dom/base/test/formReset.html create mode 100644 dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml create mode 100644 dom/base/test/fullscreen/browser.ini create mode 100644 dom/base/test/fullscreen/browser_fullscreen-api-keys.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-bug-1798219.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-contextmenu-esc.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-document-mutation-navigation.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-document-mutation-race.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-document-mutation.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-navigation-history.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-navigation-race.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-navigation.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-newtab.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-sizemode.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-tab-close.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen-window-open-race.js create mode 100644 dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js create mode 100644 dom/base/test/fullscreen/chrome.ini create mode 100644 dom/base/test/fullscreen/dummy_page.html create mode 100644 dom/base/test/fullscreen/file_MozDomFullscreen.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-api-keys.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-api-race.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-api.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-async.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-backdrop.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-bug-1798219.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-denied-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-denied.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-esc-exit.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-event-order.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-featurePolicy-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-featurePolicy.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-focus-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-focus.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-hidden.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-iframe-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-iframe-middle.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-iframe-top.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-lenient-setters.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-multiple-inner.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-multiple.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-navigation.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-nested.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-newtab.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-prefixed.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-resize.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-rollback.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-scrollbar.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-selector.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-shadowdom.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-single.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-sub-iframe.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-svg-element.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-table.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-top-layer.html create mode 100644 dom/base/test/fullscreen/file_fullscreen-utils.js create mode 100644 dom/base/test/fullscreen/file_fullscreen-with-full-zoom.html create mode 100644 dom/base/test/fullscreen/file_fullscreen_meta_viewport.html create mode 100644 dom/base/test/fullscreen/fullscreen.xhtml create mode 100644 dom/base/test/fullscreen/fullscreen_helpers.js create mode 100644 dom/base/test/fullscreen/head.js create mode 100644 dom/base/test/fullscreen/mochitest.ini create mode 100644 dom/base/test/fullscreen/moz.build create mode 100644 dom/base/test/fullscreen/test_MozDomFullscreen_event.xhtml create mode 100644 dom/base/test/fullscreen/test_fullscreen-api-race.html create mode 100644 dom/base/test/fullscreen/test_fullscreen-api-rapid-cycle.html create mode 100644 dom/base/test/fullscreen/test_fullscreen-api.html create mode 100644 dom/base/test/fullscreen/test_fullscreen.xhtml create mode 100644 dom/base/test/fullscreen/test_fullscreen_meta_viewport.html create mode 100644 dom/base/test/fullscreen/test_fullscreen_modal.html create mode 100644 dom/base/test/green.png create mode 100644 dom/base/test/gtest/TestContentUtils.cpp create mode 100644 dom/base/test/gtest/TestMimeType.cpp create mode 100644 dom/base/test/gtest/TestParser.cpp create mode 100644 dom/base/test/gtest/TestPlainTextSerializer.cpp create mode 100644 dom/base/test/gtest/TestScheduler.cpp create mode 100644 dom/base/test/gtest/TestXMLSerializerNoBreakLink.cpp create mode 100644 dom/base/test/gtest/TestXPathGenerator.cpp create mode 100644 dom/base/test/gtest/moz.build create mode 100644 dom/base/test/head.js create mode 100644 dom/base/test/iframe1_bug1640766.html create mode 100644 dom/base/test/iframe1_bug426646.html create mode 100644 dom/base/test/iframe1_bug431701.html create mode 100644 dom/base/test/iframe2_bug1640766.html create mode 100644 dom/base/test/iframe2_bug426646.html create mode 100644 dom/base/test/iframe2_bug431701.html create mode 100644 dom/base/test/iframe3_bug431701.html create mode 100644 dom/base/test/iframe4_bug431701.xml create mode 100644 dom/base/test/iframe5_bug431701.xml create mode 100644 dom/base/test/iframe6_bug431701.xml create mode 100644 dom/base/test/iframe7_bug431701.xml create mode 100644 dom/base/test/iframe_bug962251.html create mode 100644 dom/base/test/iframe_bug976673.html create mode 100644 dom/base/test/iframe_main_bug1022229.html create mode 100644 dom/base/test/iframe_meta_refresh.sjs create mode 100644 dom/base/test/iframe_postMessage_solidus.html create mode 100644 dom/base/test/iframe_postMessages.html create mode 100644 dom/base/test/iframe_sandbox_bug1022229.html create mode 100644 dom/base/test/iframe_shared_compartment2a.html create mode 100644 dom/base/test/iframe_shared_compartment2b.html create mode 100644 dom/base/test/intersectionobserver_cross_domain_iframe.html create mode 100644 dom/base/test/intersectionobserver_iframe.html create mode 100644 dom/base/test/intersectionobserver_window.html create mode 100644 dom/base/test/invalid_accesscontrol.resource create mode 100644 dom/base/test/invalid_accesscontrol.resource^headers^ create mode 100644 dom/base/test/jsmodules/.eslintrc.js create mode 100644 dom/base/test/jsmodules/chrome.ini create mode 100644 dom/base/test/jsmodules/iframe_extractIntroType.html create mode 100644 dom/base/test/jsmodules/importmaps/chrome.ini create mode 100644 dom/base/test/jsmodules/importmaps/external_importMap.js create mode 100644 dom/base/test/jsmodules/importmaps/insert_a_base_element.js create mode 100644 dom/base/test/jsmodules/importmaps/module_simpleExport.js create mode 100644 dom/base/test/jsmodules/importmaps/module_simpleImportMap.js create mode 100644 dom/base/test/jsmodules/importmaps/module_simpleImportMap_dir.js create mode 100644 dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap.js create mode 100644 dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap_https.js create mode 100644 dom/base/test/jsmodules/importmaps/module_sortedImportMap.js create mode 100644 dom/base/test/jsmodules/importmaps/moz.build create mode 100644 dom/base/test/jsmodules/importmaps/scope1/module_simpleExport.js create mode 100644 dom/base/test/jsmodules/importmaps/scope1/module_simpleImportMap.js create mode 100644 dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleExport.js create mode 100644 dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleImportMap.js create mode 100644 dom/base/test/jsmodules/importmaps/test_dynamic_import_reject_importMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_externalImportMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_import_meta_resolve_importMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_inline_module_reject_importMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_load_importMap_with_base.html create mode 100644 dom/base/test/jsmodules/importmaps/test_load_importMap_with_base2.html create mode 100644 dom/base/test/jsmodules/importmaps/test_module_script_reject_importMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_parse_importMap_failed.html create mode 100644 dom/base/test/jsmodules/importmaps/test_reject_multiple_importMaps.html create mode 100644 dom/base/test/jsmodules/importmaps/test_simpleImportMap.html create mode 100644 dom/base/test/jsmodules/importmaps/test_sortedImportMap.html create mode 100644 dom/base/test/jsmodules/module_badImport.js create mode 100644 dom/base/test/jsmodules/module_badSyntax.js create mode 100644 dom/base/test/jsmodules/module_cyclic1.js create mode 100644 dom/base/test/jsmodules/module_cyclic2.js create mode 100644 dom/base/test/jsmodules/module_cyclic3.js create mode 100644 dom/base/test/jsmodules/module_extractIntroType.js create mode 100644 dom/base/test/jsmodules/module_large1.js create mode 100644 dom/base/test/jsmodules/module_large2.js create mode 100644 dom/base/test/jsmodules/module_large3.js create mode 100644 dom/base/test/jsmodules/module_missingImport.js create mode 100644 dom/base/test/jsmodules/module_multiImports.js create mode 100644 dom/base/test/jsmodules/module_multiLargeImports.js create mode 100644 dom/base/test/jsmodules/module_setRan.js create mode 100644 dom/base/test/jsmodules/module_simple1.js create mode 100644 dom/base/test/jsmodules/module_simple2.js create mode 100644 dom/base/test/jsmodules/module_simple3.js create mode 100644 dom/base/test/jsmodules/module_simpleExport.js create mode 100644 dom/base/test/jsmodules/module_simpleImport.js create mode 100644 dom/base/test/jsmodules/module_testSyntax.js create mode 100644 dom/base/test/jsmodules/moz.build create mode 100644 dom/base/test/jsmodules/script_simple2.js create mode 100644 dom/base/test/jsmodules/test_asyncInlineModules.html create mode 100644 dom/base/test/jsmodules/test_cyclicImport.html create mode 100644 dom/base/test/jsmodules/test_dynamicImportErrorMessage.html create mode 100644 dom/base/test/jsmodules/test_importIntroType.html create mode 100644 dom/base/test/jsmodules/test_importNotFound.html create mode 100644 dom/base/test/jsmodules/test_importResolveFailed.html create mode 100644 dom/base/test/jsmodules/test_import_meta_resolve.html create mode 100644 dom/base/test/jsmodules/test_importedModuleMemoization.html create mode 100644 dom/base/test/jsmodules/test_linkErrorInCommon1.html create mode 100644 dom/base/test/jsmodules/test_linkErrorInCommon2.html create mode 100644 dom/base/test/jsmodules/test_moduleNotFound.html create mode 100644 dom/base/test/jsmodules/test_moduleParsedAsModule.html create mode 100644 dom/base/test/jsmodules/test_moduleScriptsRun.html create mode 100644 dom/base/test/jsmodules/test_multiAsyncImports.html create mode 100644 dom/base/test/jsmodules/test_multiModuleImports.html create mode 100644 dom/base/test/jsmodules/test_multiModuleLargeImports.html create mode 100644 dom/base/test/jsmodules/test_multiTopLevelImports.html create mode 100644 dom/base/test/jsmodules/test_multiTopLevelLargeImports.html create mode 100644 dom/base/test/jsmodules/test_scriptInsertedModule.html create mode 100644 dom/base/test/jsmodules/test_scriptModuleOrder.html create mode 100644 dom/base/test/jsmodules/test_scriptNotParsedAsModule.html create mode 100644 dom/base/test/jsmodules/test_simpleImport.html create mode 100644 dom/base/test/jsmodules/test_syntaxError.html create mode 100644 dom/base/test/jsmodules/test_syntaxErrorAsync.html create mode 100644 dom/base/test/jsmodules/test_syntaxErrorInline.html create mode 100644 dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html create mode 100644 dom/base/test/jsmodules/test_topLevelIntroType.html create mode 100644 dom/base/test/jsmodules/test_toplevelModuleMemoization.html create mode 100644 dom/base/test/jsmodules/test_typeAttrCaseInsensitive.html create mode 100644 dom/base/test/meta_viewport/mochitest.ini create mode 100644 dom/base/test/meta_viewport/moz.build create mode 100644 dom/base/test/meta_viewport/test_meta_viewport0.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport1.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport2.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport3.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport4.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport5.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport6.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport7.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport8.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_width.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_device_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_0_5.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_1.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_change_content_among_multiple.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_change_name.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_change_name_among_multiple.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_device_width.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_0_5.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_2.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_empty_content_and_valid_content_tags.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_fit.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_fit_multiple.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_fixed_width_and_zero_display_width.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_initial_scale_0_5.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_initial_scale_2.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_initial_scale_with_trailing_characters.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_insert_before_existing_tag.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0_5.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_2.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_multiple_tags.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_negative_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_no_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_valid_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_no_content_and_valid_content_tags.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_no_width_and_negative_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_no_width_and_valid_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_remove_node.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_remove_node_from_multiple.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_removing_content_attribute.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_replace_content.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_tiny_display_size.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_negative_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_no_height.html create mode 100644 dom/base/test/meta_viewport/test_meta_viewport_width_with_trailing_characters.html create mode 100644 dom/base/test/meta_viewport/viewport_helpers.js create mode 100644 dom/base/test/mochitest.ini create mode 100644 dom/base/test/moz.build create mode 100644 dom/base/test/object_bug353334.html create mode 100644 dom/base/test/object_bug455472.html create mode 100644 dom/base/test/red.png create mode 100644 dom/base/test/referrerHelper.js create mode 100644 dom/base/test/referrer_change_server.sjs create mode 100644 dom/base/test/referrer_header.sjs create mode 100644 dom/base/test/referrer_helper.js create mode 100644 dom/base/test/referrer_testserver.sjs create mode 100644 dom/base/test/reftest/mixed-bmp-png.ico create mode 100644 dom/base/test/reftest/reftest.list create mode 100644 dom/base/test/reftest/test_bug1525662-ref.html create mode 100644 dom/base/test/reftest/test_bug1525662.txt create mode 100644 dom/base/test/reftest/test_bug920877-ref.html create mode 100644 dom/base/test/reftest/test_bug920877.html create mode 100644 dom/base/test/reftest/test_xmlPrettyPrint_csp-ref.xml create mode 100644 dom/base/test/reftest/test_xmlPrettyPrint_csp.xml create mode 100644 dom/base/test/reftest/test_xmlPrettyPrint_csp.xml^headers^ create mode 100644 dom/base/test/script-1_bug597345.sjs create mode 100644 dom/base/test/script-2_bug597345.js create mode 100644 dom/base/test/script_bug1238440.js create mode 100644 dom/base/test/script_bug602838.sjs create mode 100644 dom/base/test/script_postmessages_fileList.js create mode 100644 dom/base/test/send_gzip_content.sjs create mode 100644 dom/base/test/slow.sjs create mode 100644 dom/base/test/somedatas.resource create mode 100644 dom/base/test/somedatas.resource^headers^ create mode 100644 dom/base/test/test_EventSource_redirects.html create mode 100644 dom/base/test/test_Image_constructor.html create mode 100644 dom/base/test/test_NodeIterator_basics_filters.xhtml create mode 100644 dom/base/test/test_NodeIterator_mutations_1.xhtml create mode 100644 dom/base/test/test_NodeIterator_mutations_2.html create mode 100644 dom/base/test/test_NodeIterator_mutations_3.html create mode 100644 dom/base/test/test_anchor_area_referrer.html create mode 100644 dom/base/test/test_anchor_area_referrer_changing.html create mode 100644 dom/base/test/test_anchor_area_referrer_invalid.html create mode 100644 dom/base/test/test_anchor_area_referrer_rel.html create mode 100644 dom/base/test/test_anchor_target_blank_referrer.html create mode 100644 dom/base/test/test_anonymousContent_api.html create mode 100644 dom/base/test/test_anonymousContent_append_after_reflow.html create mode 100644 dom/base/test/test_anonymousContent_canvas.html create mode 100644 dom/base/test/test_anonymousContent_insert.html create mode 100644 dom/base/test/test_anonymousContent_manipulate_content.html create mode 100644 dom/base/test/test_anonymousContent_set_style.html create mode 100644 dom/base/test/test_anonymousContent_style_csp.html create mode 100644 dom/base/test/test_anonymousContent_style_csp.html^headers^ create mode 100644 dom/base/test/test_anonymousContent_xul_window.xhtml create mode 100644 dom/base/test/test_appname_override.html create mode 100644 dom/base/test/test_async_setTimeout_stack.html create mode 100644 dom/base/test/test_async_setTimeout_stack_across_globals.html create mode 100644 dom/base/test/test_base.xhtml create mode 100644 dom/base/test/test_blockParsing.html create mode 100644 dom/base/test/test_blocking_image.html create mode 100644 dom/base/test/test_bug1008126.html create mode 100644 dom/base/test/test_bug1016960.html create mode 100644 dom/base/test/test_bug1022229.html create mode 100644 dom/base/test/test_bug1025933.html create mode 100644 dom/base/test/test_bug1037687.html create mode 100644 dom/base/test/test_bug1037687_subframe.html create mode 100644 dom/base/test/test_bug1043106.html create mode 100644 dom/base/test/test_bug1057176.html create mode 100644 dom/base/test/test_bug1060938.html create mode 100644 dom/base/test/test_bug1064481.html create mode 100644 dom/base/test/test_bug1070015.html create mode 100644 dom/base/test/test_bug1075702.html create mode 100644 dom/base/test/test_bug1091883.html create mode 100644 dom/base/test/test_bug1100912.html create mode 100644 dom/base/test/test_bug1101364.html create mode 100644 dom/base/test/test_bug1118689.html create mode 100644 dom/base/test/test_bug1120222.html create mode 100644 dom/base/test/test_bug1126851.html create mode 100644 dom/base/test/test_bug116083.html create mode 100644 dom/base/test/test_bug1163743.html create mode 100644 dom/base/test/test_bug1165501.html create mode 100644 dom/base/test/test_bug1187157.html create mode 100644 dom/base/test/test_bug1198095.html create mode 100644 dom/base/test/test_bug1222633.html create mode 100644 dom/base/test/test_bug1222633_link_update.html create mode 100644 dom/base/test/test_bug1238440.html create mode 100644 dom/base/test/test_bug1250148.html create mode 100644 dom/base/test/test_bug1259588.html create mode 100644 dom/base/test/test_bug1268962.html create mode 100644 dom/base/test/test_bug1274806.html create mode 100644 dom/base/test/test_bug1281963.html create mode 100644 dom/base/test/test_bug1295852.html create mode 100644 dom/base/test/test_bug1307730.html create mode 100644 dom/base/test/test_bug1308069.html create mode 100644 dom/base/test/test_bug1314032.html create mode 100644 dom/base/test/test_bug1318303.html create mode 100644 dom/base/test/test_bug1375050.html create mode 100644 dom/base/test/test_bug1381710.html create mode 100644 dom/base/test/test_bug1399605.html create mode 100644 dom/base/test/test_bug1404385.html create mode 100644 dom/base/test/test_bug1406102.html create mode 100644 dom/base/test/test_bug1421568.html create mode 100644 dom/base/test/test_bug1433073.html create mode 100644 dom/base/test/test_bug1472427.html create mode 100644 dom/base/test/test_bug1499169.html create mode 100644 dom/base/test/test_bug1576154.html create mode 100644 dom/base/test/test_bug1632975.html create mode 100644 dom/base/test/test_bug1639328.html create mode 100644 dom/base/test/test_bug1640766.html create mode 100644 dom/base/test/test_bug1648887.html create mode 100644 dom/base/test/test_bug166235.html create mode 100644 dom/base/test/test_bug1667316.html create mode 100644 dom/base/test/test_bug1730284.html create mode 100644 dom/base/test/test_bug1739957.html create mode 100644 dom/base/test/test_bug1784187.html create mode 100644 dom/base/test/test_bug1799354.html create mode 100644 dom/base/test/test_bug199959.html create mode 100644 dom/base/test/test_bug218236.html create mode 100644 dom/base/test/test_bug218277.html create mode 100644 dom/base/test/test_bug238409.html create mode 100644 dom/base/test/test_bug254337.html create mode 100644 dom/base/test/test_bug270145.xhtml create mode 100644 dom/base/test/test_bug276037-1.html create mode 100644 dom/base/test/test_bug276037-2.xhtml create mode 100644 dom/base/test/test_bug282547.html create mode 100644 dom/base/test/test_bug28293.html create mode 100644 dom/base/test/test_bug28293.xhtml create mode 100644 dom/base/test/test_bug298064.html create mode 100644 dom/base/test/test_bug300992.html create mode 100644 dom/base/test/test_bug311681.xml create mode 100644 dom/base/test/test_bug313646.html create mode 100644 dom/base/test/test_bug320799.html create mode 100644 dom/base/test/test_bug322317.html create mode 100644 dom/base/test/test_bug326337.html create mode 100644 dom/base/test/test_bug331959.html create mode 100644 dom/base/test/test_bug333064.html create mode 100644 dom/base/test/test_bug333198.html create mode 100644 dom/base/test/test_bug333673.html create mode 100644 dom/base/test/test_bug337631.html create mode 100644 dom/base/test/test_bug338541.xhtml create mode 100644 dom/base/test/test_bug338583.html create mode 100644 dom/base/test/test_bug338679.html create mode 100644 dom/base/test/test_bug339494.html create mode 100644 dom/base/test/test_bug339494.xhtml create mode 100644 dom/base/test/test_bug343596.html create mode 100644 dom/base/test/test_bug345339.html create mode 100644 dom/base/test/test_bug346485.html create mode 100644 dom/base/test/test_bug352728.html create mode 100644 dom/base/test/test_bug352728.xhtml create mode 100644 dom/base/test/test_bug353334.html create mode 100644 dom/base/test/test_bug355026.html create mode 100644 dom/base/test/test_bug357450.html create mode 100644 dom/base/test/test_bug357450.xhtml create mode 100644 dom/base/test/test_bug357450_svg.xhtml create mode 100644 dom/base/test/test_bug357509.html create mode 100644 dom/base/test/test_bug358660.html create mode 100644 dom/base/test/test_bug362391.xhtml create mode 100644 dom/base/test/test_bug364092.xhtml create mode 100644 dom/base/test/test_bug364413.xhtml create mode 100644 dom/base/test/test_bug366944.html create mode 100644 dom/base/test/test_bug366946.html create mode 100644 dom/base/test/test_bug367164.html create mode 100644 dom/base/test/test_bug368972.html create mode 100644 dom/base/test/test_bug371576-2.html create mode 100644 dom/base/test/test_bug371576-3.html create mode 100644 dom/base/test/test_bug371576-4.html create mode 100644 dom/base/test/test_bug371576-5.html create mode 100644 dom/base/test/test_bug372086.html create mode 100644 dom/base/test/test_bug372964-2.html create mode 100644 dom/base/test/test_bug372964.html create mode 100644 dom/base/test/test_bug373181.xhtml create mode 100644 dom/base/test/test_bug375314-2.html create mode 100644 dom/base/test/test_bug375314.html create mode 100644 dom/base/test/test_bug378969.html create mode 100644 dom/base/test/test_bug380418.html create mode 100644 dom/base/test/test_bug380418.html^headers^ create mode 100644 dom/base/test/test_bug382113.html create mode 100644 dom/base/test/test_bug382871.html create mode 100644 dom/base/test/test_bug384003.xhtml create mode 100644 dom/base/test/test_bug390219.html create mode 100644 dom/base/test/test_bug390735.html create mode 100644 dom/base/test/test_bug392318.html create mode 100644 dom/base/test/test_bug392511.html create mode 100644 dom/base/test/test_bug393968.html create mode 100644 dom/base/test/test_bug395915.html create mode 100644 dom/base/test/test_bug397234.html create mode 100644 dom/base/test/test_bug398243.html create mode 100644 dom/base/test/test_bug401662.html create mode 100644 dom/base/test/test_bug402150.html create mode 100644 dom/base/test/test_bug402150.html^headers^ create mode 100644 dom/base/test/test_bug403841.html create mode 100644 dom/base/test/test_bug403852.html create mode 100644 dom/base/test/test_bug403868.xml create mode 100644 dom/base/test/test_bug405182.html create mode 100644 dom/base/test/test_bug409380.html create mode 100644 dom/base/test/test_bug410229.html create mode 100644 dom/base/test/test_bug413974.html create mode 100644 dom/base/test/test_bug414190.html create mode 100644 dom/base/test/test_bug415860.html create mode 100644 dom/base/test/test_bug416317-1.html create mode 100644 dom/base/test/test_bug416317-2.html create mode 100644 dom/base/test/test_bug416383.html create mode 100644 dom/base/test/test_bug417255.html create mode 100644 dom/base/test/test_bug417384.html create mode 100644 dom/base/test/test_bug418214.html create mode 100644 dom/base/test/test_bug418986-1.html create mode 100644 dom/base/test/test_bug419132.html create mode 100644 dom/base/test/test_bug419527.xhtml create mode 100644 dom/base/test/test_bug420609.xhtml create mode 100644 dom/base/test/test_bug420700.html create mode 100644 dom/base/test/test_bug421602.html create mode 100644 dom/base/test/test_bug422403-1.html create mode 100644 dom/base/test/test_bug422403-2.xhtml create mode 100644 dom/base/test/test_bug422537.html create mode 100644 dom/base/test/test_bug424212.html create mode 100644 dom/base/test/test_bug424359-1.html create mode 100644 dom/base/test/test_bug424359-2.html create mode 100644 dom/base/test/test_bug426308.html create mode 100644 dom/base/test/test_bug426646.html create mode 100644 dom/base/test/test_bug428847.html create mode 100644 dom/base/test/test_bug431082.html create mode 100644 dom/base/test/test_bug431701.html create mode 100644 dom/base/test/test_bug431833.html create mode 100644 dom/base/test/test_bug433533.html create mode 100644 dom/base/test/test_bug433662.html create mode 100644 dom/base/test/test_bug435425.html create mode 100644 dom/base/test/test_bug444322.html create mode 100644 dom/base/test/test_bug444546.html create mode 100644 dom/base/test/test_bug444722.html create mode 100644 dom/base/test/test_bug448993.html create mode 100644 dom/base/test/test_bug450160.html create mode 100644 dom/base/test/test_bug451376.html create mode 100644 dom/base/test/test_bug453521.html create mode 100644 dom/base/test/test_bug453736.html create mode 100644 dom/base/test/test_bug454325.html create mode 100644 dom/base/test/test_bug454326.html create mode 100644 dom/base/test/test_bug455472.html create mode 100644 dom/base/test/test_bug455629.html create mode 100644 dom/base/test/test_bug456262.html create mode 100644 dom/base/test/test_bug457746.html create mode 100644 dom/base/test/test_bug459424.html create mode 100644 dom/base/test/test_bug461555.html create mode 100644 dom/base/test/test_bug461735.html create mode 100644 dom/base/test/test_bug465767.html create mode 100644 dom/base/test/test_bug466080.html create mode 100644 dom/base/test/test_bug466409.html create mode 100644 dom/base/test/test_bug466751.xhtml create mode 100644 dom/base/test/test_bug469020.html create mode 100644 dom/base/test/test_bug469304.html create mode 100644 dom/base/test/test_bug473162-1.html create mode 100644 dom/base/test/test_bug473162-2.html create mode 100644 dom/base/test/test_bug475156.html create mode 100644 dom/base/test/test_bug482935.html create mode 100644 dom/base/test/test_bug484396.html create mode 100644 dom/base/test/test_bug493881.html create mode 100644 dom/base/test/test_bug493881.js create mode 100644 dom/base/test/test_bug498240.html create mode 100644 dom/base/test/test_bug498433.html create mode 100644 dom/base/test/test_bug498897.html create mode 100644 dom/base/test/test_bug499656.html create mode 100644 dom/base/test/test_bug499656.xhtml create mode 100644 dom/base/test/test_bug500937.html create mode 100644 dom/base/test/test_bug503473.html create mode 100644 dom/base/test/test_bug503481.html create mode 100644 dom/base/test/test_bug503481b.html create mode 100644 dom/base/test/test_bug51034.html create mode 100644 dom/base/test/test_bug513194.html create mode 100644 dom/base/test/test_bug5141.html create mode 100644 dom/base/test/test_bug514487.html create mode 100644 dom/base/test/test_bug515401.html create mode 100644 dom/base/test/test_bug518104.html create mode 100644 dom/base/test/test_bug527896.html create mode 100644 dom/base/test/test_bug540854.html create mode 100644 dom/base/test/test_bug541937.html create mode 100644 dom/base/test/test_bug544642.html create mode 100644 dom/base/test/test_bug545644.html create mode 100644 dom/base/test/test_bug545644.xhtml create mode 100644 dom/base/test/test_bug548463.html create mode 100644 dom/base/test/test_bug553896.xhtml create mode 100644 dom/base/test/test_bug557892.html create mode 100644 dom/base/test/test_bug558726.html create mode 100644 dom/base/test/test_bug559526.html create mode 100644 dom/base/test/test_bug560780.html create mode 100644 dom/base/test/test_bug562137.html create mode 100644 dom/base/test/test_bug562169-1.html create mode 100644 dom/base/test/test_bug562169-2.html create mode 100644 dom/base/test/test_bug562652.html create mode 100644 dom/base/test/test_bug564047.html create mode 100644 dom/base/test/test_bug564863-2.xhtml create mode 100644 dom/base/test/test_bug564863.xhtml create mode 100644 dom/base/test/test_bug567350.html create mode 100644 dom/base/test/test_bug574596.html create mode 100644 dom/base/test/test_bug578096.html create mode 100644 dom/base/test/test_bug585978.html create mode 100644 dom/base/test/test_bug587931.html create mode 100644 dom/base/test/test_bug588990.html create mode 100644 dom/base/test/test_bug590812.html create mode 100644 dom/base/test/test_bug590870.html create mode 100644 dom/base/test/test_bug592366.html create mode 100644 dom/base/test/test_bug592829.html create mode 100644 dom/base/test/test_bug597345.html create mode 100644 dom/base/test/test_bug599295.html create mode 100644 dom/base/test/test_bug599588.html create mode 100644 dom/base/test/test_bug601803.html create mode 100644 dom/base/test/test_bug602838.html create mode 100644 dom/base/test/test_bug604592.html create mode 100644 dom/base/test/test_bug604660.html create mode 100644 dom/base/test/test_bug605982.html create mode 100644 dom/base/test/test_bug606729.html create mode 100644 dom/base/test/test_bug614058.html create mode 100644 dom/base/test/test_bug622088.html create mode 100644 dom/base/test/test_bug622117.html create mode 100644 dom/base/test/test_bug622246.html create mode 100644 dom/base/test/test_bug625722.html create mode 100644 dom/base/test/test_bug626262.html create mode 100644 dom/base/test/test_bug628938.html create mode 100644 dom/base/test/test_bug631615.html create mode 100644 dom/base/test/test_bug638112.html create mode 100644 dom/base/test/test_bug647518.html create mode 100644 dom/base/test/test_bug650001.html create mode 100644 dom/base/test/test_bug650776.html create mode 100644 dom/base/test/test_bug650784.html create mode 100644 dom/base/test/test_bug656283.html create mode 100644 dom/base/test/test_bug664916.html create mode 100644 dom/base/test/test_bug666604.html create mode 100644 dom/base/test/test_bug675121.html create mode 100644 dom/base/test/test_bug675166.html create mode 100644 dom/base/test/test_bug682463.html create mode 100644 dom/base/test/test_bug682554.html create mode 100644 dom/base/test/test_bug682592.html create mode 100644 dom/base/test/test_bug684671.html create mode 100644 dom/base/test/test_bug685798.html create mode 100644 dom/base/test/test_bug686449.xhtml create mode 100644 dom/base/test/test_bug687859.html create mode 100644 dom/base/test/test_bug690056.html create mode 100644 dom/base/test/test_bug692434.html create mode 100644 dom/base/test/test_bug693615.html create mode 100644 dom/base/test/test_bug693875.html create mode 100644 dom/base/test/test_bug694754.xhtml create mode 100644 dom/base/test/test_bug696301-1.html create mode 100644 dom/base/test/test_bug696301-2.html create mode 100644 dom/base/test/test_bug698381.html create mode 100644 dom/base/test/test_bug698384.html create mode 100644 dom/base/test/test_bug704063.html create mode 100644 dom/base/test/test_bug704320-1.html create mode 100644 dom/base/test/test_bug704320-2.html create mode 100644 dom/base/test/test_bug704320_policyset.html create mode 100644 dom/base/test/test_bug704320_policyset2.html create mode 100644 dom/base/test/test_bug704320_preload.html create mode 100644 dom/base/test/test_bug707142.html create mode 100644 dom/base/test/test_bug708620.html create mode 100644 dom/base/test/test_bug711047.html create mode 100644 dom/base/test/test_bug711180.html create mode 100644 dom/base/test/test_bug719533.html create mode 100644 dom/base/test/test_bug726364.html create mode 100644 dom/base/test/test_bug737087.html create mode 100644 dom/base/test/test_bug737565.html create mode 100644 dom/base/test/test_bug737612.html create mode 100644 dom/base/test/test_bug738108.html create mode 100644 dom/base/test/test_bug744830.html create mode 100644 dom/base/test/test_bug749367.html create mode 100644 dom/base/test/test_bug750096.html create mode 100644 dom/base/test/test_bug753278.html create mode 100644 dom/base/test/test_bug761120.html create mode 100644 dom/base/test/test_bug769117.html create mode 100644 dom/base/test/test_bug782342.html create mode 100644 dom/base/test/test_bug787778.html create mode 100644 dom/base/test/test_bug789315.html create mode 100644 dom/base/test/test_bug789856.html create mode 100644 dom/base/test/test_bug809003.html create mode 100644 dom/base/test/test_bug810494.html create mode 100644 dom/base/test/test_bug811701.html create mode 100644 dom/base/test/test_bug811701.xhtml create mode 100644 dom/base/test/test_bug813919.html create mode 100644 dom/base/test/test_bug814576.html create mode 100644 dom/base/test/test_bug819051.html create mode 100644 dom/base/test/test_bug820909.html create mode 100644 dom/base/test/test_bug864595.html create mode 100644 dom/base/test/test_bug868999.html create mode 100644 dom/base/test/test_bug869000.html create mode 100644 dom/base/test/test_bug869002.html create mode 100644 dom/base/test/test_bug869006.html create mode 100644 dom/base/test/test_bug876282.html create mode 100644 dom/base/test/test_bug891952.html create mode 100644 dom/base/test/test_bug894874.html create mode 100644 dom/base/test/test_bug895974.html create mode 100644 dom/base/test/test_bug907892.html create mode 100644 dom/base/test/test_bug913761.html create mode 100644 dom/base/test/test_bug922681.html create mode 100644 dom/base/test/test_bug927196.html create mode 100644 dom/base/test/test_bug945152.html create mode 100644 dom/base/test/test_bug962251.html create mode 100644 dom/base/test/test_bug976673.html create mode 100644 dom/base/test/test_bug982153.html create mode 100644 dom/base/test/test_bug999456.html create mode 100644 dom/base/test/test_caretPositionFromPoint.html create mode 100644 dom/base/test/test_change_policy.html create mode 100644 dom/base/test/test_clearTimeoutIntervalNoArg.html create mode 100644 dom/base/test/test_clipboard_nbsp.html create mode 100644 dom/base/test/test_constructor-assignment.html create mode 100644 dom/base/test/test_constructor.html create mode 100644 dom/base/test/test_content_iterator_post_order.html create mode 100644 dom/base/test/test_content_iterator_pre_order.html create mode 100644 dom/base/test/test_content_iterator_subtree.html create mode 100644 dom/base/test/test_copyimage.html create mode 100644 dom/base/test/test_copypaste.html create mode 100644 dom/base/test/test_copypaste.xhtml create mode 100644 dom/base/test/test_copypaste_disabled.html create mode 100644 dom/base/test/test_createHTMLDocument.html create mode 100644 dom/base/test/test_current_inner_window.html create mode 100644 dom/base/test/test_custom_element.html create mode 100644 dom/base/test/test_custom_element_reflector.html create mode 100644 dom/base/test/test_data_uri.html create mode 100644 dom/base/test/test_delazification_strategy.html create mode 100644 dom/base/test/test_document.all_iteration.html create mode 100644 dom/base/test/test_document.all_unqualified.html create mode 100644 dom/base/test/test_document_constructor.html create mode 100644 dom/base/test/test_document_importNode_document.html create mode 100644 dom/base/test/test_document_wireframe.html create mode 100644 dom/base/test/test_domparser_null_char.html create mode 100644 dom/base/test/test_domparsing.html create mode 100644 dom/base/test/test_domrequest.html create mode 100644 dom/base/test/test_domrequesthelper.xhtml create mode 100644 dom/base/test/test_domwindowutils.html create mode 100644 dom/base/test/test_element.matches.html create mode 100644 dom/base/test/test_elementTraversal.html create mode 100644 dom/base/test/test_element_closest.html create mode 100644 dom/base/test/test_embed_xorigin_document.html create mode 100644 dom/base/test/test_encodeToStringWithMaxLength.html create mode 100644 dom/base/test/test_encodeToStringWithRequiresReinitAfterOutput.html create mode 100644 dom/base/test/test_eventsource_event_listener_leaks.html create mode 100644 dom/base/test/test_eventsourceservice_basic.html create mode 100644 dom/base/test/test_eventsourceservice_reconnect_error.html create mode 100644 dom/base/test/test_eventsourceservice_status_error.html create mode 100644 dom/base/test/test_eventsourceservice_worker.html create mode 100644 dom/base/test/test_explicit_user_agent.html create mode 100644 dom/base/test/test_find.html create mode 100644 dom/base/test/test_find_bug1601118.html create mode 100644 dom/base/test/test_find_bug1654683.html create mode 100644 dom/base/test/test_find_nac.html create mode 100644 dom/base/test/test_focus_design_mode.html create mode 100644 dom/base/test/test_focus_display_none_xorigin_iframe.html create mode 100644 dom/base/test/test_focus_keyboard_event.html create mode 100644 dom/base/test/test_focus_scroll_padding_tab.html create mode 100644 dom/base/test/test_focus_scrollable_fieldset.html create mode 100644 dom/base/test/test_focus_scrollable_input.html create mode 100644 dom/base/test/test_focus_shadow_dom.html create mode 100644 dom/base/test/test_focus_shadow_dom_root.html create mode 100644 dom/base/test/test_fragment_sanitization.xhtml create mode 100644 dom/base/test/test_getAttribute_after_createAttribute.html create mode 100644 dom/base/test/test_getElementById.html create mode 100644 dom/base/test/test_getLastOverWindowPointerLocationInCSSPixels.html create mode 100644 dom/base/test/test_getTranslationNodes.html create mode 100644 dom/base/test/test_getTranslationNodes_limit.html create mode 100644 dom/base/test/test_gsp-qualified.html create mode 100644 dom/base/test/test_gsp-quirks.html create mode 100644 dom/base/test/test_gsp-standards.html create mode 100644 dom/base/test/test_history_document_open.html create mode 100644 dom/base/test/test_history_state_null.html create mode 100644 dom/base/test/test_html_colors_quirks.html create mode 100644 dom/base/test/test_html_colors_standards.html create mode 100644 dom/base/test/test_htmlcopyencoder.html create mode 100644 dom/base/test/test_htmlcopyencoder.xhtml create mode 100644 dom/base/test/test_iframe_event_listener_leaks.html create mode 100644 dom/base/test/test_iframe_referrer.html create mode 100644 dom/base/test/test_iframe_referrer_changing.html create mode 100644 dom/base/test/test_iframe_referrer_invalid.html create mode 100644 dom/base/test/test_innersize_scrollport.html create mode 100644 dom/base/test/test_input_vsync_alignment_inner_event_loop.html create mode 100644 dom/base/test/test_input_vsync_alignment_input_while_vsync.html create mode 100644 dom/base/test/test_input_vsync_alignment_lower_than_normal.html create mode 100644 dom/base/test/test_integer_attr_with_leading_zero.html create mode 100644 dom/base/test/test_intersectionobservers.html create mode 100644 dom/base/test/test_link_prefetch.html create mode 100644 dom/base/test/test_link_preload.html create mode 100644 dom/base/test/test_link_stylesheet.html create mode 100644 dom/base/test/test_location_href_unknown_protocol.html create mode 100644 dom/base/test/test_lock_orientation_after_fullscreen.html create mode 100644 dom/base/test/test_lock_orientation_with_pending_fullscreen.html create mode 100644 dom/base/test/test_messagePort.html create mode 100644 dom/base/test/test_messagemanager_send_principal.html create mode 100644 dom/base/test/test_meta_refresh_referrer.html create mode 100644 dom/base/test/test_mozMatchesSelector.html create mode 100644 dom/base/test/test_mutationobservers.html create mode 100644 dom/base/test/test_named_frames.html create mode 100644 dom/base/test/test_navigatorPrefOverride.html create mode 100644 dom/base/test/test_navigator_cookieEnabled.html create mode 100644 dom/base/test/test_navigator_hardwareConcurrency.html create mode 100644 dom/base/test/test_navigator_language.html create mode 100644 dom/base/test/test_navigator_resolve_identity_xrays.xhtml create mode 100644 dom/base/test/test_nested_event_loop_spin_and_idle_tasks.html create mode 100644 dom/base/test/test_nodelist_holes.html create mode 100644 dom/base/test/test_openDialogChromeOnly.html create mode 100644 dom/base/test/test_open_null_features.html create mode 100644 dom/base/test/test_pasting_svg_image.html create mode 100644 dom/base/test/test_pdf_print.html create mode 100644 dom/base/test/test_plugin_freezing.html create mode 100644 dom/base/test/test_postMessage_originAttributes.html create mode 100644 dom/base/test/test_postMessage_solidus.html create mode 100644 dom/base/test/test_postMessages_broadcastChannel.html create mode 100644 dom/base/test/test_postMessages_messagePort.html create mode 100644 dom/base/test/test_postMessages_window.html create mode 100644 dom/base/test/test_postMessages_workers.html create mode 100644 dom/base/test/test_processing_instruction_update_stylesheet.xhtml create mode 100644 dom/base/test/test_progress_events_for_gzip_data.html create mode 100644 dom/base/test/test_pushState_structuredclone.html create mode 100644 dom/base/test/test_range_bounds.html create mode 100644 dom/base/test/test_reentrant_flush.html create mode 100644 dom/base/test/test_root_iframe.html create mode 100644 dom/base/test/test_sandbox_and_document_uri.html create mode 100644 dom/base/test/test_sandboxed_blob_uri.html create mode 100644 dom/base/test/test_sanitize_xhr.html create mode 100644 dom/base/test/test_screen_orientation.html create mode 100644 dom/base/test/test_script_loader_crossorigin_data_url.html create mode 100644 dom/base/test/test_script_loader_js_cache.html create mode 100644 dom/base/test/test_script_loader_js_cache_frames.html create mode 100644 dom/base/test/test_script_loader_js_cache_module.html create mode 100644 dom/base/test/test_script_loader_js_cache_module_sri.html create mode 100644 dom/base/test/test_sendQueryContentAndSelectionSetEvent.html create mode 100644 dom/base/test/test_sendSelectionSetEvent_with_same_range.html create mode 100644 dom/base/test/test_serializer_noscript.html create mode 100644 dom/base/test/test_setInterval_from_start.html create mode 100644 dom/base/test/test_setInterval_uncatchable_exception.html create mode 100644 dom/base/test/test_setTimeoutWith0.html create mode 100644 dom/base/test/test_settimeout_extra_arguments.html create mode 100644 dom/base/test/test_settimeout_inner.html create mode 100644 dom/base/test/test_setting_opener.html create mode 100644 dom/base/test/test_shared_compartment1.html create mode 100644 dom/base/test/test_shared_compartment2.html create mode 100644 dom/base/test/test_structuredclone_backref.html create mode 100644 dom/base/test/test_structuredclone_error.html create mode 100644 dom/base/test/test_style_cssText.html create mode 100644 dom/base/test/test_suppressed_events_and_scrolling.html create mode 100644 dom/base/test/test_suppressed_events_nested_iframe.html create mode 100644 dom/base/test/test_suppressed_microtasks.html create mode 100644 dom/base/test/test_text_wholeText.html create mode 100644 dom/base/test/test_textnode_normalize_in_selection.html create mode 100644 dom/base/test/test_textnode_split_in_selection.html create mode 100644 dom/base/test/test_timeout_clamp.html create mode 100644 dom/base/test/test_timer_flood.html create mode 100644 dom/base/test/test_title.html create mode 100644 dom/base/test/test_toScreenRect.html create mode 100644 dom/base/test/test_treewalker_nextsibling.xml create mode 100644 dom/base/test/test_urgent_start.html create mode 100644 dom/base/test/test_user_select.html create mode 100644 dom/base/test/test_viewport_metrics_on_landscape_content.html create mode 100644 dom/base/test/test_viewport_scroll.html create mode 100644 dom/base/test/test_viewsource_forbidden_in_object.html create mode 100644 dom/base/test/test_w3element_traversal.html create mode 100644 dom/base/test/test_w3element_traversal.xhtml create mode 100644 dom/base/test/test_w3element_traversal_svg.html create mode 100644 dom/base/test/test_warning_for_blocked_cross_site_request.html create mode 100644 dom/base/test/test_window_close.html create mode 100644 dom/base/test/test_window_constructor.html create mode 100644 dom/base/test/test_window_content.html create mode 100644 dom/base/test/test_window_cross_origin_props.html create mode 100644 dom/base/test/test_window_define_nonconfigurable.html create mode 100644 dom/base/test/test_window_define_symbol.html create mode 100644 dom/base/test/test_window_element_enumeration.html create mode 100644 dom/base/test/test_window_enumeration.html create mode 100644 dom/base/test/test_window_extensible.html create mode 100644 dom/base/test/test_window_focus_by_close_and_open.html create mode 100644 dom/base/test/test_window_indexing.html create mode 100644 dom/base/test/test_window_keys.html create mode 100644 dom/base/test/test_window_named_frame_enumeration.html create mode 100644 dom/base/test/test_window_own_props.html create mode 100644 dom/base/test/test_window_proto.html create mode 100644 dom/base/test/test_writable-replaceable.html create mode 100644 dom/base/test/test_x-frame-options.html create mode 100644 dom/base/test/test_youtube_flash_embed.html create mode 100644 dom/base/test/unit/1_original.xml create mode 100644 dom/base/test/unit/1_result.xml create mode 100644 dom/base/test/unit/2_original.xml create mode 100644 dom/base/test/unit/2_result_1.xml create mode 100644 dom/base/test/unit/2_result_2.xml create mode 100644 dom/base/test/unit/2_result_3.xml create mode 100644 dom/base/test/unit/2_result_4.xml create mode 100644 dom/base/test/unit/3_original.xml create mode 100644 dom/base/test/unit/3_result.xml create mode 100644 dom/base/test/unit/3_result_2.xml create mode 100644 dom/base/test/unit/4_original.xml create mode 100644 dom/base/test/unit/4_result_1.xml create mode 100644 dom/base/test/unit/4_result_2.xml create mode 100644 dom/base/test/unit/4_result_3.xml create mode 100644 dom/base/test/unit/4_result_4.xml create mode 100644 dom/base/test/unit/4_result_5.xml create mode 100644 dom/base/test/unit/4_result_6.xml create mode 100644 dom/base/test/unit/empty_document.xml create mode 100644 dom/base/test/unit/head_utilities.js create mode 100644 dom/base/test/unit/head_xml.js create mode 100644 dom/base/test/unit/isequalnode_data.xml create mode 100644 dom/base/test/unit/nodelist_data_1.xml create mode 100644 dom/base/test/unit/nodelist_data_2.xhtml create mode 100644 dom/base/test/unit/test_blockParsing.js create mode 100644 dom/base/test/unit/test_bug553888.js create mode 100644 dom/base/test/unit/test_bug737966.js create mode 100644 dom/base/test/unit/test_cancelPrefetch.js create mode 100644 dom/base/test/unit/test_chromeutils_base64.js create mode 100644 dom/base/test/unit/test_chromeutils_getXPCOMErrorName.js create mode 100644 dom/base/test/unit/test_chromeutils_shallowclone.js create mode 100644 dom/base/test/unit/test_delete_range.xml create mode 100644 dom/base/test/unit/test_error_codes.js create mode 100644 dom/base/test/unit/test_generate_xpath.js create mode 100644 dom/base/test/unit/test_htmlserializer.js create mode 100644 dom/base/test/unit/test_isequalnode.js create mode 100644 dom/base/test/unit/test_js_dev_error_interceptor.js create mode 100644 dom/base/test/unit/test_nodelist.js create mode 100644 dom/base/test/unit/test_normalize.js create mode 100644 dom/base/test/unit/test_range.js create mode 100644 dom/base/test/unit/test_serializers_entities.js create mode 100644 dom/base/test/unit/test_serializers_entities_in_attr.js create mode 100644 dom/base/test/unit/test_structuredcloneholder.js create mode 100644 dom/base/test/unit/test_thirdpartyutil.js create mode 100644 dom/base/test/unit/test_treewalker.js create mode 100644 dom/base/test/unit/test_xhr_document.js create mode 100644 dom/base/test/unit/test_xhr_origin_attributes.js create mode 100644 dom/base/test/unit/test_xhr_standalone.js create mode 100644 dom/base/test/unit/test_xml_parser.js create mode 100644 dom/base/test/unit/test_xml_serializer.js create mode 100644 dom/base/test/unit/test_xmlserializer.js create mode 100644 dom/base/test/unit/xpcshell.ini create mode 100644 dom/base/test/unit_ipc/test_bug553888_wrap.js create mode 100644 dom/base/test/unit_ipc/test_xhr_document_ipc.js create mode 100644 dom/base/test/unit_ipc/xpcshell.ini create mode 100644 dom/base/test/useractivation/file_clipboard_common.js create mode 100644 dom/base/test/useractivation/file_empty.html create mode 100644 dom/base/test/useractivation/file_iframe_check_user_activation.html create mode 100644 dom/base/test/useractivation/file_iframe_consume_user_activation.html create mode 100644 dom/base/test/useractivation/file_iframe_user_activated.html create mode 100644 dom/base/test/useractivation/file_useractivation_sandbox_transient_popup.html create mode 100644 dom/base/test/useractivation/mochitest.ini create mode 100644 dom/base/test/useractivation/moz.build create mode 100644 dom/base/test/useractivation/test_clipboard_editor.html create mode 100644 dom/base/test/useractivation/test_clipboard_noeditor.html create mode 100644 dom/base/test/useractivation/test_popup_blocker_async_callback.html create mode 100644 dom/base/test/useractivation/test_popup_blocker_mouse_event.html create mode 100644 dom/base/test/useractivation/test_popup_blocker_pointer_event.html create mode 100644 dom/base/test/useractivation/test_useractivation_has_been_activated.html create mode 100644 dom/base/test/useractivation/test_useractivation_key_events.html create mode 100644 dom/base/test/useractivation/test_useractivation_sandbox_transient.html create mode 100644 dom/base/test/useractivation/test_useractivation_scrollbar.html create mode 100644 dom/base/test/useractivation/test_useractivation_transient.html create mode 100644 dom/base/test/useractivation/test_useractivation_transient_consuming.html create mode 100644 dom/base/test/variable_style_sheet.sjs create mode 100644 dom/base/test/w3element_traversal.svg create mode 100644 dom/base/test/wholeTexty-helper.xml create mode 100644 dom/base/test/worker_postMessages.js (limited to 'dom/base/test') diff --git a/dom/base/test/.eslintrc.js b/dom/base/test/.eslintrc.js new file mode 100644 index 0000000000..43ad70dd5e --- /dev/null +++ b/dom/base/test/.eslintrc.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = { + overrides: [ + { + files: ["file_module_js_cache.js", "file_script_module_*.js"], + parserOptions: { + sourceType: "module", + }, + }, + ], +}; diff --git a/dom/base/test/345339_iframe.html b/dom/base/test/345339_iframe.html new file mode 100644 index 0000000000..f4b2ecd13b --- /dev/null +++ b/dom/base/test/345339_iframe.html @@ -0,0 +1,29 @@ + + + + Form Elements + + + +

+ +

+ + +
+ + + + + + + + +

+ + diff --git a/dom/base/test/Ahem.ttf b/dom/base/test/Ahem.ttf new file mode 100644 index 0000000000..ac81cb0316 Binary files /dev/null and b/dom/base/test/Ahem.ttf differ diff --git a/dom/base/test/FAIL.html b/dom/base/test/FAIL.html new file mode 100644 index 0000000000..94e1707e85 --- /dev/null +++ b/dom/base/test/FAIL.html @@ -0,0 +1 @@ +FAIL diff --git a/dom/base/test/PASS.html b/dom/base/test/PASS.html new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/dom/base/test/PASS.html @@ -0,0 +1 @@ +PASS diff --git a/dom/base/test/accesscontrol.resource b/dom/base/test/accesscontrol.resource new file mode 100644 index 0000000000..aca66f6f8d --- /dev/null +++ b/dom/base/test/accesscontrol.resource @@ -0,0 +1,7 @@ +:this file must be enconded in utf8 +:and its Content-Type must be equal to text/event-stream + +event: message +data: 1 + + diff --git a/dom/base/test/accesscontrol.resource^headers^ b/dom/base/test/accesscontrol.resource^headers^ new file mode 100644 index 0000000000..75f1f88972 --- /dev/null +++ b/dom/base/test/accesscontrol.resource^headers^ @@ -0,0 +1,5 @@ +Access-Control-Allow-Origin: http://mochi.test:8888 +Access-Control-Allow-Credentials: true +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate + diff --git a/dom/base/test/audio.ogg b/dom/base/test/audio.ogg new file mode 100644 index 0000000000..bed764fbf1 Binary files /dev/null and b/dom/base/test/audio.ogg differ diff --git a/dom/base/test/badContentType.eventsource b/dom/base/test/badContentType.eventsource new file mode 100644 index 0000000000..c9d0739e18 --- /dev/null +++ b/dom/base/test/badContentType.eventsource @@ -0,0 +1,5 @@ +retry:500 +event: message +data: 1 + + diff --git a/dom/base/test/badContentType.eventsource^headers^ b/dom/base/test/badContentType.eventsource^headers^ new file mode 100644 index 0000000000..a1f9e38d90 --- /dev/null +++ b/dom/base/test/badContentType.eventsource^headers^ @@ -0,0 +1 @@ +Content-Type: text/plain diff --git a/dom/base/test/badHTTPResponseCode.eventsource b/dom/base/test/badHTTPResponseCode.eventsource new file mode 100644 index 0000000000..c9d0739e18 --- /dev/null +++ b/dom/base/test/badHTTPResponseCode.eventsource @@ -0,0 +1,5 @@ +retry:500 +event: message +data: 1 + + diff --git a/dom/base/test/badHTTPResponseCode.eventsource^headers^ b/dom/base/test/badHTTPResponseCode.eventsource^headers^ new file mode 100644 index 0000000000..545a9a201c --- /dev/null +++ b/dom/base/test/badHTTPResponseCode.eventsource^headers^ @@ -0,0 +1,2 @@ +HTTP 404 Not Found +Content-Type: text/event-stream diff --git a/dom/base/test/badMessageEvent.eventsource b/dom/base/test/badMessageEvent.eventsource new file mode 100644 index 0000000000..0c635f0b57 --- /dev/null +++ b/dom/base/test/badMessageEvent.eventsource @@ -0,0 +1,4 @@ +retry:500 +event: message + + diff --git a/dom/base/test/badMessageEvent.eventsource^headers^ b/dom/base/test/badMessageEvent.eventsource^headers^ new file mode 100644 index 0000000000..9bb8badcad --- /dev/null +++ b/dom/base/test/badMessageEvent.eventsource^headers^ @@ -0,0 +1 @@ +Content-Type: text/event-stream diff --git a/dom/base/test/badMessageEvent2.eventsource b/dom/base/test/badMessageEvent2.eventsource new file mode 100644 index 0000000000..ad6fa694f4 --- /dev/null +++ b/dom/base/test/badMessageEvent2.eventsource @@ -0,0 +1,5 @@ +retry:500 +data: ok + +id: invalid-id +data: not-ok diff --git a/dom/base/test/badMessageEvent2.eventsource^headers^ b/dom/base/test/badMessageEvent2.eventsource^headers^ new file mode 100644 index 0000000000..9bb8badcad --- /dev/null +++ b/dom/base/test/badMessageEvent2.eventsource^headers^ @@ -0,0 +1 @@ +Content-Type: text/event-stream diff --git a/dom/base/test/browser.ini b/dom/base/test/browser.ini new file mode 100644 index 0000000000..0386d433b5 --- /dev/null +++ b/dom/base/test/browser.ini @@ -0,0 +1,112 @@ +[DEFAULT] +head = head.js +support-files = + audio.ogg + dummy.html + empty.html + file_audioLoop.html + file_audioLoopInIframe.html + file_blocking_image.html + file_bug902350.html + file_bug902350_frame.html + file_bug1011748_redirect.sjs + file_bug1011748_OK.sjs + file_bug1303838.html + file_bug1303838_target.html + file_bug1303838_target_foo.html + file_bug1303838_target_bar.html + file_bug1303838_target_baz.html + file_bug1303838_target_ifoo.html + file_bug1303838_target_ibar.html + file_bug1303838_target_ibaz.html + file_bug1303838_with_iframe.html + file_messagemanager_unload.html + file_use_counter_bfcache.html + file_use_counter_bfcache_helper.html + file_use_counter_outer.html + file_use_counter_outer_display_none.html + file_use_counter_style.html + file_use_counter_svg_getElementById.svg + file_use_counter_svg_currentScale.svg + file_use_counter_svg_fill_pattern_definition.svg + file_use_counter_svg_fill_pattern.svg + file_use_counter_svg_fill_pattern_internal.svg + file_use_counter_svg_fill_pattern_data.svg + file_webaudio_startstop.html + !/image/test/mochitest/shaver.png + + +[browser_blocking_image.js] +[browser_bug902350.js] +tags = mcb +[browser_bug1011748.js] +[browser_bug1058164.js] +[browser_force_process_selector.js] +skip-if = + verify + (os == 'win' && os_version == '10.0' && bits == 64 && asan) + (os == "linux" && bits == 64 && os_version == "18.04" && asan) # this only makes sense with e10s-multi , Bug 1651357 +[browser_messagemanager_loadprocessscript.js] +[browser_aboutnewtab_process_selection.js] +skip-if = + os == 'linux' && bits == 64 #Bug 1618098 + os == 'mac' && fission # Bug 1618098 +[browser_messagemanager_targetframeloader.js] +[browser_messagemanager_unload.js] +skip-if = fission # Fails with Fission, and we're unlikely to spend time to fix it. (bug 1587490) +[browser_pagehide_on_tab_close.js] +skip-if = true # this tests non-e10s behavior. +[browser_promiseDocumentFlushed.js] +[browser_state_notifications.js] +skip-if = true # Bug 1271028 +[browser_use_counters.js] +skip-if = verify +[browser_timeout_throttling_with_audio_playback.js] +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to bug 1536566 +[browser_bug1303838.js] +skip-if = + os == "mac" && os_version == "10.15" && !debug # Bug 1703712 +[browser_bug1691214.js] +skip-if = + os == 'win' # Bug 1692963 + os == "mac" # Bug 1692963 + os == 'linux' # Bug 1775696 + +support-files = + file_bug1691214.html + file_bug1700871.html +[browser_inputStream_structuredClone.js] +[browser_multiple_popups.js] +skip-if = + (os == 'win' && !debug) + (os == "mac" && !debug) # Bug 1505235, Bug 1661132 (osx) + socketprocess_networking +support-files = browser_multiple_popups.html +[browser_bug1554070.js] +support-files = + file_bug1554070_1.html + file_bug1554070_2.html +[browser_chromeutils_getalldomprocesses.js] +[browser_chromeutils_isdomobject.js] +[browser_outline_refocus.js] +[browser_bug1703472.js] +support-files = + file_bug1703472.html +[browser_data_documents_aboutmemory.js] +[browser_form_validity_popup_submit.js] +[browser_refresh_content.js] +support-files = + green.png + red.png + file_browser_refresh_content.html + file_browser_refresh_expired_resource.sjs + file_browser_refresh_non_cacheable.sjs + file_browser_refresh_image.sjs + file_browser_refresh_iframe.sjs +[browser_page_load_event_telemetry.js] +[browser_xml_toggle.js] +[browser_user_input_handling_delay.js] +[browser_user_input_handling_delay_bfcache.js] +[browser_user_input_handling_delay_aboutblank.js] +[browser_user_input_handling_delay_invisible_iframe.js] +[browser_user_input_handling_delay_reload_ticks.js] diff --git a/dom/base/test/browser_aboutnewtab_process_selection.js b/dom/base/test/browser_aboutnewtab_process_selection.js new file mode 100644 index 0000000000..101f408483 --- /dev/null +++ b/dom/base/test/browser_aboutnewtab_process_selection.js @@ -0,0 +1,137 @@ +const TEST_URL = "http://www.example.com/browser/dom/base/test/dummy.html"; +const TEST_URL_2 = "http://example.org/browser/dom/base/test/dummy.html"; +const PRELOADED_STATE = "preloaded"; + +var ppmm = Services.ppmm; + +add_task(async function () { + // We want to count processes in this test, so let's disable the pre-allocated process manager. + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.ipc.processPrelaunch.enabled", false], + ["dom.ipc.processCount", 10], + ["dom.ipc.processCount.webIsolated", 10], + ["dom.ipc.keepProcessesAlive.web", 10], + ], + }); +}); + +add_task(async function () { + // This test is only relevant in e10s. + if (!gMultiProcessBrowser) { + return; + } + + ppmm.releaseCachedProcesses(); + + // Wait for the preloaded browser to load. + await BrowserTestUtils.maybeCreatePreloadedBrowser(gBrowser); + + // Store the number of processes. + let expectedChildCount = ppmm.childCount; + + // Open 3 tabs using the preloaded browser. + let tabs = []; + for (let i = 0; i < 3; i++) { + BrowserOpenTab(); + tabs.unshift(gBrowser.selectedTab); + await BrowserTestUtils.maybeCreatePreloadedBrowser(gBrowser); + + // Check that the process count did not change. + is( + ppmm.childCount, + expectedChildCount, + "Preloaded browser should not create a new content process." + ); + } + + // Navigate to a content page from the parent side. + // + // We should create a new content process. + expectedChildCount += 1; + BrowserTestUtils.loadURIString(tabs[0].linkedBrowser, TEST_URL); + await BrowserTestUtils.browserLoaded(tabs[0].linkedBrowser, false, TEST_URL); + is( + ppmm.childCount, + expectedChildCount, + "Navigating away from the preloaded browser (parent side) should create a new content process." + ); + + // Navigate to the same content page from the child side. + // + // We should create a new content process. + expectedChildCount += 1; + await BrowserTestUtils.switchTab(gBrowser, tabs[1]); + await SpecialPowers.spawn(tabs[1].linkedBrowser, [TEST_URL], url => { + content.location.href = url; + }); + await BrowserTestUtils.browserLoaded(tabs[1].linkedBrowser, false, TEST_URL); + is( + ppmm.childCount, + expectedChildCount, + "Navigating away from the preloaded browser (child side, same-origin) should create a new content process." + ); + + // Navigate to a new content page from the child side. + // + // We should create a new content process. + expectedChildCount += 1; + await BrowserTestUtils.switchTab(gBrowser, tabs[2]); + await ContentTask.spawn(tabs[2].linkedBrowser, TEST_URL_2, url => { + content.location.href = url; + }); + await BrowserTestUtils.browserLoaded( + tabs[2].linkedBrowser, + false, + TEST_URL_2 + ); + is( + ppmm.childCount, + expectedChildCount, + "Navigating away from the preloaded browser (child side, cross-origin) should create a new content process." + ); + + for (let tab of tabs) { + BrowserTestUtils.removeTab(tab); + } + + // Make sure the preload browser does not keep any of the new processes alive. + NewTabPagePreloading.removePreloadedBrowser(window); + + // Since we kept alive all the processes, we can shut down the ones that do + // not host any tabs reliably. + ppmm.releaseCachedProcesses(); +}); + +add_task(async function preloaded_state_attribute() { + // Wait for a preloaded browser to exist, use it, and then create another one + await BrowserTestUtils.maybeCreatePreloadedBrowser(gBrowser); + let preloadedTabState = + gBrowser.preloadedBrowser.getAttribute("preloadedState"); + is( + preloadedTabState, + PRELOADED_STATE, + "Sanity check that the first preloaded browser has the correct attribute" + ); + + BrowserOpenTab(); + await BrowserTestUtils.maybeCreatePreloadedBrowser(gBrowser); + + // Now check that the tabs have the correct browser attributes set + is( + gBrowser.selectedBrowser.hasAttribute("preloadedState"), + false, + "The opened tab consumed the preloaded browser and removed the attribute" + ); + + preloadedTabState = gBrowser.preloadedBrowser.getAttribute("preloadedState"); + is( + preloadedTabState, + PRELOADED_STATE, + "The preloaded browser has the correct attribute" + ); + + // Remove tabs and preloaded browsers + BrowserTestUtils.removeTab(gBrowser.selectedTab); + NewTabPagePreloading.removePreloadedBrowser(window); +}); diff --git a/dom/base/test/browser_blocking_image.js b/dom/base/test/browser_blocking_image.js new file mode 100644 index 0000000000..5749937f07 --- /dev/null +++ b/dom/base/test/browser_blocking_image.js @@ -0,0 +1,183 @@ +const TEST_URI = + getRootDirectory(gTestPath).replace( + "chrome://mochitests/content", + "https://example.com" + ) + "file_blocking_image.html"; + +/** + * Loading an image from https:// should work. + */ +add_task(async function load_image_from_https_test() { + let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI); + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + + gBrowser.selectedTab = tab; + + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + function imgListener(img) { + return new Promise((resolve, reject) => { + img.addEventListener("load", () => resolve()); + img.addEventListener("error", () => reject()); + }); + } + + let img = content.document.createElement("img"); + img.src = "https://example.com/tests/image/test/mochitest/shaver.png"; + content.document.body.appendChild(img); + + try { + await imgListener(img); + Assert.ok(true); + } catch (e) { + Assert.ok(false); + } + }); + + gBrowser.removeTab(tab); +}); + +/** + * Loading an image from http:// should be rejected. + */ +add_task(async function load_image_from_http_test() { + let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI); + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + + gBrowser.selectedTab = tab; + + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + function imgListener(img) { + return new Promise((resolve, reject) => { + img.addEventListener("load", () => reject()); + img.addEventListener("error", () => resolve()); + }); + } + + let img = content.document.createElement("img"); + img.src = "http://example.com/tests/image/test/mochitest/shaver.png"; + content.document.body.appendChild(img); + + try { + await imgListener(img); + Assert.ok(true); + } catch (e) { + Assert.ok(false); + } + }); + + gBrowser.removeTab(tab); +}); + +/** + * Loading an image from http:// immediately after loading from https:// + * The load from https:// should be replaced. + */ +add_task(async function load_https_and_http_test() { + let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI); + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + + // Clear image cache, otherwise in non-e10s mode the image might be cached by + // previous test, and make the image from https is loaded immediately. + let imgTools = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools); + let imageCache = imgTools.getImgCacheForDocument(window.document); + imageCache.clearCache(false); // false=content + + gBrowser.selectedTab = tab; + + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + function imgListener(img) { + return new Promise((resolve, reject) => { + img.addEventListener("load", () => reject()); + img.addEventListener("error", () => resolve()); + }); + } + + let img = content.document.createElement("img"); + img.src = "https://example.com/tests/image/test/mochitest/shaver.png"; + img.src = "http://example.com/tests/image/test/mochitest/shaver.png"; + + content.document.body.appendChild(img); + + try { + await imgListener(img); + Assert.ok(true); + } catch (e) { + Assert.ok(false); + } + }); + + gBrowser.removeTab(tab); +}); + +/** + * Loading an image from https. + * Then after we have size information of the image, we immediately change the + * location to a http:// site (hence should be blocked by CSP). + */ +add_task(async function block_pending_request_test() { + let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI); + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + + gBrowser.selectedTab = tab; + + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + let wrapper = { + _resolve: null, + _sizeAvail: false, + + sizeAvailable(request) { + // In non-e10s mode the image may have already been cached, so sometimes + // sizeAvailable() is called earlier then waitUntilSizeAvailable(). + if (this._resolve) { + this._resolve(); + } else { + this._sizeAvail = true; + } + }, + + waitUntilSizeAvailable() { + return new Promise(resolve => { + this._resolve = resolve; + if (this._sizeAvail) { + resolve(); + } + }); + }, + + QueryInterface(aIID) { + if (aIID.equals(Ci.imgIScriptedNotificationObserver)) { + return this; + } + throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE); + }, + }; + + let observer = Cc["@mozilla.org/image/tools;1"] + .getService(Ci.imgITools) + .createScriptedObserver(wrapper); + + let img = content.document.createElement("img"); + img.src = "https://example.com/tests/image/test/mochitest/shaver.png"; + + let req = img.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST); + img.addObserver(observer); + + content.document.body.appendChild(img); + + info("Wait until Size Available"); + await wrapper.waitUntilSizeAvailable(); + info("Size Available now!"); + img.removeObserver(observer); + + // Now we change to load from http:// site, which will be blocked. + img.src = "http://example.com/tests/image/test/mochitest/shaver.png"; + + Assert.equal( + img.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST), + req, + "CURRENT_REQUEST shouldn't be replaced." + ); + }); + + gBrowser.removeTab(tab); +}); diff --git a/dom/base/test/browser_bug1011748.js b/dom/base/test/browser_bug1011748.js new file mode 100644 index 0000000000..566e1347e9 --- /dev/null +++ b/dom/base/test/browser_bug1011748.js @@ -0,0 +1,31 @@ +const gHttpTestRoot = "http://example.com/browser/dom/base/test/"; + +add_task(async function () { + var statusTexts = []; + var xhr = new XMLHttpRequest(); + var observer = { + observe(aSubject, aTopic, aData) { + try { + var channel = aSubject.QueryInterface(Ci.nsIHttpChannel); + channel.getResponseHeader("Location"); + } catch (e) { + return; + } + statusTexts.push(xhr.statusText); + }, + }; + + Services.obs.addObserver(observer, "http-on-examine-response"); + await new Promise(resolve => { + xhr.addEventListener("load", function () { + statusTexts.push(this.statusText); + is(statusTexts[0], "", "Empty statusText value for HTTP 302"); + is(statusTexts[1], "OK", "OK statusText value for the redirect."); + resolve(); + }); + xhr.open("GET", gHttpTestRoot + "file_bug1011748_redirect.sjs", true); + xhr.send(); + }); + + Services.obs.removeObserver(observer, "http-on-examine-response"); +}); diff --git a/dom/base/test/browser_bug1058164.js b/dom/base/test/browser_bug1058164.js new file mode 100644 index 0000000000..0bb1098ef2 --- /dev/null +++ b/dom/base/test/browser_bug1058164.js @@ -0,0 +1,238 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +SpecialPowers.pushPrefEnv({ + set: [["security.allow_eval_with_system_principal", true]], +}); + +const PAGE = + "data:text/html,A%20regular,%20everyday,%20normal%20page."; + +let gListenerId = 0; + +/** + * Adds a content event listener on the given browser element. NOTE: this test + * is checking the behavior of pageshow and pagehide as seen by frame scripts, + * so it is specifically implemented using the message message manager. + * Similar to BrowserTestUtils.waitForContentEvent, but the listener will fire + * until it is removed. A callable object is returned that, when called, removes + * the event listener. Note that this function works even if the browser's + * frameloader is swapped. + * + * @param {xul:browser} browser + * The browser element to listen for events in. + * @param {string} eventName + * Name of the event to listen to. + * @param {function} listener + * Function to call in parent process when event fires. + * Not passed any arguments. + * @param {function} checkFn [optional] + * Called with the Event object as argument, should return true if the + * event is the expected one, or false if it should be ignored and + * listening should continue. If not specified, the first event with + * the specified name resolves the returned promise. This is called + * within the content process and can have no closure environment. + * + * @returns function + * If called, the return value will remove the event listener. + */ +function addContentEventListenerWithMessageManager( + browser, + eventName, + listener, + checkFn +) { + let id = gListenerId++; + let checkFnSource = checkFn + ? encodeURIComponent(escape(checkFn.toSource())) + : ""; + + // To correctly handle frameloader swaps, we load a frame script + // into all tabs but ignore messages from the ones not related to + // |browser|. + + /* eslint-disable no-eval */ + function frameScript(innerId, innerEventName, innerCheckFnSource) { + let innerCheckFn; + if (innerCheckFnSource) { + innerCheckFn = eval(`(() => (${unescape(innerCheckFnSource)}))()`); + } + + function innerListener(event) { + if (innerCheckFn && !innerCheckFn(event)) { + return; + } + sendAsyncMessage("ContentEventListener:Run", innerId); + } + function removeListener(msg) { + if (msg.data == innerId) { + removeMessageListener("ContentEventListener:Remove", removeListener); + removeEventListener(innerEventName, innerListener); + } + } + addMessageListener("ContentEventListener:Remove", removeListener); + addEventListener(innerEventName, innerListener); + } + /* eslint-enable no-eval */ + + let frameScriptSource = `data:,(${frameScript.toString()})(${id}, "${eventName}", + "${checkFnSource}")`; + + let mm = Services.mm; + + function runListener(msg) { + if (msg.data == id && msg.target == browser) { + listener(); + } + } + mm.addMessageListener("ContentEventListener:Run", runListener); + + let needCleanup = true; + + let unregisterFunction = function () { + if (!needCleanup) { + return; + } + needCleanup = false; + mm.removeMessageListener("ContentEventListener:Run", runListener); + mm.broadcastAsyncMessage("ContentEventListener:Remove", id); + mm.removeDelayedFrameScript(frameScriptSource); + }; + + function cleanupObserver(subject, topic, data) { + if (subject == browser.messageManager) { + unregisterFunction(); + } + } + + mm.loadFrameScript(frameScriptSource, true); + + return unregisterFunction; +} + +/** + * Returns a Promise that resolves when it sees a pageshow and + * pagehide events in a particular order, where each event must + * have the persisted property set to true. Will cause a test + * failure to be logged if it sees an event out of order. + * + * @param browser () + * The browser to expect the events from. + * @param expectedOrder (array) + * An array of strings describing what order the pageshow + * and pagehide events should be in. + * Example: + * ["pageshow", "pagehide", "pagehide", "pageshow"] + * @returns Promise + */ +function prepareForVisibilityEvents(browser, expectedOrder) { + return new Promise(resolve => { + let order = []; + + let rmvHide, rmvShow; + + let checkSatisfied = () => { + if (order.length < expectedOrder.length) { + // We're still waiting... + return; + } else { + rmvHide(); + rmvShow(); + + for (let i = 0; i < expectedOrder.length; ++i) { + is(order[i], expectedOrder[i], "Got expected event"); + } + resolve(); + } + }; + + let eventListener = type => { + order.push(type); + checkSatisfied(); + }; + + let checkFn = e => e.persisted; + + rmvHide = addContentEventListenerWithMessageManager( + browser, + "pagehide", + () => eventListener("pagehide"), + checkFn + ); + rmvShow = addContentEventListenerWithMessageManager( + browser, + "pageshow", + () => eventListener("pageshow"), + checkFn + ); + }); +} + +/** + * Tests that frame scripts get pageshow / pagehide events when + * swapping browser frameloaders (which occurs when moving a tab + * into a different window). + */ +add_task(async function test_swap_frameloader_pagevisibility_events() { + // Disable window occlusion. Bug 1733955 + if (navigator.platform.indexOf("Win") == 0) { + await SpecialPowers.pushPrefEnv({ + set: [["widget.windows.window_occlusion_tracking.enabled", false]], + }); + } + + // Load a new tab that we'll tear out... + let tab = BrowserTestUtils.addTab(gBrowser, PAGE); + gBrowser.selectedTab = tab; + let firstBrowser = tab.linkedBrowser; + await BrowserTestUtils.browserLoaded(firstBrowser); + + // Swap the browser out to a new window + let newWindow = gBrowser.replaceTabWithWindow(tab); + + // We have to wait for the window to load so we can get the selected browser + // to listen to. + await BrowserTestUtils.waitForEvent(newWindow, "DOMContentLoaded"); + let newWindowBrowser = newWindow.gBrowser.selectedBrowser; + + // Wait for the expected pagehide and pageshow events on the initial browser + await prepareForVisibilityEvents(newWindowBrowser, ["pagehide", "pageshow"]); + + // Now let's send the browser back to the original window + + // First, create a new, empty browser tab to replace the window with + let newTab = BrowserTestUtils.addTab(gBrowser); + gBrowser.selectedTab = newTab; + let emptyBrowser = newTab.linkedBrowser; + + // Wait for that initial doc to be visible because if its pageshow hasn't + // happened we don't confuse it with the other expected events. + await ContentTask.spawn(emptyBrowser, null, async () => { + if (content.document.visibilityState === "hidden") { + info("waiting for hidden emptyBrowser to be visible"); + await ContentTaskUtils.waitForEvent( + content.document, + "visibilitychange", + {} + ); + } + }); + + info("emptyBrowser is shown now."); + + // The empty tab we just added show now fire a pagehide as its replaced, + // and a pageshow once the swap is finished. + let emptyBrowserPromise = prepareForVisibilityEvents(emptyBrowser, [ + "pagehide", + "pageshow", + ]); + + gBrowser.swapBrowsersAndCloseOther(newTab, newWindow.gBrowser.selectedTab); + + await emptyBrowserPromise; + + gBrowser.removeTab(gBrowser.selectedTab); +}); diff --git a/dom/base/test/browser_bug1303838.js b/dom/base/test/browser_bug1303838.js new file mode 100644 index 0000000000..a4d5ee3b26 --- /dev/null +++ b/dom/base/test/browser_bug1303838.js @@ -0,0 +1,368 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * Test for bug 1303838. + * Load a tab with some links, emulate link clicks and check if the + * browser would switch to the existing target tab opened by previous + * link click if loadDivertedInBackground is set to true. + */ + +"use strict"; + +const BASE_URL = "http://mochi.test:8888/browser/dom/base/test/"; + +add_task(async function () { + // On Linux, in our test automation, the mouse cursor floats over + // the first tab, which causes it to be warmed up when tab warming + // is enabled. The TabSwitchDone event doesn't fire until the warmed + // tab is evicted, which is after a few seconds. That means that + // this test ends up taking longer than we'd like, since its waiting + // for the TabSwitchDone event between tab switches. + // + // So now we make sure that warmed tabs are evicted very shortly + // after warming to avoid the test running too long. + await SpecialPowers.pushPrefEnv({ + set: [["browser.tabs.remote.warmup.unloadDelayMs", 50]], + }); + await testLinkClick(false, false); + await testLinkClick(false, true); + await testLinkClick(true, false); + await testLinkClick(true, true); +}); + +async function waitForTestReady(loadDivertedInBackground, tab) { + if (!loadDivertedInBackground) { + await BrowserTestUtils.switchTab(gBrowser, tab); + } else { + await new Promise(resolve => setTimeout(resolve, 0)); + } +} + +async function testLinkClick(withFrame, loadDivertedInBackground) { + await SpecialPowers.pushPrefEnv({ + set: [["browser.tabs.loadDivertedInBackground", loadDivertedInBackground]], + }); + + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + BASE_URL + + (withFrame ? "file_bug1303838_with_iframe.html" : "file_bug1303838.html") + ); + is(gBrowser.tabs.length, 2, "check tabs.length"); + is(gBrowser.selectedTab, tab, "check selectedTab"); + + info( + "Test normal links with loadDivertedInBackground=" + + loadDivertedInBackground + + ", withFrame=" + + withFrame + ); + + let testTabPromise = BrowserTestUtils.waitForNewTab(gBrowser); + await clickLink(withFrame, "#link-1", tab.linkedBrowser); + let testTab = await testTabPromise; + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#link-2", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#link-3", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#link-4", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + // Location APIs shouldn't steal focus. + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#link-5", + tab.linkedBrowser, + testTab.linkedBrowser, + /* awaitTabSwitch = */ false + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is(gBrowser.selectedTab, tab, "check selectedTab"); + + await waitForTestReady(/* diverted = */ true, tab); + await clickLink( + withFrame, + "#link-6", + tab.linkedBrowser, + testTab.linkedBrowser, + /* awaitTabSwitch = */ false + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is(gBrowser.selectedTab, tab, "check selectedTab"); + + await waitForTestReady(/* diverted = */ true, tab); + let loaded = BrowserTestUtils.browserLoaded( + testTab.linkedBrowser, + true, + "data:text/html;charset=utf-8,testFrame" + ); + await clickLink( + withFrame, + "#link-7", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground, + false + ); + await loaded; + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + info( + "Test anchor links with loadDivertedInBackground=" + + loadDivertedInBackground + + ", withFrame=" + + withFrame + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#anchor-link-1", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#anchor-link-2", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#anchor-link-3", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + info( + "Test iframe links with loadDivertedInBackground=" + + loadDivertedInBackground + + ", withFrame=" + + withFrame + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#frame-link-1", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground, + true + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#frame-link-2", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground, + true + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + await waitForTestReady(loadDivertedInBackground, tab); + await clickLink( + withFrame, + "#frame-link-3", + tab.linkedBrowser, + testTab.linkedBrowser, + !loadDivertedInBackground, + true + ); + is(gBrowser.tabs.length, 3, "check tabs.length"); + is( + gBrowser.selectedTab, + loadDivertedInBackground ? tab : testTab, + "check selectedTab" + ); + + BrowserTestUtils.removeTab(testTab); + BrowserTestUtils.removeTab(tab); +} + +function clickLink( + isFrame, + linkId, + browser, + testBrowser, + awaitTabSwitch = false, + targetsFrame = false, + locationChangeNum = 1 +) { + let promises = []; + if (awaitTabSwitch) { + promises.push(waitForTabSwitch(gBrowser)); + } + if (testBrowser) { + promises.push( + waitForLocationChange(targetsFrame, testBrowser, locationChangeNum) + ); + } + + info("BC children: " + browser.browsingContext.children.length); + promises.push( + BrowserTestUtils.synthesizeMouseAtCenter( + linkId, + {}, + isFrame ? browser.browsingContext.children[0] : browser + ) + ); + return Promise.all(promises); +} + +function waitForTabSwitch(tabbrowser) { + info("Waiting for TabSwitch"); + return new Promise(resolve => { + tabbrowser.addEventListener("TabSwitchDone", function onSwitch() { + info("TabSwitch done"); + tabbrowser.removeEventListener("TabSwitchDone", onSwitch); + resolve(tabbrowser.selectedTab); + }); + }); +} + +let locationChangeListener; +function waitForLocationChange(isFrame, browser, locationChangeNum) { + if (isFrame) { + return waitForFrameLocationChange(browser, locationChangeNum); + } + + info("Waiting for " + locationChangeNum + " LocationChange"); + return new Promise(resolve => { + let seen = 0; + locationChangeListener = { + onLocationChange(aWebProgress, aRequest, aLocation, aFlags) { + info("LocationChange: " + aLocation.spec); + if (++seen == locationChangeNum) { + browser.removeProgressListener(this); + resolve(); + } + }, + QueryInterface: ChromeUtils.generateQI([ + "nsIWebProgressListener", + "nsISupportsWeakReference", + ]), + }; + browser.addProgressListener(locationChangeListener); + }); +} + +function waitForFrameLocationChange(browser, locationChangeNum) { + info("Waiting for " + locationChangeNum + " LocationChange in subframe"); + return SpecialPowers.spawn(browser, [locationChangeNum], async changeNum => { + let seen = 0; + let webprogress = content.docShell.QueryInterface(Ci.nsIWebProgress); + await new Promise(resolve => { + locationChangeListener = { + onLocationChange(aWebProgress, aRequest, aLocation, aFlags) { + info("LocationChange: " + aLocation.spec); + if (++seen == changeNum) { + resolve(); + } + }, + QueryInterface: ChromeUtils.generateQI([ + "nsIWebProgressListener", + "nsISupportsWeakReference", + ]), + }; + webprogress.addProgressListener( + locationChangeListener, + Ci.nsIWebProgress.NOTIFY_LOCATION + ); + }); + webprogress.removeProgressListener(locationChangeListener); + }); +} diff --git a/dom/base/test/browser_bug1554070.js b/dom/base/test/browser_bug1554070.js new file mode 100644 index 0000000000..a5efc17e19 --- /dev/null +++ b/dom/base/test/browser_bug1554070.js @@ -0,0 +1,49 @@ +"use strict"; + +const HTTPS_TEST_ROOT = getRootDirectory(gTestPath).replace( + "chrome://mochitests/content", + "https://example.com" +); + +const URL0 = HTTPS_TEST_ROOT + "file_bug1554070_1.html"; +const URL1 = HTTPS_TEST_ROOT + "file_bug1554070_2.html"; +const URL2 = "https://example.org/"; + +add_task(async function () { + let tab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + waitForLoad: true, + }); + + let browser = tab.linkedBrowser; + + function click() { + return SpecialPowers.spawn(browser, [], () => { + let anchor = content.document.querySelector("a"); + anchor.click(); + }); + } + + // Load file_bug1554070_1.html. + BrowserTestUtils.loadURIString(browser, URL0); + await BrowserTestUtils.browserLoaded(browser, false, URL0); + is(gBrowser.currentURI.spec, URL0, "loaded file_bug1554070_1.html"); + + // Click the link in file_bug1554070_1.html. It should open + // file_bug1554070_2.html in the current tab. + await click(); + await BrowserTestUtils.browserLoaded(browser, false, URL1); + is(gBrowser.currentURI.spec, URL1, "loaded file_bug1554070_2.html"); + + // Click the link in file_bug1554070_2.html. It should open example.org in + // a new tab. + await Promise.all([ + click(), + BrowserTestUtils.waitForNewTab(gBrowser, URL2, true), + ]); + is(gBrowser.tabs.length, 3, "got new tab"); + is(gBrowser.currentURI.spec, URL2, "loaded example.org"); + + BrowserTestUtils.removeTab(gBrowser.selectedTab); + BrowserTestUtils.removeTab(tab); +}); diff --git a/dom/base/test/browser_bug1691214.js b/dom/base/test/browser_bug1691214.js new file mode 100644 index 0000000000..5f40df2ea3 --- /dev/null +++ b/dom/base/test/browser_bug1691214.js @@ -0,0 +1,122 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const BASE_URL = "http://mochi.test:8888/browser/dom/base/test/"; + +add_task(async function bug1691214() { + await BrowserTestUtils.withNewTab( + BASE_URL + "file_bug1691214.html", + async function (browser) { + let win = await newFocusedWindow(function () { + return BrowserTestUtils.synthesizeMouseAtCenter("#link-1", {}, browser); + }); + is(Services.focus.focusedWindow, win, "New window should be focused"); + + info("re-focusing the original window"); + + { + let focusBack = BrowserTestUtils.waitForEvent(window, "focus", true); + window.focus(); + await focusBack; + is(Services.focus.focusedWindow, window, "should focus back"); + } + + info("Clicking on the second link."); + + { + let focus = BrowserTestUtils.waitForEvent(win, "focus", true); + await BrowserTestUtils.synthesizeMouseAtCenter("#link-2", {}, browser); + info("Waiting for re-focus of the opened window."); + await focus; + } + + is( + Services.focus.focusedWindow, + win, + "Existing window should've been targeted and focused" + ); + + win.close(); + } + ); +}); + +// The tab has a form infinitely submitting to an iframe, and that shouldn't +// switch focus back. For that, we open a window from the tab, make sure it's +// focused, and then wait for three submissions (but since we need to listen to +// trusted events from chrome code, we use the iframe load event instead). +add_task(async function bug1700871() { + await BrowserTestUtils.withNewTab( + BASE_URL + "file_bug1700871.html", + async function (browser) { + let win = await newFocusedWindow(function () { + return BrowserTestUtils.synthesizeMouseAtCenter("#link-1", {}, browser); + }); + + is(Services.focus.focusedWindow, win, "New window should be focused"); + + info("waiting for three submit events and ensuring focus hasn't moved"); + + await SpecialPowers.spawn(browser, [], function () { + let pending = 3; + return new Promise(resolve => { + content.document + .querySelector("iframe") + .addEventListener("load", function (e) { + info("Got load on the frame: " + pending); + if (!--pending) { + resolve(); + } + }); + }); + }); + + is(Services.focus.focusedWindow, win, "Focus shouldn't have moved"); + win.close(); + } + ); +}); + +add_task(async function bug1793829() { + await BrowserTestUtils.withNewTab( + BASE_URL + "file_bug1691214.html", + async function (browser) { + let win = await newFocusedWindow(function () { + return BrowserTestUtils.synthesizeMouseAtCenter("#link-1", {}, browser); + }); + is(Services.focus.focusedWindow, win, "New window should be focused"); + + info("re-focusing the original window"); + + { + let focusBack = BrowserTestUtils.waitForEvent(window, "focus", true); + window.focus(); + await focusBack; + is(Services.focus.focusedWindow, window, "should focus back"); + } + + info("Trying to steal focus."); + + await SpecialPowers.spawn(browser, [], function () { + content.document.clearUserGestureActivation(); + content.document.getElementById("link-2").click(); + }); + + // We need to test that nothing happened, which is hard without an + // arbitrary timeout. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(c => setTimeout(c, 2000)); + + is( + Services.focus.focusedWindow, + window, + "Shouldn't steal focus without user gesture" + ); + + win.close(); + } + ); +}); diff --git a/dom/base/test/browser_bug1703472.js b/dom/base/test/browser_bug1703472.js new file mode 100644 index 0000000000..ba4d10a63f --- /dev/null +++ b/dom/base/test/browser_bug1703472.js @@ -0,0 +1,68 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const BASE_URL = "http://mochi.test:8888/browser/dom/base/test/"; + +add_task(async function bug1703472() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.block_multiple_popups", true], + ["dom.disable_open_during_load", true], + ], + }); + + await BrowserTestUtils.withNewTab( + BASE_URL + "file_bug1703472.html", + async function (browser) { + info("Opening popup"); + let win = await newFocusedWindow(function () { + return BrowserTestUtils.synthesizeMouseAtCenter( + "#openWindow", + {}, + browser + ); + }); + + info("re-focusing the original window"); + { + let focusBack = BrowserTestUtils.waitForEvent(window, "focus", true); + window.focus(); + await focusBack; + is(Services.focus.focusedWindow, window, "should focus back"); + } + + // The click to do window.open() should've consumed the user interaction, + // and an artificial .click() shouldn't count as a user interaction, so the + // page shouldn't be allowed to focus it again without user interaction. + info("Trying to steal focus without interaction"); + await SpecialPowers.spawn(browser, [], function () { + content.document.querySelector("#focusWindow").click(); + }); + + // We need to wait for something _not_ happening, so we need to use an arbitrary setTimeout. + await new Promise(resolve => { + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + setTimeout(resolve, 500); + }); + + is(Services.focus.focusedWindow, window, "should still be focused"); + + info("Trying to move focus with user interaction"); + { + let focus = BrowserTestUtils.waitForEvent(win, "focus", true); + await BrowserTestUtils.synthesizeMouseAtCenter( + "#focusWindow", + {}, + browser + ); + await focus; + is(Services.focus.focusedWindow, win, "should focus back"); + } + + win.close(); + } + ); +}); diff --git a/dom/base/test/browser_bug902350.js b/dom/base/test/browser_bug902350.js new file mode 100644 index 0000000000..18b17c5953 --- /dev/null +++ b/dom/base/test/browser_bug902350.js @@ -0,0 +1,56 @@ +/* + * Mixed Content Block frame navigates for target="_top" - Test for Bug 902350 + */ + +add_task(async function mixed_content_block_for_target_top_test() { + const PREF_ACTIVE = "security.mixed_content.block_active_content"; + const httpsTestRoot = getRootDirectory(gTestPath).replace( + "chrome://mochitests/content", + "https://example.com" + ); + + await SpecialPowers.pushPrefEnv({ set: [[PREF_ACTIVE, true]] }); + + let newTab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + waitForLoad: true, + }); + let testBrowser = newTab.linkedBrowser; + + var url = httpsTestRoot + "file_bug902350.html"; + var frameUrl = httpsTestRoot + "file_bug902350_frame.html"; + let loadPromise = BrowserTestUtils.browserLoaded(testBrowser, false, url); + let frameLoadPromise = BrowserTestUtils.browserLoaded( + testBrowser, + true, + frameUrl + ); + BrowserTestUtils.loadURIString(testBrowser, url); + await loadPromise; + await frameLoadPromise; + + // Find the iframe and click the link in it. + let insecureUrl = "http://example.com/"; + let insecureLoadPromise = BrowserTestUtils.browserLoaded( + testBrowser, + false, + insecureUrl + ); + SpecialPowers.spawn(testBrowser, [], function () { + var frame = content.document.getElementById("testing_frame"); + var topTarget = frame.contentWindow.document.getElementById("topTarget"); + topTarget.click(); + }); + + // Navigating to insecure domain through target='_top' should succeed. + await insecureLoadPromise; + + // The link click should not invoke the Mixed Content Blocker. + let { gIdentityHandler } = testBrowser.ownerGlobal; + ok( + !gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"), + "Mixed Content Doorhanger did not appear when trying to navigate top" + ); + + BrowserTestUtils.removeTab(newTab); +}); diff --git a/dom/base/test/browser_chromeutils_getalldomprocesses.js b/dom/base/test/browser_chromeutils_getalldomprocesses.js new file mode 100644 index 0000000000..aef5bcf12b --- /dev/null +++ b/dom/base/test/browser_chromeutils_getalldomprocesses.js @@ -0,0 +1,62 @@ +add_task(async function testParentProcess() { + const [parentProcess] = ChromeUtils.getAllDOMProcesses(); + // browser.xhtml is in the parent process, so its domProcess is the parent process one + is( + parentProcess, + window.browsingContext.currentWindowGlobal.domProcess, + "The first element is the parent process" + ); + is( + parentProcess.osPid, + Services.appinfo.processID, + "We got the right OS Pid" + ); + is(parentProcess.childID, 0, "Parent process has childID set to 0"); +}); + +add_task(async function testContentProcesses() { + info("Open a tab in a content process"); + BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:blank"); + await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + + info("Sanity checks against all returned elements of getAllDOMProcesses"); + const processes = ChromeUtils.getAllDOMProcesses(); + const allPids = [], + allChildIDs = []; + for (const process of processes) { + ok( + process instanceof Ci.nsIDOMProcessParent, + `Each element of the array is a nsIDOMProcessParent (${process})` + ); + ok(process.osPid > 0, `OS Pid looks correct ${process.osPid}`); + if (process == processes[0]) { + is( + process.childID, + 0, + `Child ID is 0 for the parent process, which is the first element of the returned array` + ); + is( + process.remoteType, + null, + "The main process's remote type should be NOT_REMOTE" + ); + } else { + ok(process.childID > 0, `Child ID looks also correct ${process.childID}`); + ok(process.remoteType, "Should have a remote type"); + } + + ok( + !allPids.includes(process.osPid), + "We only get one nsIDOMProcessParent per OS process == each osPid is different" + ); + allPids.push(process.osPid); + ok(!allChildIDs.includes(process.childID), "Each childID is different"); + allChildIDs.push(process.childID); + } + + info("Search for the nsIDOMProcessParent for the opened tab"); + const { currentWindowGlobal } = gBrowser.selectedBrowser.browsingContext; + const tabProcess = currentWindowGlobal.domProcess; + ok(processes.includes(tabProcess), "Found the tab process in the list"); + is(tabProcess.osPid, currentWindowGlobal.osPid, "We got the right OS Pid"); +}); diff --git a/dom/base/test/browser_chromeutils_isdomobject.js b/dom/base/test/browser_chromeutils_isdomobject.js new file mode 100644 index 0000000000..14a5d69898 --- /dev/null +++ b/dom/base/test/browser_chromeutils_isdomobject.js @@ -0,0 +1,115 @@ +"use strict"; + +add_task(async function invalidArgument() { + const args = [undefined, null, 42, "foo"]; + + for (const argument of args) { + let hadException = false; + try { + ChromeUtils.isDOMObject(argument); + } catch (ex) { + hadException = true; + } + ok(hadException, "Should have got an exception!"); + } +}); + +add_task(async function NoUnwrap() { + const args = [ + window.document, + window.document.childNodes, + new DocumentFragment(), + new Response(), + new URL("https://example.com"), + ]; + + for (const argument of args) { + ok( + ChromeUtils.isDOMObject(argument, false), + `${ChromeUtils.getClassName( + argument + )} to be a DOM object with unwrap=false` + ); + } + + ok( + !ChromeUtils.isDOMObject(window, false), + `${ChromeUtils.getClassName( + window + )} not to be a DOM object with unwrap=false` + ); +}); + +add_task(async function DOMObjects() { + const args = [ + window, + window.document, + window.document.childNodes, + new DocumentFragment(), + new Response(), + new URL("https://example.com"), + ]; + + for (const argument of args) { + ok( + ChromeUtils.isDOMObject(argument), + `${ChromeUtils.getClassName(argument)} to be a DOM object` + ); + } +}); + +add_task(async function nonDOMObjects() { + const args = [new Object(), {}, []]; + + for (const argument of args) { + ok( + !ChromeUtils.isDOMObject(argument), + `${ChromeUtils.getClassName(argument)} not to be a DOM object` + ); + } +}); + +add_task(async function DOMObjects_contentProcess() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: `data:text/html,
`, + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async () => { + const args = [ + content, + content.document, + content.document.querySelector("div"), + content.document.childNodes, + new content.DocumentFragment(), + new content.URL("https://example.com"), + ]; + + for (const argument of args) { + ok( + ChromeUtils.isDOMObject(argument), + `${ChromeUtils.getClassName( + argument + )} in content to be a DOM object` + ); + } + + ok( + !ChromeUtils.isDOMObject({}), + `${ChromeUtils.getClassName({})} in content not to be a DOM object` + ); + + // unwrap=false + for (const argument of args) { + ok( + !ChromeUtils.isDOMObject(argument, false), + `${ChromeUtils.getClassName( + argument + )} in content not to be a DOM object with unwrap=false` + ); + } + }); + } + ); +}); diff --git a/dom/base/test/browser_data_documents_aboutmemory.js b/dom/base/test/browser_data_documents_aboutmemory.js new file mode 100644 index 0000000000..5c534a83b6 --- /dev/null +++ b/dom/base/test/browser_data_documents_aboutmemory.js @@ -0,0 +1,20 @@ +add_task(async function () { + const doc = new DOMParser().parseFromString("

dadada

", "text/html"); + + let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].getService( + Ci.nsIMemoryReporterManager + ); + + let amount = 0; + const handleReport = (aProcess, aPath, aKind, aUnits, aAmount) => { + const regex = new RegExp(".*/window-objects/.*/data-documents/.*"); + if (regex.test(aPath)) { + amount += aAmount; + } + }; + + await new Promise(r => + mgr.getReports(handleReport, null, r, null, /* anonymized = */ false) + ); + ok(amount > 0, "Got data documents amount"); +}); diff --git a/dom/base/test/browser_force_process_selector.js b/dom/base/test/browser_force_process_selector.js new file mode 100644 index 0000000000..15157b240d --- /dev/null +++ b/dom/base/test/browser_force_process_selector.js @@ -0,0 +1,38 @@ +"use strict"; + +const CONTENT_CREATED = "ipc:content-created"; + +// Make sure that BTU.withNewTab({ ..., forceNewProcess: true }) loads +// new tabs in their own process. +async function spawnNewAndTest(recur, pids) { + await BrowserTestUtils.withNewTab( + { gBrowser, url: "about:blank", forceNewProcess: true }, + async function (browser) { + // Make sure our new browser is in its own process. + let newPid = browser.frameLoader.remoteTab.osPid; + ok(!pids.has(newPid), "new tab is in its own process: " + recur); + pids.add(newPid); + + if (recur) { + await spawnNewAndTest(recur - 1, pids); + } else { + await BrowserTestUtils.withNewTab( + { gBrowser, url: "about:blank" }, + function (lastBrowser) { + let lastPid = lastBrowser.frameLoader.remoteTab.osPid; + ok(pids.has(lastPid), "final tab cannot be in its own process"); + } + ); + } + } + ); +} + +add_task(async function test() { + let curPid = gBrowser.selectedBrowser.frameLoader.remoteTab.osPid; + let maxCount = Services.prefs.getIntPref("dom.ipc.processCount"); + + // Use at least one more tab than max processes or at least 5 to make this + // test interesting. + await spawnNewAndTest(Math.max(maxCount + 1, 5), new Set([curPid])); +}); diff --git a/dom/base/test/browser_form_validity_popup_submit.js b/dom/base/test/browser_form_validity_popup_submit.js new file mode 100644 index 0000000000..2cefbf9d98 --- /dev/null +++ b/dom/base/test/browser_form_validity_popup_submit.js @@ -0,0 +1,55 @@ +/** + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +"use strict"; + +async function promiseValidityPopupShown() { + await BrowserTestUtils.waitForEvent( + window, + "popupshown", + /* capture = */ false, + event => event.target.id == "invalid-form-popup" + ); + return document.getElementById("invalid-form-popup"); +} + +const HTML = ` +
+ + +
+`; + +add_task(async function bug_1790128() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: `data:text/html,${encodeURI(HTML)}`, + }, + async function (aBrowser) { + let promisePopupShown = promiseValidityPopupShown(); + await BrowserTestUtils.synthesizeMouseAtCenter("#submit", {}, aBrowser); + let popup = await promisePopupShown; + is(popup.state, "open", "Should be open"); + + let promisePopupHidden = BrowserTestUtils.waitForEvent( + popup, + "popuphidden" + ); + promisePopupShown = promiseValidityPopupShown(); + + // This is written in a rather odd style because depending on whether + // panel animations are enabled we might be able to show the popup again + // after the first click or not. The point is that after one click the + // popup should've hid at least once, and after two the popup should've + // open again at least once. + await BrowserTestUtils.synthesizeMouseAtCenter("#submit", {}, aBrowser); + await promisePopupHidden; + await BrowserTestUtils.synthesizeMouseAtCenter("#submit", {}, aBrowser); + await promisePopupShown; + ok(true, "Should've shown the popup again"); + } + ); +}); diff --git a/dom/base/test/browser_inputStream_structuredClone.js b/dom/base/test/browser_inputStream_structuredClone.js new file mode 100644 index 0000000000..a022563ac0 --- /dev/null +++ b/dom/base/test/browser_inputStream_structuredClone.js @@ -0,0 +1,72 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +const URIs = [ + "about:about", + "http://example.com/browser/dom/base/test/empty.html", +]; + +async function runTest(input, url) { + let tab = BrowserTestUtils.addTab(gBrowser, url); + let browser = gBrowser.getBrowserForTab(tab); + + await BrowserTestUtils.browserLoaded(browser); + + let stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance( + Ci.nsIStringInputStream + ); + stream.setData(input, input.length); + + let data = { + inputStream: stream, + }; + + is( + data.inputStream.available(), + input.length, + "The length of the inputStream matches: " + input.length + ); + + // FIXME: SpecialPowers.spawn currently crashes when trying to return + // values containing input streams. + /* eslint-disable no-shadow */ + let dataBack = await ContentTask.spawn(browser, data, function (data) { + let dataBack = { + inputStream: data.inputStream, + check: true, + }; + + if (content.location.href.startsWith("about:")) { + dataBack.check = + data.inputStream instanceof + content.Components.interfaces.nsIInputStream; + } + + return dataBack; + }); + /* eslint-enable no-shadow */ + + ok(dataBack.check, "The inputStream is a nsIInputStream also on content."); + ok( + data.inputStream instanceof Ci.nsIInputStream, + "The original object was an inputStream" + ); + ok( + dataBack.inputStream instanceof Ci.nsIInputStream, + "We have an inputStream back from the content." + ); + + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test() { + let a = "a"; + for (let i = 0; i < 25; ++i) { + a += a; + } + + for (let i = 0; i < URIs.length; ++i) { + await runTest("Hello world", URIs[i]); + await runTest(a, URIs[i]); + } +}); diff --git a/dom/base/test/browser_messagemanager_loadprocessscript.js b/dom/base/test/browser_messagemanager_loadprocessscript.js new file mode 100644 index 0000000000..16686dd566 --- /dev/null +++ b/dom/base/test/browser_messagemanager_loadprocessscript.js @@ -0,0 +1,193 @@ +function getBaseNumberOfProcesses() { + // We should have three processes for this test, the parent process and two + // content processes for the tabs craeted by this test. + let processCount = 3; + + // If we run WebExtensions out-of-process (see bug 1190679), there might be + // additional processes for those, so let's add these to the base count to + // not have system WebExtensions cause test failures. + for (let i = 0; i < Services.ppmm.childCount; i++) { + if ( + Services.ppmm.getChildAt(i).remoteType === E10SUtils.EXTENSION_REMOTE_TYPE + ) { + processCount += 1; + } + } + + return processCount; +} + +function checkBaseProcessCount(description) { + const baseProcessCount = getBaseNumberOfProcesses(); + const { childCount } = Services.ppmm; + // With preloaded activity-stream, process count is a bit undeterministic, so + // allow for some variation + const extraCount = baseProcessCount + 1; + ok( + childCount === baseProcessCount || childCount === extraCount, + `${description} (${baseProcessCount} or ${extraCount})` + ); +} + +function processScript() { + /* eslint-env mozilla/process-script */ + if (Services.cpmm !== this) { + dump("Test failed: wrong global object\n"); + return; + } + + this.cpmm = Services.cpmm; + + addMessageListener("ProcessTest:Reply", function listener(msg) { + removeMessageListener("ProcessTest:Reply", listener); + sendAsyncMessage("ProcessTest:Finished"); + }); + sendSyncMessage("ProcessTest:Loaded"); +} +var processScriptURL = "data:,(" + processScript.toString() + ").call(this)"; + +function initTestScript() { + /* eslint-env mozilla/process-script */ + let init = initialProcessData; + if (init.test123 != "hello") { + dump("Initial data incorrect\n"); + return; + } + + sendAsyncMessage("ProcessTest:InitGood", init.test456.get("hi")); +} +var initTestScriptURL = "data:,(" + initTestScript.toString() + ")()"; + +var checkProcess = async function (mm) { + let { target } = await promiseMessage(mm, "ProcessTest:Loaded"); + target.sendAsyncMessage("ProcessTest:Reply"); + await promiseMessage(target, "ProcessTest:Finished"); + ok(true, "Saw process finished"); +}; + +function promiseMessage(messageManager, message) { + return new Promise(resolve => { + let listener = msg => { + messageManager.removeMessageListener(message, listener); + resolve(msg); + }; + + messageManager.addMessageListener(message, listener); + }); +} + +add_task(async function () { + // We want to count processes in this test, so let's disable the pre-allocated process manager. + await SpecialPowers.pushPrefEnv({ + set: [["dom.ipc.processPrelaunch.enabled", false]], + }); +}); + +add_task(async function () { + // This test is only relevant in e10s. + if (!gMultiProcessBrowser) { + return; + } + + Services.ppmm.releaseCachedProcesses(); + + await SpecialPowers.pushPrefEnv({ set: [["dom.ipc.processCount", 5]] }); + await SpecialPowers.pushPrefEnv({ + set: [["dom.ipc.keepProcessesAlive.web", 5]], + }); + + let tabs = []; + for (let i = 0; i < 3; i++) { + tabs[i] = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:blank" + ); + } + + for (let i = 0; i < 3; i++) { + // FIXME: This should wait for the tab removal gets reflected to the + // process count (bug 1446726). + let sessionStorePromise = BrowserTestUtils.waitForSessionStoreUpdate( + tabs[i] + ); + BrowserTestUtils.removeTab(tabs[i]); + await sessionStorePromise; + } + + Services.ppmm.releaseCachedProcesses(); + checkBaseProcessCount( + "Should get back to the base number of processes at this point" + ); +}); + +// Test that loading a process script loads in all existing processes +add_task(async function () { + let checks = []; + for (let i = 0; i < Services.ppmm.childCount; i++) { + checks.push(checkProcess(Services.ppmm.getChildAt(i))); + } + + Services.ppmm.loadProcessScript(processScriptURL, false); + await Promise.all(checks); +}); + +// Test that loading a process script loads in new processes +add_task(async function () { + // This test is only relevant in e10s + if (!gMultiProcessBrowser) { + return; + } + + checkBaseProcessCount( + "Should still be at the base number of processes at this point" + ); + + // Load something in the main process + BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla"); + await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + + let init = Services.ppmm.initialProcessData; + init.test123 = "hello"; + init.test456 = new Map(); + init.test456.set("hi", "bye"); + + // With no remote frames left we should be down to one process. + // However, stuff like remote thumbnails can cause a content + // process to exist nonetheless. This should be rare, though, + // so the test is useful most of the time. + if (Services.ppmm.childCount == 2) { + let mainMM = Services.ppmm.getChildAt(0); + + let check = checkProcess(Services.ppmm); + Services.ppmm.loadProcessScript(processScriptURL, true); + + // The main process should respond + await check; + + check = checkProcess(Services.ppmm); + // Reset the default browser to start a new child process + gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, { + remoteType: E10SUtils.DEFAULT_REMOTE_TYPE, + }); + BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:blank"); + await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + + checkBaseProcessCount( + "Should be back to the base number of processes at this point" + ); + + // The new process should have responded + await check; + + Services.ppmm.removeDelayedProcessScript(processScriptURL); + + let childMM; + childMM = Services.ppmm.getChildAt(2); + + childMM.loadProcessScript(initTestScriptURL, false); + let msg = await promiseMessage(childMM, "ProcessTest:InitGood"); + is(msg.data, "bye", "initial process data was correct"); + } else { + info("Unable to finish test entirely"); + } +}); diff --git a/dom/base/test/browser_messagemanager_targetframeloader.js b/dom/base/test/browser_messagemanager_targetframeloader.js new file mode 100644 index 0000000000..62c8482add --- /dev/null +++ b/dom/base/test/browser_messagemanager_targetframeloader.js @@ -0,0 +1,36 @@ +function frameScript() { + sendSyncMessage("Test:Message"); + sendAsyncMessage("Test:Message"); + sendAsyncMessage("Test:Done"); +} + +function test() { + waitForExplicitFinish(); + + var newTab = BrowserTestUtils.addTab(gBrowser, "about:blank"); + gBrowser.selectedTab = newTab; + + let browser = newTab.linkedBrowser; + let frameLoader = browser.frameLoader; + ok(frameLoader !== null, "frameLoader looks okay"); + + browser.messageManager.loadFrameScript( + "data:,(" + frameScript.toString() + ")()", + false + ); + + browser.messageManager.addMessageListener("Test:Message", msg => { + ok(msg.target === browser, " is correct"); + ok(msg.targetFrameLoader === frameLoader, "frameLoader is correct"); + ok( + browser.frameLoader === msg.targetFrameLoader, + "browser frameloader is correct" + ); + }); + + browser.messageManager.addMessageListener("Test:Done", () => { + info("Finished"); + gBrowser.removeCurrentTab(); + finish(); + }); +} diff --git a/dom/base/test/browser_messagemanager_unload.js b/dom/base/test/browser_messagemanager_unload.js new file mode 100644 index 0000000000..de8be528b3 --- /dev/null +++ b/dom/base/test/browser_messagemanager_unload.js @@ -0,0 +1,131 @@ +function frameScript() { + function eventHandler(e) { + if (!docShell) { + sendAsyncMessage("Test:Fail", "docShell is null"); + } + + sendAsyncMessage("Test:Event", [ + e.type, + e.target === content.document, + e.eventPhase, + ]); + } + + let outerID = content.docShell.outerWindowID; + function onOuterWindowDestroyed(subject, topic, data) { + if (docShell) { + sendAsyncMessage("Test:Fail", "docShell is non-null"); + } + + let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data; + sendAsyncMessage("Test:Event", ["outer-window-destroyed", id == outerID]); + if (id == outerID) { + Services.obs.removeObserver( + onOuterWindowDestroyed, + "outer-window-destroyed" + ); + } + } + + let url = + "https://example.com/browser/dom/base/test/file_messagemanager_unload.html"; + + content.location = url; + addEventListener( + "load", + e => { + if (e.target.location != url) { + return; + } + + addEventListener("unload", eventHandler, false); + addEventListener("unload", eventHandler, true); + addEventListener("pagehide", eventHandler, false); + addEventListener("pagehide", eventHandler, true); + Services.obs.addObserver( + onOuterWindowDestroyed, + "outer-window-destroyed" + ); + + sendAsyncMessage("Test:Ready"); + }, + true + ); +} + +const EXPECTED = [ + // Unload events on the BrowserChildGlobal. These come first so that the + // docshell is available. + ["unload", false, 2], + ["unload", false, 2], + + // pagehide and unload events for the top-level page. + ["pagehide", true, 1], + ["pagehide", true, 3], + ["unload", true, 1], + + // pagehide and unload events for the iframe. + ["pagehide", false, 1], + ["pagehide", false, 3], + ["unload", false, 1], + + // outer-window-destroyed for both pages. + ["outer-window-destroyed", false], + ["outer-window-destroyed", true], +]; + +function test() { + waitForExplicitFinish(); + + var newTab = BrowserTestUtils.addTab(gBrowser, "about:blank"); + gBrowser.selectedTab = newTab; + + let browser = newTab.linkedBrowser; + let frameLoader = browser.frameLoader; + ok(frameLoader !== null, "frameLoader looks okay"); + + browser.messageManager.loadFrameScript( + "data:,(" + frameScript.toString() + ")()", + false + ); + + browser.messageManager.addMessageListener( + "Test:Fail", + msg => { + ok(false, msg.data); + }, + true + ); + + let index = 0; + browser.messageManager.addMessageListener( + "Test:Event", + msg => { + ok(msg.target === browser, " is correct"); + ok(msg.targetFrameLoader === frameLoader, "frameLoader is correct"); + ok( + browser.frameLoader === null, + "browser frameloader null during teardown" + ); + + info(JSON.stringify(msg.data)); + + is( + JSON.stringify(msg.data), + JSON.stringify(EXPECTED[index]), + "results match" + ); + index++; + + if (index == EXPECTED.length) { + finish(); + } + }, + true + ); + + browser.messageManager.addMessageListener("Test:Ready", () => { + info("Got ready message"); + gBrowser.removeCurrentTab(); + }); +} diff --git a/dom/base/test/browser_multiple_popups.html b/dom/base/test/browser_multiple_popups.html new file mode 100644 index 0000000000..6e0b85ea06 --- /dev/null +++ b/dom/base/test/browser_multiple_popups.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + diff --git a/dom/base/test/browser_multiple_popups.js b/dom/base/test/browser_multiple_popups.js new file mode 100644 index 0000000000..c50c246644 --- /dev/null +++ b/dom/base/test/browser_multiple_popups.js @@ -0,0 +1,296 @@ +/** + * In this test, we check that the content can't open more than one popup at a + * time (depending on "dom.allow_mulitple_popups" preference value). + */ + +const TEST_DOMAIN = "https://example.net"; +const TEST_PATH = "/browser/dom/base/test/"; +const CHROME_DOMAIN = "chrome://mochitests/content"; + +requestLongerTimeout(2); + +function promisePopups(count) { + let windows = []; + return new Promise(resolve => { + if (count == 0) { + resolve([]); + return; + } + + let windowObserver = function (aSubject, aTopic, aData) { + if (aTopic != "domwindowopened") { + return; + } + windows.push(aSubject); + if (--count == 0) { + Services.ww.unregisterNotification(windowObserver); + SimpleTest.executeSoon(() => resolve(windows)); + } + }; + Services.ww.registerNotification(windowObserver); + }); +} + +async function withTestPage(popupCount, optionsOrCallback, callback) { + let options = optionsOrCallback; + if (!callback) { + callback = optionsOrCallback; + options = {}; + } + + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.block_multiple_popups", true], + ["dom.disable_open_during_load", true], + ], + }); + + let domain = options.chrome ? CHROME_DOMAIN : TEST_DOMAIN; + let tab = BrowserTestUtils.addTab( + gBrowser, + domain + TEST_PATH + "browser_multiple_popups.html" + (options.query || "") + ); + gBrowser.selectedTab = tab; + + let browser = gBrowser.getBrowserForTab(tab); + await BrowserTestUtils.browserLoaded(browser); + + let obs = promisePopups(popupCount); + + await callback(browser); + + let windows = await obs; + ok(true, `We had ${popupCount} windows.`); + for (let win of windows) { + if (win.document.readyState !== "complete") { + await BrowserTestUtils.waitForEvent(win, "load"); + } + await BrowserTestUtils.closeWindow(win); + } + BrowserTestUtils.removeTab(tab); +} + +function promisePopupsBlocked(browser, expectedCount) { + return SpecialPowers.spawn(browser, [expectedCount], count => { + return new content.Promise(resolve => { + content.addEventListener("DOMPopupBlocked", function cb() { + if (--count == 0) { + content.removeEventListener("DOMPopupBlocked", cb); + ok(true, "The popup has been blocked"); + resolve(); + } + }); + }); + }); +} + +function startOpeningTwoPopups(browser) { + return SpecialPowers.spawn(browser.browsingContext, [], () => { + let p = content.document.createElement("p"); + p.setAttribute("id", "start"); + content.document.body.appendChild(p); + }); +} + +add_task(async _ => { + info("All opened if the pref is off"); + await withTestPage(2, async function (browser) { + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.block_multiple_popups", false], + ["dom.disable_open_during_load", true], + ], + }); + + await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); + }); +}); + +add_task(async _ => { + info("2 window.open()s in a click event allowed because whitelisted domain."); + + const uri = Services.io.newURI(TEST_DOMAIN); + const principal = Services.scriptSecurityManager.createContentPrincipal( + uri, + {} + ); + + Services.perms.addFromPrincipal( + principal, + "popup", + Services.perms.ALLOW_ACTION + ); + + await withTestPage(2, async function (browser) { + await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); + }); + + await new Promise(resolve => { + Services.clearData.deleteData( + Ci.nsIClearDataService.CLEAR_PERMISSIONS, + value => { + Assert.equal(value, 0); + resolve(); + } + ); + }); +}); + +add_task(async _ => { + info( + "2 window.open()s in a mouseup event allowed because whitelisted domain." + ); + + const uri = Services.io.newURI(TEST_DOMAIN); + const principal = Services.scriptSecurityManager.createContentPrincipal( + uri, + {} + ); + + Services.perms.addFromPrincipal( + principal, + "popup", + Services.perms.ALLOW_ACTION + ); + + await withTestPage(2, async function (browser) { + await BrowserTestUtils.synthesizeMouseAtCenter("#input", {}, browser); + }); + + await new Promise(aResolve => { + Services.clearData.deleteData( + Ci.nsIClearDataService.CLEAR_PERMISSIONS, + value => { + Assert.equal(value, 0); + aResolve(); + } + ); + }); +}); + +add_task(async _ => { + info( + "2 window.open()s in a single click event: only the first one is allowed." + ); + + await withTestPage(1, async function (browser) { + let p = promisePopupsBlocked(browser, 1); + await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); + await p; + }); +}); + +add_task(async _ => { + info( + "2 window.open()s in a single mouseup event: only the first one is allowed." + ); + + await withTestPage(1, async function (browser) { + let p = promisePopupsBlocked(browser, 1); + await BrowserTestUtils.synthesizeMouseAtCenter("#input", {}, browser); + await p; + }); +}); + +add_task(async _ => { + info("2 window.open()s by non-event code: no windows allowed."); + + await withTestPage(0, { query: "?openPopups" }, async function (browser) { + let p = promisePopupsBlocked(browser, 2); + await startOpeningTwoPopups(browser); + await p; + }); +}); + +add_task(async _ => { + info("2 window.open()s by non-event code allowed by permission"); + const uri = Services.io.newURI(TEST_DOMAIN); + const principal = Services.scriptSecurityManager.createContentPrincipal( + uri, + {} + ); + + Services.perms.addFromPrincipal( + principal, + "popup", + Services.perms.ALLOW_ACTION + ); + + await withTestPage(2, { query: "?openPopups" }, async function (browser) { + await startOpeningTwoPopups(browser); + }); + + await new Promise(aResolve => { + Services.clearData.deleteData( + Ci.nsIClearDataService.CLEAR_PERMISSIONS, + value => { + Assert.equal(value, 0); + aResolve(); + } + ); + }); +}); + +add_task(async _ => { + info( + "1 window.open() executing another window.open(): only the first one is allowed." + ); + + await withTestPage(1, async function (browser) { + await BrowserTestUtils.synthesizeMouseAtCenter( + "#openNestedPopups", + {}, + browser + ); + }); +}); + +add_task(async _ => { + info("window.open() and .click() on the element opening the window."); + + await withTestPage(1, async function (browser) { + let p = promisePopupsBlocked(browser, 1); + + await BrowserTestUtils.synthesizeMouseAtCenter( + "#openPopupAndClick", + {}, + browser + ); + + await p; + }); +}); + +add_task(async _ => { + info("All opened from chrome."); + await withTestPage(2, { chrome: true }, async function (browser) { + await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); + }); +}); + +add_task(async function test_bug_1685056() { + info( + "window.open() from a blank iframe window during an event dispatched at the parent page: window should be allowed" + ); + + await withTestPage(1, async function (browser) { + await BrowserTestUtils.synthesizeMouseAtCenter( + "#openPopupInFrame", + {}, + browser + ); + }); +}); + +add_task(async function test_bug_1689853() { + info("window.open() from a js bookmark (LOAD_FLAGS_ALLOW_POPUPS)"); + await withTestPage(1, async function (browser) { + const URI = + "javascript:void(window.open('empty.html', '_blank', 'width=100,height=100'));"; + window.openTrustedLinkIn(URI, "current", { + allowPopups: true, + inBackground: false, + allowInheritPrincipal: true, + }); + }); +}); diff --git a/dom/base/test/browser_outline_refocus.js b/dom/base/test/browser_outline_refocus.js new file mode 100644 index 0000000000..066c25de63 --- /dev/null +++ b/dom/base/test/browser_outline_refocus.js @@ -0,0 +1,65 @@ +const URL = `data:text/html,Click me`; + +async function test_browser_outline_refocus( + aMessage, + aShouldFocusBeVisible, + aOpenTabCallback +) { + await BrowserTestUtils.withNewTab(URL, async function (browser) { + let tab = gBrowser.getTabForBrowser(browser); + let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser); + + await aOpenTabCallback(browser); + + info("waiting for new tab"); + let newTab = await newTabPromise; + + is(gBrowser.selectedTab, newTab, "Should've switched to the new tab"); + + info("switching back"); + await BrowserTestUtils.switchTab(gBrowser, tab); + + info("checking focus"); + let [wasFocused, wasFocusVisible] = await SpecialPowers.spawn( + browser, + [], + () => { + let link = content.document.querySelector("a"); + return [link.matches(":focus"), link.matches(":focus-visible")]; + } + ); + + ok(wasFocused, "Link should be refocused"); + is(wasFocusVisible, aShouldFocusBeVisible, aMessage); + + info("closing tab"); + await BrowserTestUtils.removeTab(newTab); + }); +} + +add_task(async function browser_outline_refocus_mouse() { + await test_browser_outline_refocus( + "Link shouldn't show outlines since it was originally focused by mouse", + false, + function (aBrowser) { + info("clicking on link"); + return BrowserTestUtils.synthesizeMouseAtCenter("a", {}, aBrowser); + } + ); +}); + +add_task(async function browser_outline_refocus_key() { + await SpecialPowers.pushPrefEnv({ + set: [["accessibility.tabfocus", 7]], + }); + + await test_browser_outline_refocus( + "Link should show outlines since it was originally focused by keyboard", + true, + function (aBrowser) { + info("Navigating via keyboard"); + EventUtils.sendKey("tab"); + EventUtils.sendKey("return"); + } + ); +}); diff --git a/dom/base/test/browser_page_load_event_telemetry.js b/dom/base/test/browser_page_load_event_telemetry.js new file mode 100644 index 0000000000..839e333d61 --- /dev/null +++ b/dom/base/test/browser_page_load_event_telemetry.js @@ -0,0 +1,46 @@ +"use strict"; + +const { TelemetryTestUtils } = ChromeUtils.importESModule( + "resource://testing-common/TelemetryTestUtils.sys.mjs" +); + +const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS; + +add_task(async function () { + let tab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + waitForLoad: true, + }); + + let browser = tab.linkedBrowser; + + // Reset event counts. + Services.telemetry.clearEvents(); + TelemetryTestUtils.assertNumberOfEvents(0); + + // Add checks for pageload ping and pageload event + let pingSubmitted = false; + GleanPings.pageload.testBeforeNextSubmit(reason => { + pingSubmitted = true; + Assert.equal(reason, "threshold"); + let record = Glean.perf.pageLoad.testGetValue(); + Assert.greaterOrEqual( + record.length, + 30, + "Should have at least 30 page load events" + ); + }); + + // Perform page load 30 times to trigger the ping being sent + for (let i = 0; i < 30; i++) { + BrowserTestUtils.loadURIString(browser, "https://example.com"); + await BrowserTestUtils.browserLoaded(browser); + } + + await BrowserTestUtils.waitForCondition( + () => pingSubmitted, + "Page load ping should have been submitted." + ); + + BrowserTestUtils.removeTab(tab); +}); diff --git a/dom/base/test/browser_pagehide_on_tab_close.js b/dom/base/test/browser_pagehide_on_tab_close.js new file mode 100644 index 0000000000..4db890aa57 --- /dev/null +++ b/dom/base/test/browser_pagehide_on_tab_close.js @@ -0,0 +1,21 @@ +function test() { + waitForExplicitFinish(); + + var tab = BrowserTestUtils.addTab(gBrowser); + gBrowser.selectedTab = tab; + + tab.linkedBrowser.addEventListener( + "load", + function () { + tab.linkedBrowser.addEventListener("pagehide", function () { + ok(true, "got page hide event"); + finish(); + }); + + executeSoon(() => { + gBrowser.removeTab(tab); + }); + }, + { capture: true, once: true } + ); +} diff --git a/dom/base/test/browser_promiseDocumentFlushed.js b/dom/base/test/browser_promiseDocumentFlushed.js new file mode 100644 index 0000000000..1df8f7af55 --- /dev/null +++ b/dom/base/test/browser_promiseDocumentFlushed.js @@ -0,0 +1,292 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Dirties style and layout on the current browser window. + * + * @param {Number} Optional factor by which to modify the DOM. Useful for + * when multiple calls to dirtyTheDOM may occur, and you need them + * to dirty the DOM differently from one another. If you only need + * to dirty the DOM once, this can be omitted. + */ +function dirtyStyleAndLayout(factor = 1) { + gNavToolbox.style.padding = factor + "px"; +} + +/** + * Dirties style of the current browser window, but NOT layout. + */ +function dirtyStyle() { + gNavToolbox.style.color = "red"; +} + +const gWindowUtils = window.windowUtils; + +/** + * Asserts that no style or layout flushes are required by the + * current window. + */ +function assertNoFlushesRequired() { + Assert.ok( + !gWindowUtils.needsFlush(Ci.nsIDOMWindowUtils.FLUSH_STYLE), + "No style flushes are required." + ); + Assert.ok( + !gWindowUtils.needsFlush(Ci.nsIDOMWindowUtils.FLUSH_LAYOUT), + "No layout flushes are required." + ); +} + +/** + * Asserts that the DOM has been dirtied, and so style and layout flushes + * are required. + */ +function assertFlushesRequired() { + Assert.ok( + gWindowUtils.needsFlush(Ci.nsIDOMWindowUtils.FLUSH_STYLE), + "Style flush required." + ); + Assert.ok( + gWindowUtils.needsFlush(Ci.nsIDOMWindowUtils.FLUSH_LAYOUT), + "Layout flush required." + ); +} + +/** + * Removes style changes from dirtyTheDOM() from the browser window, + * and resolves once the refresh driver ticks. + */ +async function cleanTheDOM() { + gNavToolbox.style.padding = ""; + gNavToolbox.style.color = ""; + await window.promiseDocumentFlushed(() => {}); +} + +add_setup(async function () { + registerCleanupFunction(cleanTheDOM); +}); + +/** + * Tests that if the DOM is dirty, that promiseDocumentFlushed will + * resolve once layout and style have been flushed. + */ +add_task(async function test_basic() { + info("Dirtying style / layout"); + dirtyStyleAndLayout(); + assertFlushesRequired(); + + info("Waiting"); + await window.promiseDocumentFlushed(() => {}); + assertNoFlushesRequired(); + + info("Dirtying style"); + dirtyStyle(); + assertFlushesRequired(); + + info("Waiting"); + await window.promiseDocumentFlushed(() => {}); + assertNoFlushesRequired(); + + // The DOM should be clean already, but we'll do this anyway to isolate + // failures from other tests. + info("Cleaning up"); + await cleanTheDOM(); +}); + +/** + * Test that values returned by the callback passed to promiseDocumentFlushed + * get passed down through the Promise resolution. + */ +add_task(async function test_can_get_results_from_callback() { + const NEW_PADDING = "2px"; + + gNavToolbox.style.padding = NEW_PADDING; + + assertFlushesRequired(); + + let paddings = await window.promiseDocumentFlushed(() => { + let style = window.getComputedStyle(gNavToolbox); + return { + left: style.paddingLeft, + right: style.paddingRight, + top: style.paddingTop, + bottom: style.paddingBottom, + }; + }); + + for (let prop in paddings) { + Assert.equal(paddings[prop], NEW_PADDING, "Got expected padding"); + } + + await cleanTheDOM(); + + gNavToolbox.style.padding = NEW_PADDING; + + assertFlushesRequired(); + + let rect = await window.promiseDocumentFlushed(() => { + let observer = { + reflow() { + Assert.ok(false, "A reflow should not have occurred."); + }, + reflowInterruptible() {}, + QueryInterface: ChromeUtils.generateQI([ + "nsIReflowObserver", + "nsISupportsWeakReference", + ]), + }; + + let docShell = window.docShell; + docShell.addWeakReflowObserver(observer); + + let toolboxRect = gNavToolbox.getBoundingClientRect(); + + docShell.removeWeakReflowObserver(observer); + return toolboxRect; + }); + + // The actual values of this rect aren't super important for + // the purposes of this test - we just want to know that a valid + // rect was returned, so checking for properties being greater than + // 0 is sufficient. + for (let property of ["width", "height"]) { + Assert.ok( + rect[property] > 0, + `Rect property ${property} > 0 (${rect[property]})` + ); + } + + await cleanTheDOM(); +}); + +/** + * Test that if promiseDocumentFlushed is requested on a window + * that closes before it gets a chance to do a refresh driver + * tick, the promiseDocumentFlushed Promise is still resolved, and + * the callback is still called. + */ +add_task(async function test_resolved_in_window_close() { + let win = await BrowserTestUtils.openNewBrowserWindow(); + + await win.promiseDocumentFlushed(() => {}); + + // Use advanceTimeAndRefresh to pause paints in the window: + let utils = win.windowUtils; + utils.advanceTimeAndRefresh(0); + + win.gNavToolbox.style.padding = "5px"; + + const EXPECTED = 1234; + let promise = win.promiseDocumentFlushed(() => { + // Despite the window not painting before closing, this + // callback should be fired when the window gets torn + // down and should stil be able to return a result. + return EXPECTED; + }); + + await BrowserTestUtils.closeWindow(win); + Assert.equal(await promise, EXPECTED); +}); + +/** + * Test that re-entering promiseDocumentFlushed is not possible + * from within a promiseDocumentFlushed callback. Doing so will + * result in the outer Promise rejecting with InvalidStateError. + */ +add_task(async function test_reentrancy() { + dirtyStyleAndLayout(); + assertFlushesRequired(); + + let promise = window.promiseDocumentFlushed(() => { + return window.promiseDocumentFlushed(() => { + Assert.ok(false, "Should never run this."); + }); + }); + + await Assert.rejects(promise, ex => ex.name == "InvalidStateError"); +}); + +/** + * Tests the expected execution order of a series of promiseDocumentFlushed + * calls, their callbacks, and the resolutions of their Promises. + * + * When multiple promiseDocumentFlushed callbacks are queued, the callbacks + * should always been run first before any of the Promises are resolved. + * + * The callbacks should run in the order that they were queued in via + * promiseDocumentFlushed. The Promise resolutions should similarly run + * in the order that promiseDocumentFlushed was called in. + */ +add_task(async function test_execution_order() { + let result = []; + + dirtyStyleAndLayout(1); + let promise1 = window + .promiseDocumentFlushed(() => { + result.push(0); + }) + .then(() => { + result.push(2); + }); + + let promise2 = window + .promiseDocumentFlushed(() => { + result.push(1); + }) + .then(() => { + result.push(3); + }); + + await Promise.all([promise1, promise2]); + + Assert.equal(result.length, 4, "Should have run all callbacks and Promises."); + + let promise3 = window + .promiseDocumentFlushed(() => { + result.push(4); + }) + .then(() => { + result.push(6); + }); + + let promise4 = window + .promiseDocumentFlushed(() => { + result.push(5); + }) + .then(() => { + result.push(7); + }); + + await Promise.all([promise3, promise4]); + + Assert.equal(result.length, 8, "Should have run all callbacks and Promises."); + + for (let i = 0; i < result.length; ++i) { + Assert.equal( + result[i], + i, + "Callbacks and Promises should have run in the expected order." + ); + } + + await cleanTheDOM(); +}); + +/** + * Tests that modifying the DOM within a promiseDocumentFlushed callback + * will result in the Promise being rejected. + */ +add_task(async function test_reject_on_modification() { + dirtyStyleAndLayout(1); + assertFlushesRequired(); + + let promise = window.promiseDocumentFlushed(() => { + dirtyStyleAndLayout(2); + }); + + await Assert.rejects(promise, /NoModificationAllowedError/); + + await cleanTheDOM(); +}); diff --git a/dom/base/test/browser_refresh_content.js b/dom/base/test/browser_refresh_content.js new file mode 100644 index 0000000000..0ff61db423 --- /dev/null +++ b/dom/base/test/browser_refresh_content.js @@ -0,0 +1,127 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* + * Ensures resources can still be fetched without validation + */ + +const CONTENT_URL = + "http://www.example.com/browser/dom/base/test/file_browser_refresh_content.html"; + +async function run_test_browser_refresh(forceRevalidate) { + let tab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + url: CONTENT_URL, + waitForLoad: true, + /* Ensures each run is started with a fresh state */ + forceNewProcess: true, + }); + + let originalAttributes = await SpecialPowers.spawn( + tab.linkedBrowser, + [], + async () => { + let result = content.document.getElementById("result"); + await ContentTaskUtils.waitForCondition(() => { + return ( + result.getAttribute("imageDataURL") && + result.getAttribute("iframeContent") && + result.getAttribute("expiredResourceCacheControl") + ); + }); + return { + imageDataURL: result.getAttribute("imageDataURL"), + iframeContent: result.getAttribute("iframeContent"), + expiredResourceCacheControl: result.getAttribute( + "expiredResourceCacheControl" + ), + }; + } + ); + + let imageDataURL = originalAttributes.imageDataURL; + let expiredResourceCacheControl = + originalAttributes.expiredResourceCacheControl; + + is( + originalAttributes.iframeContent, + "first load", + "Iframe is loaded with the initial content" + ); + + tab.linkedBrowser.reload(); + + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + + let attributes = await SpecialPowers.spawn( + tab.linkedBrowser, + [], + async () => { + let result = content.document.getElementById("result"); + + await ContentTaskUtils.waitForCondition(() => { + return ( + result.getAttribute("imageDataURL") && + result.getAttribute("expiredResourceCacheControl") && + result.getAttribute("nonCacheableResourceCompleted") + ); + }); + + return { + iframeContent: result.getAttribute("iframeContent"), + imageDataURL: result.getAttribute("imageDataURL"), + expiredResourceCacheControl: result.getAttribute( + "expiredResourceCacheControl" + ), + nonCacheableResourceCompleted: result.getAttribute( + "nonCacheableResourceCompleted" + ), + }; + } + ); + + is( + attributes.iframeContent, + "second load", + "Iframe should always be revalidated" + ); + + if (!forceRevalidate) { + ok(attributes.imageDataURL === imageDataURL, "Image should use cache"); + } else { + ok(attributes.imageDataURL !== imageDataURL, "Image should be revalidated"); + } + + if (!forceRevalidate) { + ok( + attributes.expiredResourceCacheControl === expiredResourceCacheControl, + "max-age shouldn't be changed after reload because it didn't revalidate" + ); + } else { + ok( + attributes.expiredResourceCacheControl !== expiredResourceCacheControl, + "max-age should be changed after reload because it got revalidated" + ); + } + + is( + attributes.nonCacheableResourceCompleted, + "true", + "Non cacheable resource should still be loaded" + ); + + await BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_browser_refresh() { + Services.prefs.setBoolPref( + "browser.soft_reload.only_force_validate_top_level_document", + true + ); + await run_test_browser_refresh(false); + Services.prefs.setBoolPref( + "browser.soft_reload.only_force_validate_top_level_document", + false + ); + await run_test_browser_refresh(true); +}); diff --git a/dom/base/test/browser_state_notifications.js b/dom/base/test/browser_state_notifications.js new file mode 100644 index 0000000000..e2b600465b --- /dev/null +++ b/dom/base/test/browser_state_notifications.js @@ -0,0 +1,193 @@ +/* globals Components: true, Promise: true, gBrowser: true, Test: true, + info: true, is: true, window: true, waitForExplicitFinish: true, + finish: true, ok: true*/ + +"use strict"; + +const { addObserver, removeObserver } = Cc[ + "@mozilla.org/observer-service;1" +].getService(Ci.nsIObserverService); +const { openWindow } = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService( + Ci.nsIWindowWatcher +); + +const Test = routine => () => { + waitForExplicitFinish(); + routine().then(finish, error => { + ok(false, error); + finish(); + }); +}; + +// Returns promise for the observer notification subject for +// the given topic. If `receive("foo")` is called `n` times +// nth promise is resolved on an `nth` "foo" notification. +const receive = (topic, p, syncCallback) => { + return new Promise((resolve, reject) => { + const { queue } = receive; + const timeout = () => { + queue.splice(queue.indexOf(resolve) - 1, 2); + reject(new Error("Timeout")); + }; + + const observer = { + observe: subject => { + // Browser loads bunch of other documents that we don't care + // about so we let allow filtering notifications via `p` function. + if (p && !p(subject)) { + return; + } + // If observer is a first one with a given `topic` + // in a queue resolve promise and take it off the queue + // otherwise keep waiting. + const index = queue.indexOf(topic); + if (queue.indexOf(resolve) === index + 1) { + removeObserver(observer, topic); + clearTimeout(id, reject); + queue.splice(index, 2); + // Some tests need to be executed synchronously when the event is fired. + if (syncCallback) { + syncCallback(subject); + } + resolve(subject); + } + }, + }; + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + const id = setTimeout(timeout, 90000); + addObserver(observer, topic, false); + queue.push(topic, resolve); + }); +}; +receive.queue = []; + +const openTab = uri => + (gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, uri)); + +// eslint-disable-next-line mozilla/no-arbitrary-setTimeout +const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); + +const isData = document => document.URL.startsWith("data:"); + +const uri1 = "data:text/html;charset=utf-8,

1

"; +// For whatever reason going back on load event doesn't work so timeout it is :( +const uri2 = + "data:text/html;charset=utf-8,

2

"; +const uri3 = "data:text/html;charset=utf-8,

3

"; + +const uri4 = "chrome://browser/content/license.html"; + +const test = Test(async function () { + let documentInteractive = receive( + "content-document-interactive", + isData, + d => { + // This test is executed synchronously when the event is received. + is(d.readyState, "interactive", "document is interactive"); + is(d.URL, uri1, "document.URL matches tab url"); + } + ); + let documentLoaded = receive("content-document-loaded", isData); + let pageShown = receive("content-page-shown", isData); + + info("open: uri#1"); + const tab1 = openTab(uri1); + const browser1 = gBrowser.getBrowserForTab(tab1); + + let interactiveDocument1 = await documentInteractive; + + let loadedDocument1 = await documentLoaded; + is(loadedDocument1.readyState, "complete", "document is loaded"); + is(interactiveDocument1, loadedDocument1, "interactive document is loaded"); + + let shownPage = await pageShown; + is(interactiveDocument1, shownPage, "loaded document is shown"); + + // Wait until history entry is created before loading new uri. + await receive("sessionstore-state-write-complete"); + + info("load uri#2"); + + documentInteractive = receive("content-document-interactive", isData, d => { + // This test is executed synchronously when the event is received. + is(d.readyState, "interactive", "document is interactive"); + is(d.URL, uri2, "document.URL matches URL loaded"); + }); + documentLoaded = receive("content-document-loaded", isData); + pageShown = receive("content-page-shown", isData); + let pageHidden = receive("content-page-hidden", isData); + + BrowserTestUtils.loadURIString(browser1, uri2); + + let hiddenPage = await pageHidden; + is(interactiveDocument1, hiddenPage, "loaded document is hidden"); + + let interactiveDocument2 = await documentInteractive; + + let loadedDocument2 = await documentLoaded; + is(loadedDocument2.readyState, "complete", "document is loaded"); + is(interactiveDocument2, loadedDocument2, "interactive document is loaded"); + + shownPage = await pageShown; + is(interactiveDocument2, shownPage, "loaded document is shown"); + + info("go back to uri#1"); + + documentInteractive = receive("content-document-interactive", isData, d => { + // This test is executed synchronously when the event is received. + is(d.readyState, "interactive", "document is interactive"); + is(d.URL, uri3, "document.URL matches URL loaded"); + }); + documentLoaded = receive("content-document-loaded", isData); + pageShown = receive("content-page-shown", isData); + pageHidden = receive("content-page-hidden", isData); + + hiddenPage = await pageHidden; + is(interactiveDocument2, hiddenPage, "new document is hidden"); + + shownPage = await pageShown; + is(interactiveDocument1, shownPage, "previous document is shown"); + + info("load uri#3"); + + BrowserTestUtils.loadURIString(browser1, uri3); + + pageShown = receive("content-page-shown", isData); + + let interactiveDocument3 = await documentInteractive; + + let loadedDocument3 = await documentLoaded; + is(loadedDocument3.readyState, "complete", "document is loaded"); + is(interactiveDocument3, loadedDocument3, "interactive document is loaded"); + + shownPage = await pageShown; + is(interactiveDocument3, shownPage, "previous document is shown"); + + gBrowser.removeTab(tab1); + + info("load chrome uri"); + + const tab2 = openTab(uri4); + documentInteractive = receive("chrome-document-interactive", null, d => { + // This test is executed synchronously when the event is received. + is(d.readyState, "interactive", "document is interactive"); + is(d.URL, uri4, "document.URL matches URL loaded"); + }); + documentLoaded = receive("chrome-document-loaded"); + pageShown = receive("chrome-page-shown"); + + const interactiveDocument4 = await documentInteractive; + + let loadedDocument4 = await documentLoaded; + is(loadedDocument4.readyState, "complete", "document is loaded"); + is(interactiveDocument4, loadedDocument4, "interactive document is loaded"); + + shownPage = await pageShown; + is(interactiveDocument4, shownPage, "loaded chrome document is shown"); + + pageHidden = receive("chrome-page-hidden"); + gBrowser.removeTab(tab2); + + hiddenPage = await pageHidden; + is(interactiveDocument4, hiddenPage, "chrome document hidden"); +}); diff --git a/dom/base/test/browser_timeout_throttling_with_audio_playback.js b/dom/base/test/browser_timeout_throttling_with_audio_playback.js new file mode 100644 index 0000000000..89be64f656 --- /dev/null +++ b/dom/base/test/browser_timeout_throttling_with_audio_playback.js @@ -0,0 +1,73 @@ +// The tab closing code leaves an uncaught rejection. This test has been +// whitelisted until the issue is fixed. +if (!gMultiProcessBrowser) { + const { PromiseTestUtils } = ChromeUtils.importESModule( + "resource://testing-common/PromiseTestUtils.sys.mjs" + ); + PromiseTestUtils.expectUncaughtRejection(/is no longer, usable/); +} + +const kBaseURI = "http://mochi.test:8888/browser/dom/base/test/empty.html"; +var testURLs = [ + "http://mochi.test:8888/browser/dom/base/test/file_audioLoop.html", + "http://mochi.test:8888/browser/dom/base/test/file_audioLoopInIframe.html", + "http://mochi.test:8888/browser/dom/base/test/file_webaudio_startstop.html", +]; + +// We want to ensure that while audio is being played back, a background tab is +// treated the same as a foreground tab as far as timeout throttling is concerned. +// So we use a 100,000 second minimum timeout value for background tabs. This +// means that in case the test fails, it will time out in practice, but just for +// sanity the test condition ensures that the observed timeout delay falls in +// this range. +const kMinTimeoutBackground = 100 * 1000 * 1000; + +const kDelay = 10; + +async function runTest(url) { + let currentTab = gBrowser.selectedTab; + let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kBaseURI); + let newBrowser = gBrowser.getBrowserForTab(newTab); + + // Wait for the UI to indicate that audio is being played back. + let promise = BrowserTestUtils.waitForAttribute( + "soundplaying", + newTab, + "true" + ); + BrowserTestUtils.loadURIString(newBrowser, url); + await promise; + + // Put the tab in the background. + await BrowserTestUtils.switchTab(gBrowser, currentTab); + + let timeout = await SpecialPowers.spawn( + newBrowser, + [kDelay], + function (delay) { + return new Promise(resolve => { + let before = new Date(); + content.window.setTimeout(function () { + let after = new Date(); + resolve(after - before); + }, delay); + }); + } + ); + ok(timeout <= kMinTimeoutBackground, `Got the correct timeout (${timeout})`); + + // All done. + BrowserTestUtils.removeTab(newTab); +} + +add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["dom.min_background_timeout_value", kMinTimeoutBackground]], + }); +}); + +add_task(async function test() { + for (var url of testURLs) { + await runTest(url); + } +}); diff --git a/dom/base/test/browser_use_counters.js b/dom/base/test/browser_use_counters.js new file mode 100644 index 0000000000..b18d6aa06c --- /dev/null +++ b/dom/base/test/browser_use_counters.js @@ -0,0 +1,348 @@ +/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ + +requestLongerTimeout(2); + +const gHttpTestRoot = "https://example.com/browser/dom/base/test/"; + +/** + * Enable local telemetry recording for the duration of the tests. + */ +var gOldContentCanRecord = false; +var gOldParentCanRecord = false; +add_task(async function test_initialize() { + let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService( + Ci.nsITelemetry + ); + gOldParentCanRecord = Telemetry.canRecordExtended; + Telemetry.canRecordExtended = true; + + await SpecialPowers.pushPrefEnv({ + set: [ + // Because canRecordExtended is a per-process variable, we need to make sure + // that all of the pages load in the same content process. Limit the number + // of content processes to at most 1 (or 0 if e10s is off entirely). + ["dom.ipc.processCount", 1], + ["layout.css.use-counters.enabled", true], + ["layout.css.use-counters-unimplemented.enabled", true], + ], + }); + + gOldContentCanRecord = await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [], + function () { + let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService( + Ci.nsITelemetry + ); + let old = telemetry.canRecordExtended; + telemetry.canRecordExtended = true; + return old; + } + ); + info("canRecord for content: " + gOldContentCanRecord); +}); + +add_task(async function () { + const TESTS = [ + // Check that use counters are incremented by SVGs loaded directly in iframes. + { + type: "iframe", + filename: "file_use_counter_svg_getElementById.svg", + counters: [{ name: "SVGSVGELEMENT_GETELEMENTBYID" }], + }, + { + type: "iframe", + filename: "file_use_counter_svg_currentScale.svg", + counters: [ + { name: "SVGSVGELEMENT_CURRENTSCALE_getter" }, + { name: "SVGSVGELEMENT_CURRENTSCALE_setter" }, + ], + }, + + { + type: "iframe", + filename: "file_use_counter_style.html", + counters: [ + // Check for longhands. + { name: "CSS_PROPERTY_BackgroundImage" }, + // Check for shorthands. + { name: "CSS_PROPERTY_Padding" }, + // Check for aliases. + { name: "CSS_PROPERTY_MozTransform" }, + // Check for counted unknown properties. + { name: "CSS_PROPERTY_WebkitPaddingStart" }, + ], + }, + + // Check that even loads from the imglib cache update use counters. The + // images should still be there, because we just loaded them in the last + // set of tests. But we won't get updated counts for the document + // counters, because we won't be re-parsing the SVG documents. + { + type: "iframe", + filename: "file_use_counter_svg_getElementById.svg", + counters: [{ name: "SVGSVGELEMENT_GETELEMENTBYID" }], + check_documents: false, + }, + { + type: "iframe", + filename: "file_use_counter_svg_currentScale.svg", + counters: [ + { name: "SVGSVGELEMENT_CURRENTSCALE_getter" }, + { name: "SVGSVGELEMENT_CURRENTSCALE_setter" }, + ], + check_documents: false, + }, + + // Check that use counters are incremented by SVGs loaded as images. + // Note that SVG images are not permitted to execute script, so we can only + // check for properties here. + { + type: "img", + filename: "file_use_counter_svg_getElementById.svg", + counters: [{ name: "CSS_PROPERTY_Fill" }], + }, + { + type: "img", + filename: "file_use_counter_svg_currentScale.svg", + counters: [{ name: "CSS_PROPERTY_Fill" }], + }, + + // Check that use counters are incremented by directly loading SVGs + // that reference patterns defined in another SVG file. + { + type: "direct", + filename: "file_use_counter_svg_fill_pattern.svg", + counters: [{ name: "CSS_PROPERTY_FillOpacity", xfail: true }], + }, + + // Check that use counters are incremented by directly loading SVGs + // that reference patterns defined in the same file or in data: URLs. + { + type: "direct", + filename: "file_use_counter_svg_fill_pattern_internal.svg", + counters: [{ name: "CSS_PROPERTY_FillOpacity" }], + }, + + // Check that use counters are incremented in a display:none iframe. + { + type: "undisplayed-iframe", + filename: "file_use_counter_svg_currentScale.svg", + counters: [{ name: "SVGSVGELEMENT_CURRENTSCALE_getter" }], + }, + + // Check that a document that comes out of the bfcache reports any new use + // counters recorded on it. + { + type: "direct", + filename: "file_use_counter_bfcache.html", + waitForExplicitFinish: true, + counters: [{ name: "SVGSVGELEMENT_GETELEMENTBYID" }], + }, + + // // data: URLs don't correctly propagate to their referring document yet. + // { + // type: "direct", + // filename: "file_use_counter_svg_fill_pattern_data.svg", + // counters: [ + // { name: "PROPERTY_FILL_OPACITY" }, + // ], + // }, + ]; + + for (let test of TESTS) { + let file = test.filename; + info(`checking ${file} (${test.type})`); + + let newTab = BrowserTestUtils.addTab(gBrowser, "about:blank"); + gBrowser.selectedTab = newTab; + newTab.linkedBrowser.stop(); + + // Hold on to the current values of the telemetry histograms we're + // interested in. + let before = await grabHistogramsFromContent( + test.counters.map(c => c.name) + ); + + // Load the test file in the new tab, either directly or via + // file_use_counter_outer{,_display_none}.html, depending on the test type. + let url, targetElement; + switch (test.type) { + case "iframe": + url = gHttpTestRoot + "file_use_counter_outer.html"; + targetElement = "content"; + break; + case "undisplayed-iframe": + url = gHttpTestRoot + "file_use_counter_outer_display_none.html"; + targetElement = "content"; + break; + case "img": + url = gHttpTestRoot + "file_use_counter_outer.html"; + targetElement = "display"; + break; + case "direct": + url = gHttpTestRoot + file; + targetElement = null; + break; + default: + throw `unexpected type ${test.type}`; + } + + BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url); + await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + + if (test.waitForExplicitFinish) { + if (test.type != "direct") { + throw new Error( + `cannot use waitForExplicitFinish with test type ${test.type}` + ); + } + + // Wait until the tab changes its hash to indicate it has finished. + await BrowserTestUtils.waitForLocationChange(gBrowser, url + "#finished"); + } + + if (targetElement) { + // Inject our desired file into the target element of the newly-loaded page. + await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [{ file, targetElement }], + function (opts) { + let target = content.document.getElementById(opts.targetElement); + target.src = opts.file; + + return new Promise(resolve => { + let listener = event => { + event.target.removeEventListener("load", listener, true); + resolve(); + }; + target.addEventListener("load", listener, true); + }); + } + ); + } + + // Tear down the page. + let tabClosed = BrowserTestUtils.waitForTabClosing(newTab); + gBrowser.removeTab(newTab); + await tabClosed; + + // Grab histograms again. + let after = await grabHistogramsFromContent( + test.counters.map(c => c.name), + before.sentinel + ); + + // Compare before and after. + for (let counter of test.counters) { + let name = counter.name; + let value = counter.value ?? 1; + if (!counter.xfail) { + is( + after.page[name], + before.page[name] + value, + `page counts for ${name} after are correct` + ); + is( + after.document[name], + before.document[name] + value, + `document counts for ${name} after are correct` + ); + } + } + + if (test.check_documents ?? true) { + ok( + after.toplevel_docs >= before.toplevel_docs + 1, + "top level destroyed document counts are correct" + ); + // 2 documents for "img" tests: one for the outer html page containing the + // element, and one for the SVG image itself. + ok( + after.docs >= before.docs + (test.type == "img" ? 2 : 1), + "destroyed document counts are correct" + ); + } + } +}); + +add_task(async function () { + let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService( + Ci.nsITelemetry + ); + Telemetry.canRecordExtended = gOldParentCanRecord; + + await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [{ oldCanRecord: gOldContentCanRecord }], + async function (arg) { + await new Promise(resolve => { + let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService( + Ci.nsITelemetry + ); + telemetry.canRecordExtended = arg.oldCanRecord; + resolve(); + }); + } + ); +}); + +async function grabHistogramsFromContent(names, prev_sentinel = null) { + // We don't have any way to get a notification when telemetry from the + // document that was just closed has been reported. So instead, we + // repeatedly poll for telemetry until we see that a specific use counter + // histogram (CSS_PROPERTY_MarkerMid, the "sentinel") that likely is not + // used by any other document that's open has been incremented. + let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService( + Ci.nsITelemetry + ); + let gatheredHistograms; + return BrowserTestUtils.waitForCondition( + function () { + // Document use counters are reported in the content process (when e10s + // is enabled), and page use counters are reported in the parent process. + let snapshots = telemetry.getSnapshotForHistograms("main", false); + let checkGet = probe => { + // When e10s is disabled, all histograms are reported in the parent + // process. Otherwise, all page use counters are reported in the parent + // and document use counters are reported in the content process. + let process = + !Services.appinfo.browserTabsRemoteAutostart || + probe.endsWith("_PAGE") || + probe == "TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED" + ? "parent" + : "content"; + return snapshots[process][probe] ? snapshots[process][probe].sum : 0; + }; + let page = Object.fromEntries( + names.map(name => [name, checkGet(`USE_COUNTER2_${name}_PAGE`)]) + ); + let document = Object.fromEntries( + names.map(name => [name, checkGet(`USE_COUNTER2_${name}_DOCUMENT`)]) + ); + gatheredHistograms = { + page, + document, + docs: checkGet("CONTENT_DOCUMENTS_DESTROYED"), + toplevel_docs: checkGet("TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED"), + sentinel: { + doc: checkGet("USE_COUNTER2_CSS_PROPERTY_MarkerMid_DOCUMENT"), + page: checkGet("USE_COUNTER2_CSS_PROPERTY_MarkerMid_PAGE"), + }, + }; + let sentinelChanged = + !prev_sentinel || + (prev_sentinel.doc != gatheredHistograms.sentinel.doc && + prev_sentinel.page != gatheredHistograms.sentinel.page); + return sentinelChanged; + }, + "grabHistogramsFromContent", + 100, + Infinity + ).then( + () => gatheredHistograms, + function (msg) { + throw msg; + } + ); +} diff --git a/dom/base/test/browser_user_input_handling_delay.js b/dom/base/test/browser_user_input_handling_delay.js new file mode 100644 index 0000000000..ccd3369c34 --- /dev/null +++ b/dom/base/test/browser_user_input_handling_delay.js @@ -0,0 +1,82 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +async function test_user_input_handling_delay_helper(prefs) { + await SpecialPowers.pushPrefEnv({ + set: prefs, + }); + + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + `data:text/html,` + ); + + let canHandleInput = false; + let mouseDownPromise = BrowserTestUtils.waitForContentEvent( + tab.linkedBrowser, + "mousedown" + ).then(function () { + Assert.ok( + canHandleInput, + "This promise should be resolved after the 5 seconds mark has passed" + ); + }); + + for (let i = 0; i < 10; ++i) { + await BrowserTestUtils.synthesizeMouseAtPoint( + 10, + 10, + { type: "mousedown" }, + tab.linkedBrowser + ); + } + // Wait for roughly 5 seconds to give chances for the + // above mousedown event to be handled. + await SpecialPowers.spawn(tab.linkedBrowser, [], async () => { + for (let i = 0; i < 330; ++i) { + await new Promise(r => { + content.requestAnimationFrame(r); + }); + } + }); + + // If any user input events were handled in the above 5 seconds + // the mouseDownPromise would be resolved with canHandleInput = false, + // so that the test would fail. + canHandleInput = true; + + // Ensure the events can be handled eventually + await BrowserTestUtils.synthesizeMouseAtPoint( + 10, + 10, + { type: "mousedown" }, + tab.linkedBrowser + ); + + await mouseDownPromise; + + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_MinRAF() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 100], + ["dom.input_events.security.minTimeElapsedInMS", 0], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_helper(prefs); +}); + +add_task(async function test_MinElapsedTime() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 0], + ["dom.input_events.security.minTimeElapsedInMS", 5000], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_helper(prefs); +}); diff --git a/dom/base/test/browser_user_input_handling_delay_aboutblank.js b/dom/base/test/browser_user_input_handling_delay_aboutblank.js new file mode 100644 index 0000000000..c49a9bf7ed --- /dev/null +++ b/dom/base/test/browser_user_input_handling_delay_aboutblank.js @@ -0,0 +1,58 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +async function test_user_input_handling_delay_aboutblank_helper(prefs) { + await SpecialPowers.pushPrefEnv({ + set: prefs, + }); + + let newTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:blank"); + + await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () { + // Open about:blank + content.window.open(); + }); + + const tab = await newTabOpened; + + let mouseDownPromise = BrowserTestUtils.waitForContentEvent( + tab.linkedBrowser, + "mousedown" + ).then(function () { + Assert.ok(true, "about:blank can handle user input events anytime"); + }); + + // Now gBrowser.selectedBrowser is the newly opened about:blank + await BrowserTestUtils.synthesizeMouseAtPoint( + 10, + 10, + { type: "mousedown" }, + tab.linkedBrowser + ); + + await mouseDownPromise; + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_MinRAF_aboutblank() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 100], + ["dom.input_events.security.minTimeElapsedInMS", 0], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_aboutblank_helper(prefs); +}); + +add_task(async function test_MinElapsedTime_aboutblank() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 0], + ["dom.input_events.security.minTimeElapsedInMS", 5000], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_aboutblank_helper(prefs); +}); diff --git a/dom/base/test/browser_user_input_handling_delay_bfcache.js b/dom/base/test/browser_user_input_handling_delay_bfcache.js new file mode 100644 index 0000000000..826f4340c5 --- /dev/null +++ b/dom/base/test/browser_user_input_handling_delay_bfcache.js @@ -0,0 +1,107 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +async function test_user_input_handling_delay_BFCache_helper(prefs) { + await SpecialPowers.pushPrefEnv({ + set: prefs, + }); + + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + `data:text/html,`, + true + ); + + let switchAwayPromise = BrowserTestUtils.browserLoaded( + browser, + false, + "about:blank" + ); + // Navigate away to make the page enters BFCache + await SpecialPowers.spawn(tab.linkedBrowser, [], () => { + content.location = "about:blank"; + }); + await switchAwayPromise; + + // Navigate back to restore the page from BFCache + let pageShownPromise = BrowserTestUtils.waitForContentEvent( + tab.linkedBrowser, + "pageshow", + true + ); + + await SpecialPowers.spawn(tab.linkedBrowser, [], () => { + content.history.back(); + }); + + await pageShownPromise; + + let canHandleInput = false; + let mouseDownPromise = BrowserTestUtils.waitForContentEvent( + tab.linkedBrowser, + "mousedown" + ).then(function () { + Assert.ok( + canHandleInput, + "This promise should be resolved after the 5 seconds mark has passed" + ); + }); + // Ensure the events are discarded initially + for (let i = 0; i < 10; ++i) { + await BrowserTestUtils.synthesizeMouseAtPoint( + 10, + 10, + { type: "mousedown" }, + tab.linkedBrowser + ); + } + + // Wait for roughly 5 seconds to give chances for the + // above mousedown event to be handled. + await SpecialPowers.spawn(tab.linkedBrowser, [], async () => { + for (let i = 0; i < 330; ++i) { + await new Promise(r => { + content.requestAnimationFrame(r); + }); + } + }); + + // If any user input events were handled in the above 5 seconds + // the mouseDownPromise would be resolved with canHandleInput = false, + // so that the test would fail. + canHandleInput = true; + + // Ensure the events can be handled eventually + await BrowserTestUtils.synthesizeMouseAtPoint( + 10, + 10, + { type: "mousedown" }, + tab.linkedBrowser + ); + + await mouseDownPromise; + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_MinRAF_BFCache() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 100], + ["dom.input_events.security.minTimeElapsedInMS", 0], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_BFCache_helper(prefs); +}); + +add_task(async function test_MinElapsedTime_BFCache() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 0], + ["dom.input_events.security.minTimeElapsedInMS", 5000], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_BFCache_helper(prefs); +}); diff --git a/dom/base/test/browser_user_input_handling_delay_invisible_iframe.js b/dom/base/test/browser_user_input_handling_delay_invisible_iframe.js new file mode 100644 index 0000000000..8227a09a08 --- /dev/null +++ b/dom/base/test/browser_user_input_handling_delay_invisible_iframe.js @@ -0,0 +1,78 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +async function test_user_input_handling_delay_helper(prefs) { + await SpecialPowers.pushPrefEnv({ + set: prefs, + }); + + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + ` + data:text/html, + + + + ` + ); + + await BrowserTestUtils.reloadTab(tab); + + let iframeFocused = SpecialPowers.spawn( + tab.linkedBrowser, + [], + async function () { + let iframe = content.document.querySelector("iframe"); + await ContentTaskUtils.waitForCondition(function () { + return content.document.activeElement == iframe; + }); + } + ); + + // Now the focus moves to the cross origin iframe + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + content.document.querySelector("iframe").focus(); + }); + + await iframeFocused; + + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(r => setTimeout(r, 1000)); + + const inputGetFocused = SpecialPowers.spawn( + tab.linkedBrowser, + [], + async function () { + await ContentTaskUtils.waitForEvent( + content.document.querySelector("input"), + "focus" + ); + } + ).then(function () { + Assert.ok( + true, + "Invisible OOP iframe shouldn't prevent user input event handling" + ); + }); + + let iframeBC = tab.linkedBrowser.browsingContext.children[0]; + // Next tab key should move the focus from the iframe to link + await BrowserTestUtils.synthesizeKey("KEY_Tab", {}, iframeBC); + + await inputGetFocused; + + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_InvisibleIframe() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 3], + ["dom.input_events.security.minTimeElapsedInMS", 0], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_helper(prefs); +}); diff --git a/dom/base/test/browser_user_input_handling_delay_reload_ticks.js b/dom/base/test/browser_user_input_handling_delay_reload_ticks.js new file mode 100644 index 0000000000..8afc7f16bb --- /dev/null +++ b/dom/base/test/browser_user_input_handling_delay_reload_ticks.js @@ -0,0 +1,54 @@ +/* -*- Mode: JavaScript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +async function test_user_input_handling_delay_helper(prefs) { + await SpecialPowers.pushPrefEnv({ + set: prefs, + }); + + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + `data:text/html,` + ); + + await BrowserTestUtils.reloadTab(tab); + + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(r => setTimeout(r, 5000)); + + const userInputHappend = SpecialPowers.spawn( + tab.linkedBrowser, + [], + async function () { + await ContentTaskUtils.waitForEvent(content, "keydown"); + } + ).then(function () { + Assert.ok( + true, + "User input event should be able to work after 5 seconds of an reload" + ); + }); + + // In the buggy build, the following tab key doesn't work + await BrowserTestUtils.synthesizeKey("KEY_Tab", {}, tab.linkedBrowser); + await BrowserTestUtils.synthesizeKey("KEY_Tab", {}, tab.linkedBrowser); + await BrowserTestUtils.synthesizeKey("KEY_Tab", {}, tab.linkedBrowser); + await BrowserTestUtils.synthesizeKey("KEY_Tab", {}, tab.linkedBrowser); + + await userInputHappend; + + BrowserTestUtils.removeTab(tab); +} + +add_task(async function test_MinTick() { + const prefs = [ + ["dom.input_events.security.minNumTicks", 10], + ["dom.input_events.security.minTimeElapsedInMS", 0], + ["dom.input_events.security.isUserInputHandlingDelayTest", true], + ]; + + await test_user_input_handling_delay_helper(prefs); +}); diff --git a/dom/base/test/browser_xml_toggle.js b/dom/base/test/browser_xml_toggle.js new file mode 100644 index 0000000000..477db038b1 --- /dev/null +++ b/dom/base/test/browser_xml_toggle.js @@ -0,0 +1,24 @@ +const URL = `data:text/xml, + + + Tove + Jani + Reminder + Don't forget me this weekend! + +`; + +add_task(async function xml_pretty_print_toggle() { + await BrowserTestUtils.withNewTab(URL, async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + let summary = + content.document.documentElement.openOrClosedShadowRoot.querySelector( + "summary" + ); + let details = summary.parentNode; + ok(details.open, "Should be open"); + summary.click(); + ok(!details.open, "Should be closed"); + }); + }); +}); diff --git a/dom/base/test/bug1576154.sjs b/dom/base/test/bug1576154.sjs new file mode 100644 index 0000000000..d18151a8b4 --- /dev/null +++ b/dom/base/test/bug1576154.sjs @@ -0,0 +1,8 @@ +function handleRequest(request, response) { + response.setStatusLine("1.1", 500, "Internal Server Error"); + response.setHeader("Content-Type", "image/svg+xml", false); + + let body = + ""; + response.bodyOutputStream.write(body, body.length); +} diff --git a/dom/base/test/bug1739957.sjs b/dom/base/test/bug1739957.sjs new file mode 100644 index 0000000000..38f5e72040 --- /dev/null +++ b/dom/base/test/bug1739957.sjs @@ -0,0 +1,10 @@ +function handleRequest(request, response) { + if (request.queryString == "loaded") { + response.write(getState("loaded") || "false"); + return; + } + + setState("loaded", "true"); + response.setHeader("Content-Type", "image/svg+xml", false); + response.write(``); +} diff --git a/dom/base/test/bug282547.sjs b/dom/base/test/bug282547.sjs new file mode 100644 index 0000000000..a57a176038 --- /dev/null +++ b/dom/base/test/bug282547.sjs @@ -0,0 +1,8 @@ +function handleRequest(request, response) { + response.setStatusLine(null, 401, "Unauthorized"); + + response.setHeader("WWW-Authenticate", 'basic realm="restricted"', false); + + response.setHeader("Access-Control-Allow-Origin", "*", false); + response.setHeader("Access-Control-Allow-Credentials", "true", false); +} diff --git a/dom/base/test/bug298064-subframe.html b/dom/base/test/bug298064-subframe.html new file mode 100644 index 0000000000..af497f5905 --- /dev/null +++ b/dom/base/test/bug298064-subframe.html @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/dom/base/test/bug313646.txt b/dom/base/test/bug313646.txt new file mode 100644 index 0000000000..150f5ea6d1 --- /dev/null +++ b/dom/base/test/bug313646.txt @@ -0,0 +1 @@ +Nothing to see here. Just need to request this file via XHR. diff --git a/dom/base/test/bug382113_object.html b/dom/base/test/bug382113_object.html new file mode 100644 index 0000000000..935f00afd1 --- /dev/null +++ b/dom/base/test/bug382113_object.html @@ -0,0 +1,6 @@ + + + +

A Document in an <object>

+ + diff --git a/dom/base/test/bug403852_fileOpener.js b/dom/base/test/bug403852_fileOpener.js new file mode 100644 index 0000000000..b35fa8fbcf --- /dev/null +++ b/dom/base/test/bug403852_fileOpener.js @@ -0,0 +1,24 @@ +/* eslint-env mozilla/chrome-script */ + +Cu.importGlobalProperties(["File"]); + +var testFile = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIDirectoryService) + .QueryInterface(Ci.nsIProperties) + .get("ProfD", Ci.nsIFile); +testFile.append("prefs.js"); + +addMessageListener("file.open", function () { + File.createFromNsIFile(testFile).then(function (file) { + File.createFromNsIFile(testFile, { lastModified: 123 }).then(function ( + fileWithDate + ) { + sendAsyncMessage("file.opened", { + file, + mtime: testFile.lastModifiedTime, + fileWithDate, + fileDate: 123, + }); + }); + }); +}); diff --git a/dom/base/test/bug419132.html b/dom/base/test/bug419132.html new file mode 100644 index 0000000000..ab2934c2d4 --- /dev/null +++ b/dom/base/test/bug419132.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/dom/base/test/bug426308-redirect.sjs b/dom/base/test/bug426308-redirect.sjs new file mode 100644 index 0000000000..331f31d96a --- /dev/null +++ b/dom/base/test/bug426308-redirect.sjs @@ -0,0 +1,4 @@ +function handleRequest(request, response) { + response.setStatusLine(null, 302, "Found"); + response.setHeader("Location", request.queryString, false); +} diff --git a/dom/base/test/bug435425.sjs b/dom/base/test/bug435425.sjs new file mode 100644 index 0000000000..0e3ef38419 --- /dev/null +++ b/dom/base/test/bug435425.sjs @@ -0,0 +1,25 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC( + "@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream" +); + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain", false); + if (request.method == "GET") { + response.write(request.queryString); + } else { + var body = new BinaryInputStream(request.bodyInputStream); + + var avail; + var bytes = []; + + while ((avail = body.available()) > 0) { + Array.prototype.push.apply(bytes, body.readByteArray(avail)); + } + + var data = String.fromCharCode.apply(null, bytes); + response.bodyOutputStream.write(data, data.length); + } +} diff --git a/dom/base/test/bug435425_redirect.sjs b/dom/base/test/bug435425_redirect.sjs new file mode 100644 index 0000000000..14fec62331 --- /dev/null +++ b/dom/base/test/bug435425_redirect.sjs @@ -0,0 +1,4 @@ +function handleRequest(request, response) { + response.setStatusLine(null, 302, "Moved"); + response.setHeader("Location", "http://nosuchdomain.localhost", false); +} diff --git a/dom/base/test/bug444322.js b/dom/base/test/bug444322.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dom/base/test/bug444322.txt b/dom/base/test/bug444322.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dom/base/test/bug444546.sjs b/dom/base/test/bug444546.sjs new file mode 100644 index 0000000000..5861eeb25c --- /dev/null +++ b/dom/base/test/bug444546.sjs @@ -0,0 +1,21 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC( + "@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream" +); + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain", false); + + var body = new BinaryInputStream(request.bodyInputStream); + + var avail; + var bytes = []; + while ((avail = body.available()) > 0) { + Array.prototype.push.apply(bytes, body.readByteArray(avail)); + } + + var data = String.fromCharCode.apply(null, bytes); + response.bodyOutputStream.write(data, data.length); +} diff --git a/dom/base/test/bug455629-helper.svg b/dom/base/test/bug455629-helper.svg new file mode 100644 index 0000000000..38098585ed --- /dev/null +++ b/dom/base/test/bug455629-helper.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/dom/base/test/bug457746.sjs b/dom/base/test/bug457746.sjs new file mode 100644 index 0000000000..caa4433cde --- /dev/null +++ b/dom/base/test/bug457746.sjs @@ -0,0 +1,10 @@ +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain; charset=ISO-8859-1", false); + const body = [0xc1]; + var bos = Components.classes[ + "@mozilla.org/binaryoutputstream;1" + ].createInstance(Components.interfaces.nsIBinaryOutputStream); + bos.setOutputStream(response.bodyOutputStream); + + bos.writeByteArray(body); +} diff --git a/dom/base/test/bug461735-post-redirect.js b/dom/base/test/bug461735-post-redirect.js new file mode 100644 index 0000000000..950948e4c9 --- /dev/null +++ b/dom/base/test/bug461735-post-redirect.js @@ -0,0 +1,3 @@ +var a = 0; +var b = 0; +c(); diff --git a/dom/base/test/bug461735-redirect1.sjs b/dom/base/test/bug461735-redirect1.sjs new file mode 100644 index 0000000000..cf00e8b8c4 --- /dev/null +++ b/dom/base/test/bug461735-redirect1.sjs @@ -0,0 +1,8 @@ +function handleRequest(request, response) { + response.setStatusLine(null, 302, "Found"); + response.setHeader( + "Location", + "http://example.com/tests/dom/base/test/bug461735-post-redirect.js", + false + ); +} diff --git a/dom/base/test/bug461735-redirect2.sjs b/dom/base/test/bug461735-redirect2.sjs new file mode 100644 index 0000000000..416882003c --- /dev/null +++ b/dom/base/test/bug461735-redirect2.sjs @@ -0,0 +1,8 @@ +function handleRequest(request, response) { + response.setStatusLine(null, 302, "Found"); + response.setHeader( + "Location", + "http://mochi.test:8888/tests/dom/base/test/bug461735-post-redirect.js", + false + ); +} diff --git a/dom/base/test/bug466080.sjs b/dom/base/test/bug466080.sjs new file mode 100644 index 0000000000..df3687000b --- /dev/null +++ b/dom/base/test/bug466080.sjs @@ -0,0 +1,14 @@ +function handleRequest(request, response) { + var body = "loaded"; + var origin = "localhost"; + try { + var origin = request.getHeader("Origin"); + } catch (e) {} + + response.setHeader("Access-Control-Allow-Origin", origin, false); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + response.setHeader("Access-Control-Allow-Methods", "XMETHOD", false); + response.setHeader("Connection", "Keep-alive", false); + + response.bodyOutputStream.write(body, body.length); +} diff --git a/dom/base/test/bug466409-empty.css b/dom/base/test/bug466409-empty.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dom/base/test/bug466409-page.html b/dom/base/test/bug466409-page.html new file mode 100644 index 0000000000..69ce7c2272 --- /dev/null +++ b/dom/base/test/bug466409-page.html @@ -0,0 +1,12 @@ + + + + Bug + + + +© + + diff --git a/dom/base/test/bug475156.sjs b/dom/base/test/bug475156.sjs new file mode 100644 index 0000000000..9c54b69f65 --- /dev/null +++ b/dom/base/test/bug475156.sjs @@ -0,0 +1,23 @@ +function handleRequest(request, response) { + if (request.queryString == "") { + var etag = request.hasHeader("If-Match") + ? request.getHeader("If-Match") + : null; + if (!etag || etag == getState("etag")) { + response.setStatusLine(request.httpVersion, 200, "Ok"); + response.setHeader("Content-Type", "text/html"); + response.setHeader("ETag", getState("etag")); + response.setHeader("Cache-control", "max-age=36000"); + response.write(getState("etag")); + } else if (etag) { + response.setStatusLine(request.httpVersion, 412, "Precondition Failed"); + } + } else { + var etag = request.queryString.match(/^etag=(.*)$/); + if (etag) { + setState("etag", etag[1]); + } + + response.setStatusLine(request.httpVersion, 204, "No content"); + } +} diff --git a/dom/base/test/bug482935.sjs b/dom/base/test/bug482935.sjs new file mode 100644 index 0000000000..b480c40e41 --- /dev/null +++ b/dom/base/test/bug482935.sjs @@ -0,0 +1,12 @@ +function handleRequest(request, response) { + var body = "initial"; + + try { + body = request.getHeader("X-Request"); + } catch (e) { + body = "request.getHeader() failed! Exception: " + e; + } + + response.setHeader("Cache-Control", "max-age=3600"); + response.bodyOutputStream.write(body, body.length); +} diff --git a/dom/base/test/bug540854.sjs b/dom/base/test/bug540854.sjs new file mode 100644 index 0000000000..5861eeb25c --- /dev/null +++ b/dom/base/test/bug540854.sjs @@ -0,0 +1,21 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC( + "@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream" +); + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain", false); + + var body = new BinaryInputStream(request.bodyInputStream); + + var avail; + var bytes = []; + while ((avail = body.available()) > 0) { + Array.prototype.push.apply(bytes, body.readByteArray(avail)); + } + + var data = String.fromCharCode.apply(null, bytes); + response.bodyOutputStream.write(data, data.length); +} diff --git a/dom/base/test/bug578096LoadChromeScript.js b/dom/base/test/bug578096LoadChromeScript.js new file mode 100644 index 0000000000..443fc34253 --- /dev/null +++ b/dom/base/test/bug578096LoadChromeScript.js @@ -0,0 +1,20 @@ +/* eslint-env mozilla/chrome-script */ + +var file; +Cu.importGlobalProperties(["File"]); + +addMessageListener("file.create", function (message) { + file = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIProperties) + .get("TmpD", Ci.nsIFile); + file.append("foo.txt"); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); + File.createFromNsIFile(file).then(function (domFile) { + sendAsyncMessage("file.created", domFile); + }); +}); + +addMessageListener("file.remove", function (message) { + file.remove(false); + sendAsyncMessage("file.removed", {}); +}); diff --git a/dom/base/test/bug638112-response.txt b/dom/base/test/bug638112-response.txt new file mode 100644 index 0000000000..9ce788da79 Binary files /dev/null and b/dom/base/test/bug638112-response.txt differ diff --git a/dom/base/test/bug638112.sjs b/dom/base/test/bug638112.sjs new file mode 100644 index 0000000000..3fb6fb90f0 --- /dev/null +++ b/dom/base/test/bug638112.sjs @@ -0,0 +1,24 @@ +function getInputStream(path) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + var fis = Components.classes[ + "@mozilla.org/network/file-input-stream;1" + ].createInstance(Components.interfaces.nsIFileInputStream); + var split = path.split("/"); + for (var i = 0; i < split.length; ++i) { + file.append(split[i]); + } + fis.init(file, -1, -1, false); + return fis; +} + +function handleRequest(request, response) { + var inputStream = getInputStream( + "tests/dom/base/test/bug638112-response.txt" + ); + response.seizePower(); + response.bodyOutputStream.writeFrom(inputStream, inputStream.available()); + response.finish(); + inputStream.close(); +} diff --git a/dom/base/test/bug696301-script-1.js b/dom/base/test/bug696301-script-1.js new file mode 100644 index 0000000000..98577364df --- /dev/null +++ b/dom/base/test/bug696301-script-1.js @@ -0,0 +1,3 @@ +var a = 0; +var global = "ran"; +c(); diff --git a/dom/base/test/bug696301-script-1.js^headers^ b/dom/base/test/bug696301-script-1.js^headers^ new file mode 100644 index 0000000000..cb762eff80 --- /dev/null +++ b/dom/base/test/bug696301-script-1.js^headers^ @@ -0,0 +1 @@ +Access-Control-Allow-Origin: * diff --git a/dom/base/test/bug696301-script-2.js b/dom/base/test/bug696301-script-2.js new file mode 100644 index 0000000000..98577364df --- /dev/null +++ b/dom/base/test/bug696301-script-2.js @@ -0,0 +1,3 @@ +var a = 0; +var global = "ran"; +c(); diff --git a/dom/base/test/bug704320.sjs b/dom/base/test/bug704320.sjs new file mode 100644 index 0000000000..f63b5d3a7e --- /dev/null +++ b/dom/base/test/bug704320.sjs @@ -0,0 +1,396 @@ +var BASE_URL = "example.com/tests/dom/base/test/bug704320.sjs"; + +function createTestUrl(schemeFrom, schemeTo, policy, action, type) { + return ( + schemeTo + + "://" + + BASE_URL + + "?" + + "action=" + + action + + "&" + + "scheme=" + + schemeFrom + + "-to-" + + schemeTo + + "&" + + "policy=" + + policy + + "&" + + "type=" + + type + ); +} + +function create2ndLevelIframeUrl(schemeFrom, schemeTo, policy, type) { + return ( + schemeFrom + + "://" + + BASE_URL + + "?" + + "action=create-2nd-level-iframe&" + + "scheme-from=" + + schemeFrom + + "&" + + "scheme-to=" + + schemeTo + + "&" + + "policy=" + + policy + + "&" + + "type=" + + type + ); +} + +// Creates the following test cases for the specified scheme and referrer +// policy combination: +// +// @import +// font-face +// bg-url +// \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + ' + ); +} + +function createIframedFormTest(schemeFrom, schemeTo, policy) { + var actionUrl = schemeTo + "://" + BASE_URL; + + return ( + '\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +
\n\ + \n\ + \n\ + \n\ + \n\ +
\n\ + \n\ + \n\ + ' + ); +} + +function createIframedWindowLocationTest(schemeFrom, schemeTo, policy) { + var url = createTestUrl( + schemeFrom, + schemeTo, + policy, + "test", + "window.location" + ); + + return ( + '\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + ' + ); +} + +function createPolicyTest(policy, optionalEarlierPolicy) { + var metaReferrerPolicyString = ""; + if (optionalEarlierPolicy && optionalEarlierPolicy != "") { + metaReferrerPolicyString += + '\n'; + } + metaReferrerPolicyString += ''; + + return ( + "\n\ + \n\ + \n\ + " + + metaReferrerPolicyString + + '\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + ' + ); +} + +function handleRequest(request, response) { + var sharedKey = "bug704320.sjs"; + var params = request.queryString.split("&"); + var action = params[0].split("=")[1]; + + if (action === "create-1st-level-iframe") { + // ?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin + var schemeFrom = params[1].split("=")[1]; + var schemeTo = params[2].split("=")[1]; + var policy = params[3].split("=")[1]; + var optionalEarlierPolicy = ""; + if (params[4]) { + optionalEarlierPolicy = params[4].split("=")[1]; + } + + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + response.setHeader("Cache-Control", "no-cache", false); + response.write( + createTest(schemeFrom, schemeTo, policy, optionalEarlierPolicy) + ); + } else if (action === "create-2nd-level-iframe") { + // ?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=origin&type=form" + var schemeFrom = params[1].split("=")[1]; + var schemeTo = params[2].split("=")[1]; + var policy = params[3].split("=")[1]; + var type = params[4].split("=")[1]; + + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + response.setHeader("Cache-Control", "no-cache", false); + + if (type === "form") { + response.write(createIframedFormTest(schemeFrom, schemeTo, policy)); + } else if (type === "window.location") { + response.write( + createIframedWindowLocationTest(schemeFrom, schemeTo, policy) + ); + } + } else if (action === "test") { + // ?action=test&scheme=http-to-https&policy=origin&type=img + var scheme = params[1].split("=")[1]; + var policy = params[2].split("=")[1]; + var type = params[3].split("=")[1]; + var result = getSharedState(sharedKey); + + if (result === "") { + result = {}; + } else { + result = JSON.parse(result); + } + + if (!result[type]) { + result[type] = {}; + } + + if (!result[type][scheme]) { + result[type][scheme] = {}; + } + + if (request.hasHeader("Referer")) { + result[type][scheme][policy] = request.getHeader("Referer"); + } else { + result[type][scheme][policy] = ""; + } + + setSharedState(sharedKey, JSON.stringify(result)); + + if (type === "link") { + var loc = + "https://example.com/tests/dom/base/test/file_bug704320_redirect.html"; + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", loc, false); + } + + if (type === "window.open") { + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html", false); + response.write( + "" + ); + } + } else if (action === "get-test-results") { + // ?action=get-result + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.write(getSharedState(sharedKey)); + } else if (action === "generate-policy-test") { + // ?action=generate-policy-test&policy=b64-encoded-string + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html", false); + var policy = unescape(params[1].split("=")[1]); + var optionalEarlierPolicy = ""; + if (params[2]) { + optionalEarlierPolicy = params[2].split("=")[1]; + } + + response.write(createPolicyTest(policy, optionalEarlierPolicy)); + } +} diff --git a/dom/base/test/bug704320_counter.sjs b/dom/base/test/bug704320_counter.sjs new file mode 100644 index 0000000000..061bd751d9 --- /dev/null +++ b/dom/base/test/bug704320_counter.sjs @@ -0,0 +1,96 @@ +// Handle counting loads for bug 704320. + +const SHARED_KEY = "bug704320_counter"; +const DEFAULT_STATE = { + css: { count: 0, referrers: [] }, + img: { count: 0, referrers: [] }, + js: { count: 0, referrers: [] }, +}; +const TYPE_MAP = { + css: "text/css", + js: "application/javascript", + img: "image/png", + html: "text/html", +}; + +// Writes an image to the response +function WriteOutImage(response) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append("blue.png"); + + var fileStream = Components.classes[ + "@mozilla.org/network/file-input-stream;1" + ].createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + response.bodyOutputStream.writeFrom(fileStream, fileStream.available()); +} + +function handleRequest(request, response) { + var query = {}; + request.queryString.split("&").forEach(function (val) { + var [name, value] = val.split("="); + query[name] = unescape(value); + }); + + var referrerLevel = "none"; + if (request.hasHeader("Referer")) { + let referrer = request.getHeader("Referer"); + if (referrer.indexOf("bug704320") > 0) { + referrerLevel = "full"; + } else if (referrer == "http://mochi.test:8888/") { + referrerLevel = "origin"; + } + } + + var state = getSharedState(SHARED_KEY); + if (state === "") { + state = DEFAULT_STATE; + } else { + state = JSON.parse(state); + } + + response.setStatusLine(request.httpVersion, 200, "OK"); + + //avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + + if ("reset" in query) { + //reset server state + setSharedState(SHARED_KEY, JSON.stringify(DEFAULT_STATE)); + //serve any CSS that we want to use. + response.write(""); + return; + } + + if ("results" in query) { + response.setHeader("Content-Type", "text/javascript", false); + response.write(JSON.stringify(state)); + return; + } + + if ("type" in query) { + state[query.type].count++; + response.setHeader("Content-Type", TYPE_MAP[query.type], false); + if (state[query.type].referrers.indexOf(referrerLevel) < 0) { + state[query.type].referrers.push(referrerLevel); + } + + if (query.type == "img") { + WriteOutImage(response); + } + } + + if ("content" in query) { + response.write(unescape(query.content)); + } + + setSharedState(SHARED_KEY, JSON.stringify(state)); + return; +} diff --git a/dom/base/test/bug819051.sjs b/dom/base/test/bug819051.sjs new file mode 100644 index 0000000000..b880d4efe3 --- /dev/null +++ b/dom/base/test/bug819051.sjs @@ -0,0 +1,9 @@ +function handleRequest(request, response) { + response.setStatusLine(request.httpVersion, 200, "Ok"); + response.setHeader( + "X-appended-result", + request.getHeader("X-appended-to-this") + ); + response.setHeader("X-Accept-Result", request.getHeader("Accept")); + response.write(""); +} diff --git a/dom/base/test/chrome.ini b/dom/base/test/chrome.ini new file mode 100644 index 0000000000..08302adc2a --- /dev/null +++ b/dom/base/test/chrome.ini @@ -0,0 +1,42 @@ +[DEFAULT] +skip-if = os == 'android' +support-files = + file_empty.html + file_blocking_image.html + file_bug945152.jar + file_bug945152_worker.js + file_bug1008126_worker.js + file_inline_script.html + file_inline_script.xhtml + file_external_script.html + file_external_script.xhtml + file_script.js + file_serializer_noscript.html + referrer_helper.js + referrer_testserver.sjs + !/image/test/mochitest/shaver.png + +[test_anonymousContent_xul_window.xhtml] +[test_blockParsing.html] +[test_blocking_image.html] +[test_bug419527.xhtml] +[test_bug564863-2.xhtml] +[test_bug945152.html] +[test_bug1008126.html] +[test_bug1016960.html] +[test_bug1120222.html] +[test_anchor_target_blank_referrer.html] +[test_domrequesthelper.xhtml] +[test_fragment_sanitization.xhtml] +[test_getLastOverWindowPointerLocationInCSSPixels.html] +support-files = !/gfx/layers/apz/test/mochitest/apz_test_utils.js +[test_messagemanager_send_principal.html] +[test_navigator_resolve_identity_xrays.xhtml] +support-files = file_navigator_resolve_identity_xrays.xhtml +[test_sandboxed_blob_uri.html] +[test_sendQueryContentAndSelectionSetEvent.html] +[test_sendSelectionSetEvent_with_same_range.html] +[test_urgent_start.html] +skip-if = (os == "win" && debug) || (os == "mac" && debug) #leaks Bug 1571583 +[test_sanitize_xhr.html] +[test_serializer_noscript.html] diff --git a/dom/base/test/chrome/bug418986-1.js b/dom/base/test/chrome/bug418986-1.js new file mode 100644 index 0000000000..7c39df0c13 --- /dev/null +++ b/dom/base/test/chrome/bug418986-1.js @@ -0,0 +1,88 @@ +/* globals chromeWindow */ +// The main test function. +var test = function (isContent) { + SimpleTest.waitForExplicitFinish(); + + SpecialPowers.pushPrefEnv({ + set: [["security.allow_eval_with_system_principal", true]], + }); + + if (!isContent) { + let { ww } = SpecialPowers.Services; + window.chromeWindow = ww.activeWindow; + } + + // The pairs of values expected to be the same when + // fingerprinting resistance is enabled. + let pairs = [ + ["screenX", 0], + ["screenY", 0], + ["mozInnerScreenX", 0], + ["mozInnerScreenY", 0], + ["screen.pixelDepth", 24], + ["screen.colorDepth", 24], + ["screen.availWidth", "innerWidth"], + ["screen.availHeight", "innerHeight"], + ["screen.left", 0], + ["screen.top", 0], + ["screen.availLeft", 0], + ["screen.availTop", 0], + ["screen.width", "innerWidth"], + ["screen.height", "innerHeight"], + ["screen.orientation.type", "'landscape-primary'"], + ["screen.orientation.angle", 0], + ["screen.mozOrientation", "'landscape-primary'"], + ["devicePixelRatio", 1], + ]; + + // checkPair: tests if members of pair [a, b] are equal when evaluated. + let checkPair = function (a, b) { + // eslint-disable-next-line no-eval + is(eval(a), eval(b), a + " should be equal to " + b); + }; + + // Returns generator object that iterates through pref values. + let prefVals = (function* () { + yield false; + yield true; + })(); + + // The main test function, runs until all pref values are exhausted. + let nextTest = function () { + let { value: prefValue, done } = prefVals.next(); + if (done) { + SimpleTest.finish(); + return; + } + SpecialPowers.pushPrefEnv( + { set: [["privacy.resistFingerprinting", prefValue]] }, + function () { + // We will be resisting fingerprinting if the pref is enabled, + // and we are in a content script (not chrome). + let resisting = prefValue && isContent; + // Check each of the pairs. + pairs.map(function ([item, onVal]) { + if (resisting) { + checkPair("window." + item, onVal); + } else if (!isContent && !item.startsWith("moz")) { + checkPair("window." + item, "chromeWindow." + item); + } + }); + if (!isContent && !resisting) { + // Hard to predict these values, but we can enforce constraints: + ok( + window.mozInnerScreenX >= chromeWindow.mozInnerScreenX, + "mozInnerScreenX" + ); + ok( + window.mozInnerScreenY >= chromeWindow.mozInnerScreenY, + "mozInnerScreenY" + ); + } + nextTest(); + } + ); + }; + + nextTest(); +}; diff --git a/dom/base/test/chrome/bug421622-referer.sjs b/dom/base/test/chrome/bug421622-referer.sjs new file mode 100644 index 0000000000..14cab00de4 --- /dev/null +++ b/dom/base/test/chrome/bug421622-referer.sjs @@ -0,0 +1,9 @@ +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain", false); + response.setHeader("Cache-Control", "no-cache", false); + + var referer = request.hasHeader("Referer") + ? request.getHeader("Referer") + : ""; + response.write("Referer: " + referer); +} diff --git a/dom/base/test/chrome/bug884693.sjs b/dom/base/test/chrome/bug884693.sjs new file mode 100644 index 0000000000..f2650753f2 --- /dev/null +++ b/dom/base/test/chrome/bug884693.sjs @@ -0,0 +1,8 @@ +function handleRequest(request, response) { + let [status, statusText, encodedBody] = request.queryString.split("&"); + let body = decodeURIComponent(encodedBody); + response.setStatusLine(request.httpVersion, status, statusText); + response.setHeader("Content-Type", "text/xml", false); + response.setHeader("Content-Length", "" + body.length, false); + response.write(body); +} diff --git a/dom/base/test/chrome/chrome.ini b/dom/base/test/chrome/chrome.ini new file mode 100644 index 0000000000..5dde748a67 --- /dev/null +++ b/dom/base/test/chrome/chrome.ini @@ -0,0 +1,84 @@ +[DEFAULT] +skip-if = os == 'android' +support-files = + bug418986-1.js + clonedoc/** + file_bug549682.xhtml + file_bug616841.xhtml + file_bug816340.xhtml + file_bug990812-1.xhtml + file_bug990812-2.xhtml + file_bug990812-3.xhtml + file_bug990812-4.xhtml + file_bug990812-5.xhtml + file_bug1139964.xhtml + file_bug1209621.xhtml + fileconstructor_file.png + frame_custom_element_content.html + custom_element_ep.js + window_nsITextInputProcessor.xhtml + title_window.xhtml + window_swapFrameLoaders.xhtml +prefs = + gfx.font_rendering.fallback.async=false + +[test_bug120684.xhtml] +[test_bug206691.xhtml] +[test_bug289714.xhtml] +[test_bug339494.xhtml] +[test_bug357450.xhtml] +support-files = ../file_bug357450.js +[test_bug380418.html] +[test_bug380418.html^headers^] +[test_bug383430.html] +[test_bug418986-1.xhtml] +[test_bug421622.xhtml] +[test_bug429785.xhtml] +[test_bug430050.xhtml] +[test_bug467123.xhtml] +[test_bug473284.xhtml] +[test_bug549682.xhtml] +skip-if = verify +[test_bug571390.xhtml] +[test_bug1098074_throw_from_ReceiveMessage.xhtml] +[test_bug616841.xhtml] +[test_bug635835.xhtml] +[test_bug682305.html] +[test_bug683852.xhtml] +[test_bug752226-3.xhtml] +[test_bug752226-4.xhtml] +[test_bug765993.html] +[test_bug780199.xhtml] +[test_bug780529.xhtml] +[test_bug800386.xhtml] +[test_bug816340.xhtml] +[test_bug884693.xhtml] +[test_bug914381.html] +[test_bug990812.xhtml] +[test_bug1063837.xhtml] +[test_bug1139964.xhtml] +[test_bug1209621.xhtml] +[test_bug1346936.html] +[test_chromeOuterWindowID.xhtml] +support-files = + window_chromeOuterWindowID.xhtml +[test_getElementsWithGrid.html] +[test_custom_element_content.xhtml] +[test_custom_element_ep.xhtml] +[test_document-element-inserted.xhtml] +support-files = + file_document-element-inserted.xhtml + file_document-element-inserted-inner.xhtml +[test_domparsing.xhtml] +[test_fileconstructor.xhtml] +[test_input_value_set_preserve_undo.xhtml] +[test_nsITextInputProcessor.xhtml] +[test_permission_hasValidTransientUserActivation.xhtml] +support-files = ../dummy.html +[test_range_getClientRectsAndTexts.html] +[test_title.xhtml] +support-files = file_title.xhtml +[test_windowroot.xhtml] +[test_swapFrameLoaders.xhtml] +skip-if = os == 'mac' # bug 1674413 +[test_bug1339722.html] diff --git a/dom/base/test/chrome/clonedoc/chrome.manifest b/dom/base/test/chrome/clonedoc/chrome.manifest new file mode 100644 index 0000000000..5d7e720416 --- /dev/null +++ b/dom/base/test/chrome/clonedoc/chrome.manifest @@ -0,0 +1 @@ +content clonedoc content/ diff --git a/dom/base/test/chrome/clonedoc/content/doc.xml b/dom/base/test/chrome/clonedoc/content/doc.xml new file mode 100644 index 0000000000..fdd7e7c6e0 --- /dev/null +++ b/dom/base/test/chrome/clonedoc/content/doc.xml @@ -0,0 +1,4 @@ + + + + diff --git a/dom/base/test/chrome/custom_element_ep.js b/dom/base/test/chrome/custom_element_ep.js new file mode 100644 index 0000000000..d933ecbbab --- /dev/null +++ b/dom/base/test/chrome/custom_element_ep.js @@ -0,0 +1,14 @@ +/* globals finishTest */ +class XFoo extends HTMLElement { + constructor() { + super(); + this.magicNumber = 42; + } + + connectedCallback() { + finishTest(this.magicNumber === 42); + } +} +customElements.define("x-foo", XFoo); + +document.firstChild.appendChild(document.createElement("x-foo")); diff --git a/dom/base/test/chrome/file_bug1139964.xhtml b/dom/base/test/chrome/file_bug1139964.xhtml new file mode 100644 index 0000000000..8bf7f27e0b --- /dev/null +++ b/dom/base/test/chrome/file_bug1139964.xhtml @@ -0,0 +1,60 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug1209621.xhtml b/dom/base/test/chrome/file_bug1209621.xhtml new file mode 100644 index 0000000000..3ba58975bd --- /dev/null +++ b/dom/base/test/chrome/file_bug1209621.xhtml @@ -0,0 +1,85 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug549682.xhtml b/dom/base/test/chrome/file_bug549682.xhtml new file mode 100644 index 0000000000..02919386c4 --- /dev/null +++ b/dom/base/test/chrome/file_bug549682.xhtml @@ -0,0 +1,214 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug616841.xhtml b/dom/base/test/chrome/file_bug616841.xhtml new file mode 100644 index 0000000000..a5e5d9a427 --- /dev/null +++ b/dom/base/test/chrome/file_bug616841.xhtml @@ -0,0 +1,63 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug816340.xhtml b/dom/base/test/chrome/file_bug816340.xhtml new file mode 100644 index 0000000000..2ee0ec3365 --- /dev/null +++ b/dom/base/test/chrome/file_bug816340.xhtml @@ -0,0 +1,70 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812-1.xhtml b/dom/base/test/chrome/file_bug990812-1.xhtml new file mode 100644 index 0000000000..8b8da3d136 --- /dev/null +++ b/dom/base/test/chrome/file_bug990812-1.xhtml @@ -0,0 +1,61 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812-2.xhtml b/dom/base/test/chrome/file_bug990812-2.xhtml new file mode 100644 index 0000000000..e13b47f589 --- /dev/null +++ b/dom/base/test/chrome/file_bug990812-2.xhtml @@ -0,0 +1,56 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812-3.xhtml b/dom/base/test/chrome/file_bug990812-3.xhtml new file mode 100644 index 0000000000..1f3e1d69f2 --- /dev/null +++ b/dom/base/test/chrome/file_bug990812-3.xhtml @@ -0,0 +1,68 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812-4.xhtml b/dom/base/test/chrome/file_bug990812-4.xhtml new file mode 100644 index 0000000000..1c16ceb02c --- /dev/null +++ b/dom/base/test/chrome/file_bug990812-4.xhtml @@ -0,0 +1,63 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812-5.xhtml b/dom/base/test/chrome/file_bug990812-5.xhtml new file mode 100644 index 0000000000..8c418492a1 --- /dev/null +++ b/dom/base/test/chrome/file_bug990812-5.xhtml @@ -0,0 +1,74 @@ + + + + + + diff --git a/dom/base/test/chrome/file_bug990812.xhtml b/dom/base/test/chrome/file_bug990812.xhtml new file mode 100644 index 0000000000..02662d5749 --- /dev/null +++ b/dom/base/test/chrome/file_bug990812.xhtml @@ -0,0 +1,55 @@ + + + + + + diff --git a/dom/base/test/chrome/file_document-element-inserted-inner.xhtml b/dom/base/test/chrome/file_document-element-inserted-inner.xhtml new file mode 100644 index 0000000000..2088e2789a --- /dev/null +++ b/dom/base/test/chrome/file_document-element-inserted-inner.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dom/base/test/chrome/file_document-element-inserted.xhtml b/dom/base/test/chrome/file_document-element-inserted.xhtml new file mode 100644 index 0000000000..d67df13df7 --- /dev/null +++ b/dom/base/test/chrome/file_document-element-inserted.xhtml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dom/base/test/chrome/file_title.xhtml b/dom/base/test/chrome/file_title.xhtml new file mode 100644 index 0000000000..d1b04418aa --- /dev/null +++ b/dom/base/test/chrome/file_title.xhtml @@ -0,0 +1 @@ + diff --git a/dom/base/test/chrome/fileconstructor_file.png b/dom/base/test/chrome/fileconstructor_file.png new file mode 100644 index 0000000000..51e8aaf38c Binary files /dev/null and b/dom/base/test/chrome/fileconstructor_file.png differ diff --git a/dom/base/test/chrome/frame_custom_element_content.html b/dom/base/test/chrome/frame_custom_element_content.html new file mode 100644 index 0000000000..aa1d75863d --- /dev/null +++ b/dom/base/test/chrome/frame_custom_element_content.html @@ -0,0 +1,5 @@ + + + + + diff --git a/dom/base/test/chrome/nochrome_bug1346936.html b/dom/base/test/chrome/nochrome_bug1346936.html new file mode 100644 index 0000000000..158b20c884 --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug1346936.html @@ -0,0 +1,3 @@ + + + diff --git a/dom/base/test/chrome/nochrome_bug1346936.js b/dom/base/test/chrome/nochrome_bug1346936.js new file mode 100644 index 0000000000..a84113e1e1 --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug1346936.js @@ -0,0 +1,4 @@ +//# sourceMappingURL=bar.js.map + +// Define a single function to prevent script source from being gc'd +function foo() {} diff --git a/dom/base/test/chrome/nochrome_bug1346936.js^headers^ b/dom/base/test/chrome/nochrome_bug1346936.js^headers^ new file mode 100644 index 0000000000..812264590d --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug1346936.js^headers^ @@ -0,0 +1 @@ +SourceMap: foo.js.map diff --git a/dom/base/test/chrome/nochrome_bug765993.html b/dom/base/test/chrome/nochrome_bug765993.html new file mode 100644 index 0000000000..158b20c884 --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug765993.html @@ -0,0 +1,3 @@ + + + diff --git a/dom/base/test/chrome/nochrome_bug765993.js b/dom/base/test/chrome/nochrome_bug765993.js new file mode 100644 index 0000000000..a84113e1e1 --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug765993.js @@ -0,0 +1,4 @@ +//# sourceMappingURL=bar.js.map + +// Define a single function to prevent script source from being gc'd +function foo() {} diff --git a/dom/base/test/chrome/nochrome_bug765993.js^headers^ b/dom/base/test/chrome/nochrome_bug765993.js^headers^ new file mode 100644 index 0000000000..8efacff3c8 --- /dev/null +++ b/dom/base/test/chrome/nochrome_bug765993.js^headers^ @@ -0,0 +1 @@ +X-SourceMap: foo.js.map diff --git a/dom/base/test/chrome/test_bug1063837.xhtml b/dom/base/test/chrome/test_bug1063837.xhtml new file mode 100644 index 0000000000..794cf1c72c --- /dev/null +++ b/dom/base/test/chrome/test_bug1063837.xhtml @@ -0,0 +1,36 @@ + + + + + + + + + + Mozilla Bug 1063837 + + + + + diff --git a/dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml b/dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml new file mode 100644 index 0000000000..dbedb59abe --- /dev/null +++ b/dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml @@ -0,0 +1,46 @@ + + + + + + + + + + Mozilla Bug 1098074 + + diff --git a/dom/base/test/chrome/test_bug1139964.xhtml b/dom/base/test/chrome/test_bug1139964.xhtml new file mode 100644 index 0000000000..8b1b36fa64 --- /dev/null +++ b/dom/base/test/chrome/test_bug1139964.xhtml @@ -0,0 +1,32 @@ + + + + + + + + + + Mozilla Bug 1139964 + + + + + diff --git a/dom/base/test/chrome/test_bug120684.xhtml b/dom/base/test/chrome/test_bug120684.xhtml new file mode 100644 index 0000000000..08e9b28cfe --- /dev/null +++ b/dom/base/test/chrome/test_bug120684.xhtml @@ -0,0 +1,80 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug1209621.xhtml b/dom/base/test/chrome/test_bug1209621.xhtml new file mode 100644 index 0000000000..947606b638 --- /dev/null +++ b/dom/base/test/chrome/test_bug1209621.xhtml @@ -0,0 +1,34 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug1339722.html b/dom/base/test/chrome/test_bug1339722.html new file mode 100644 index 0000000000..d8d95f1faa --- /dev/null +++ b/dom/base/test/chrome/test_bug1339722.html @@ -0,0 +1,86 @@ + + + + + + Test for Bug 1339722 + + + + + + + Mozilla Bug 1339722 +

+ +
+  
+ +
+
+ + diff --git a/dom/base/test/chrome/test_bug1346936.html b/dom/base/test/chrome/test_bug1346936.html new file mode 100644 index 0000000000..2c61c65237 --- /dev/null +++ b/dom/base/test/chrome/test_bug1346936.html @@ -0,0 +1,61 @@ + + + + + Test for Bug 1346936 + + + + + +Mozilla Bug 1346936 + + + +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug206691.xhtml b/dom/base/test/chrome/test_bug206691.xhtml new file mode 100644 index 0000000000..16a27762ac --- /dev/null +++ b/dom/base/test/chrome/test_bug206691.xhtml @@ -0,0 +1,32 @@ + + + + + + + + + + Mozilla Bug 206691 + + + + + diff --git a/dom/base/test/chrome/test_bug289714.xhtml b/dom/base/test/chrome/test_bug289714.xhtml new file mode 100644 index 0000000000..4b4cc6fb84 --- /dev/null +++ b/dom/base/test/chrome/test_bug289714.xhtml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug339494.xhtml b/dom/base/test/chrome/test_bug339494.xhtml new file mode 100644 index 0000000000..9922c41b66 --- /dev/null +++ b/dom/base/test/chrome/test_bug339494.xhtml @@ -0,0 +1,62 @@ + + + + + + + + + +Mozilla Bug 339494 +

+ +
+
+ + + + +
diff --git a/dom/base/test/chrome/test_bug357450.xhtml b/dom/base/test/chrome/test_bug357450.xhtml new file mode 100644 index 0000000000..7723364ecc --- /dev/null +++ b/dom/base/test/chrome/test_bug357450.xhtml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + +Mozilla Bug 357450 + +

+ +
+ hmm + hmm + hmm + hmm + hmm +
+

+

+

+

+
+
+
+ + + + + + + + + + + + hmm + + + +
diff --git a/dom/base/test/chrome/test_bug380418.html b/dom/base/test/chrome/test_bug380418.html new file mode 100644 index 0000000000..eb3f8d3042 --- /dev/null +++ b/dom/base/test/chrome/test_bug380418.html @@ -0,0 +1,37 @@ + + + + + Test for Bug 380418 + + + + +Mozilla Bug 380418 +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug380418.html^headers^ b/dom/base/test/chrome/test_bug380418.html^headers^ new file mode 100644 index 0000000000..5f8d4969c0 --- /dev/null +++ b/dom/base/test/chrome/test_bug380418.html^headers^ @@ -0,0 +1,4 @@ +Set-Cookie: test +Set-Cookie2: test2 +X-Dummy: test +Cache-Control: max-age=0 diff --git a/dom/base/test/chrome/test_bug383430.html b/dom/base/test/chrome/test_bug383430.html new file mode 100644 index 0000000000..ce526ef281 --- /dev/null +++ b/dom/base/test/chrome/test_bug383430.html @@ -0,0 +1,38 @@ + + + + + Test for Bug 383430 + + + + +Mozilla Bug 383430 +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug418986-1.xhtml b/dom/base/test/chrome/test_bug418986-1.xhtml new file mode 100644 index 0000000000..7d3add900a --- /dev/null +++ b/dom/base/test/chrome/test_bug418986-1.xhtml @@ -0,0 +1,25 @@ + + + + + + + + + + Mozilla Bug 418986 (Part 1) + + + + + + diff --git a/dom/base/test/chrome/test_bug421622.xhtml b/dom/base/test/chrome/test_bug421622.xhtml new file mode 100644 index 0000000000..236c42dd34 --- /dev/null +++ b/dom/base/test/chrome/test_bug421622.xhtml @@ -0,0 +1,34 @@ + + + + + + + + + + Mozilla Bug 421622 + + + + + diff --git a/dom/base/test/chrome/test_bug429785.xhtml b/dom/base/test/chrome/test_bug429785.xhtml new file mode 100644 index 0000000000..f4f6b414b4 --- /dev/null +++ b/dom/base/test/chrome/test_bug429785.xhtml @@ -0,0 +1,55 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug430050.xhtml b/dom/base/test/chrome/test_bug430050.xhtml new file mode 100644 index 0000000000..f6f005fae2 --- /dev/null +++ b/dom/base/test/chrome/test_bug430050.xhtml @@ -0,0 +1,50 @@ + + + + + + + + + + Mozilla Bug 430050 + + + + + + diff --git a/dom/base/test/chrome/test_bug467123.xhtml b/dom/base/test/chrome/test_bug467123.xhtml new file mode 100644 index 0000000000..222883badf --- /dev/null +++ b/dom/base/test/chrome/test_bug467123.xhtml @@ -0,0 +1,44 @@ + + + + + + + + + + Mozilla Bug 467123 + + + + + diff --git a/dom/base/test/chrome/test_bug473284.xhtml b/dom/base/test/chrome/test_bug473284.xhtml new file mode 100644 index 0000000000..87c778a615 --- /dev/null +++ b/dom/base/test/chrome/test_bug473284.xhtml @@ -0,0 +1,83 @@ + + + + + + + + + + Mozilla Bug 473284 + + diff --git a/dom/base/test/chrome/test_bug549682.xhtml b/dom/base/test/chrome/test_bug549682.xhtml new file mode 100644 index 0000000000..0f1ecf646a --- /dev/null +++ b/dom/base/test/chrome/test_bug549682.xhtml @@ -0,0 +1,32 @@ + + + + + + + + + + Mozilla Bug 549682 + + + + + diff --git a/dom/base/test/chrome/test_bug571390.xhtml b/dom/base/test/chrome/test_bug571390.xhtml new file mode 100644 index 0000000000..ea1f357a5d --- /dev/null +++ b/dom/base/test/chrome/test_bug571390.xhtml @@ -0,0 +1,42 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug616841.xhtml b/dom/base/test/chrome/test_bug616841.xhtml new file mode 100644 index 0000000000..f5907f0b0b --- /dev/null +++ b/dom/base/test/chrome/test_bug616841.xhtml @@ -0,0 +1,30 @@ + + + + + + + + + + Mozilla Bug 616841 + + + + + diff --git a/dom/base/test/chrome/test_bug635835.xhtml b/dom/base/test/chrome/test_bug635835.xhtml new file mode 100644 index 0000000000..69bb3ae68b --- /dev/null +++ b/dom/base/test/chrome/test_bug635835.xhtml @@ -0,0 +1,36 @@ + + + + + + + + + + Mozilla Bug 635835 + + + + + diff --git a/dom/base/test/chrome/test_bug682305.html b/dom/base/test/chrome/test_bug682305.html new file mode 100644 index 0000000000..d500dc91d5 --- /dev/null +++ b/dom/base/test/chrome/test_bug682305.html @@ -0,0 +1,150 @@ + + + + + XMLHttpRequest send and channel implemented in JS + + + + + +Mozilla Bug 682305 +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug683852.xhtml b/dom/base/test/chrome/test_bug683852.xhtml new file mode 100644 index 0000000000..1f9e0d9472 --- /dev/null +++ b/dom/base/test/chrome/test_bug683852.xhtml @@ -0,0 +1,87 @@ + + + + + + + Anonymous + + + + + Mozilla Bug 683852 + + + + + diff --git a/dom/base/test/chrome/test_bug752226-3.xhtml b/dom/base/test/chrome/test_bug752226-3.xhtml new file mode 100644 index 0000000000..747fb29c4e --- /dev/null +++ b/dom/base/test/chrome/test_bug752226-3.xhtml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug752226-4.xhtml b/dom/base/test/chrome/test_bug752226-4.xhtml new file mode 100644 index 0000000000..242e231a2e --- /dev/null +++ b/dom/base/test/chrome/test_bug752226-4.xhtml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug765993.html b/dom/base/test/chrome/test_bug765993.html new file mode 100644 index 0000000000..3325c3713d --- /dev/null +++ b/dom/base/test/chrome/test_bug765993.html @@ -0,0 +1,61 @@ + + + + + Test for Bug 765993 + + + + + +Mozilla Bug 765993 + + + +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug780199.xhtml b/dom/base/test/chrome/test_bug780199.xhtml new file mode 100644 index 0000000000..e27afb72fa --- /dev/null +++ b/dom/base/test/chrome/test_bug780199.xhtml @@ -0,0 +1,51 @@ + + + + + + + + diff --git a/dom/base/test/chrome/test_bug780529.xhtml b/dom/base/test/chrome/test_bug780529.xhtml new file mode 100644 index 0000000000..bf8b8b2981 --- /dev/null +++ b/dom/base/test/chrome/test_bug780529.xhtml @@ -0,0 +1,36 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug800386.xhtml b/dom/base/test/chrome/test_bug800386.xhtml new file mode 100644 index 0000000000..681c9a9794 --- /dev/null +++ b/dom/base/test/chrome/test_bug800386.xhtml @@ -0,0 +1,65 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug816340.xhtml b/dom/base/test/chrome/test_bug816340.xhtml new file mode 100644 index 0000000000..66bd26660e --- /dev/null +++ b/dom/base/test/chrome/test_bug816340.xhtml @@ -0,0 +1,30 @@ + + + + + + + + + + Mozilla Bug 816340 + + + + + diff --git a/dom/base/test/chrome/test_bug884693.xhtml b/dom/base/test/chrome/test_bug884693.xhtml new file mode 100644 index 0000000000..db6eca88a8 --- /dev/null +++ b/dom/base/test/chrome/test_bug884693.xhtml @@ -0,0 +1,82 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_bug914381.html b/dom/base/test/chrome/test_bug914381.html new file mode 100644 index 0000000000..eb82ffd0f7 --- /dev/null +++ b/dom/base/test/chrome/test_bug914381.html @@ -0,0 +1,58 @@ + + + + + + Test for Bug 914381 + + + + +Mozilla Bug 914381 +

+ +
+
+
+ + diff --git a/dom/base/test/chrome/test_bug990812.xhtml b/dom/base/test/chrome/test_bug990812.xhtml new file mode 100644 index 0000000000..410d6d2367 --- /dev/null +++ b/dom/base/test/chrome/test_bug990812.xhtml @@ -0,0 +1,42 @@ + + + + + + + + + + Mozilla Bug 990812 + + + + + diff --git a/dom/base/test/chrome/test_chromeOuterWindowID.xhtml b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml new file mode 100644 index 0000000000..880cfdf8bb --- /dev/null +++ b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml @@ -0,0 +1,137 @@ + + + + + + + diff --git a/dom/base/test/chrome/test_custom_element_content.xhtml b/dom/base/test/chrome/test_custom_element_content.xhtml new file mode 100644 index 0000000000..7778bc350e --- /dev/null +++ b/dom/base/test/chrome/test_custom_element_content.xhtml @@ -0,0 +1,55 @@ + + + + + + + + + + Mozilla Bug 1130028 + + + + + + diff --git a/dom/base/test/chrome/test_custom_element_ep.xhtml b/dom/base/test/chrome/test_custom_element_ep.xhtml new file mode 100644 index 0000000000..28b4e876f5 --- /dev/null +++ b/dom/base/test/chrome/test_custom_element_ep.xhtml @@ -0,0 +1,41 @@ + + + + + + + + + + Mozilla Bug 1130028 + + + + + + diff --git a/dom/base/test/chrome/test_document-element-inserted.xhtml b/dom/base/test/chrome/test_document-element-inserted.xhtml new file mode 100644 index 0000000000..5fd35e364d --- /dev/null +++ b/dom/base/test/chrome/test_document-element-inserted.xhtml @@ -0,0 +1,54 @@ + + + + + + + + + + Mozilla Bug 1411707 + + + + + diff --git a/dom/base/test/chrome/test_domparsing.xhtml b/dom/base/test/chrome/test_domparsing.xhtml new file mode 100644 index 0000000000..be04bdfc0d --- /dev/null +++ b/dom/base/test/chrome/test_domparsing.xhtml @@ -0,0 +1,145 @@ + + + + + + diff --git a/dom/base/test/chrome/test_fileconstructor.xhtml b/dom/base/test/chrome/test_fileconstructor.xhtml new file mode 100644 index 0000000000..8884eb169b --- /dev/null +++ b/dom/base/test/chrome/test_fileconstructor.xhtml @@ -0,0 +1,86 @@ + + + + + + + + + + + Mozilla Bug 607114 +

+ +
+
+ + + + +
diff --git a/dom/base/test/chrome/test_getElementsWithGrid.html b/dom/base/test/chrome/test_getElementsWithGrid.html new file mode 100644 index 0000000000..3554acb2e9 --- /dev/null +++ b/dom/base/test/chrome/test_getElementsWithGrid.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+ + + +
+ +
+ +
+ + + +
+ + + +
+ + + diff --git a/dom/base/test/chrome/test_input_value_set_preserve_undo.xhtml b/dom/base/test/chrome/test_input_value_set_preserve_undo.xhtml new file mode 100644 index 0000000000..80465202ab --- /dev/null +++ b/dom/base/test/chrome/test_input_value_set_preserve_undo.xhtml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + diff --git a/dom/base/test/chrome/test_nsITextInputProcessor.xhtml b/dom/base/test/chrome/test_nsITextInputProcessor.xhtml new file mode 100644 index 0000000000..3343c28560 --- /dev/null +++ b/dom/base/test/chrome/test_nsITextInputProcessor.xhtml @@ -0,0 +1,29 @@ + + + + + + + + +

+

+ +
+
+ + + +
diff --git a/dom/base/test/chrome/test_permission_hasValidTransientUserActivation.xhtml b/dom/base/test/chrome/test_permission_hasValidTransientUserActivation.xhtml new file mode 100644 index 0000000000..06675a90ad --- /dev/null +++ b/dom/base/test/chrome/test_permission_hasValidTransientUserActivation.xhtml @@ -0,0 +1,91 @@ + + + + + + + + + +
+

+
+ +
+
+ + + + + diff --git a/dom/base/test/chrome/window_swapFrameLoaders.xhtml b/dom/base/test/chrome/window_swapFrameLoaders.xhtml new file mode 100644 index 0000000000..0a42e975fc --- /dev/null +++ b/dom/base/test/chrome/window_swapFrameLoaders.xhtml @@ -0,0 +1,225 @@ + + + + + + + + diff --git a/dom/base/test/common_postMessages.js b/dom/base/test/common_postMessages.js new file mode 100644 index 0000000000..e582adb41f --- /dev/null +++ b/dom/base/test/common_postMessages.js @@ -0,0 +1,393 @@ +function getType(a) { + if (a === null || a === undefined) { + return "null"; + } + + if (Array.isArray(a)) { + return "array"; + } + + if (typeof a == "object") { + return "object"; + } + + if ( + SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported() && + a instanceof WebAssembly.Module + ) { + return "wasm"; + } + + return "primitive"; +} + +function compare(a, b) { + is(getType(a), getType(b), "Type matches"); + + var type = getType(a); + if (type == "array") { + is(a.length, b.length, "Array.length matches"); + for (var i = 0; i < a.length; ++i) { + compare(a[i], b[i]); + } + + return; + } + + if (type == "object") { + ok(a !== b, "They should not match"); + + var aProps = []; + for (var p in a) { + aProps.push(p); + } + + var bProps = []; + for (var p in b) { + bProps.push(p); + } + + is(aProps.length, bProps.length, "Props match"); + is(aProps.sort().toString(), bProps.sort().toString(), "Props names match"); + + for (var p in a) { + compare(a[p], b[p]); + } + + return; + } + + if (type == "wasm") { + var wasmA = new WebAssembly.Instance(a); + ok(wasmA instanceof WebAssembly.Instance, "got an instance"); + + var wasmB = new WebAssembly.Instance(b); + ok(wasmB instanceof WebAssembly.Instance, "got an instance"); + + ok(wasmA.exports.foo() === wasmB.exports.foo(), "Same result!"); + ok(wasmB.exports.foo() === 42, "We want 42"); + } + + if (type != "null") { + is(a, b, "Same value"); + } +} + +var clonableObjects = [ + { target: "all", data: "hello world" }, + { target: "all", data: 123 }, + { target: "all", data: null }, + { target: "all", data: true }, + { target: "all", data: new Date() }, + { target: "all", data: [1, "test", true, new Date()] }, + { + target: "all", + data: { a: true, b: null, c: new Date(), d: [true, false, {}] }, + }, + { target: "all", data: new Blob([123], { type: "plain/text" }) }, + { target: "all", data: new ImageData(2, 2) }, +]; + +function create_fileList() { + var url = SimpleTest.getTestFileURL("script_postmessages_fileList.js"); + var script = SpecialPowers.loadChromeScript(url); + + function onOpened(message) { + var fileList = document.getElementById("fileList"); + SpecialPowers.wrap(fileList).mozSetFileArray([message.file]); + + // Just a simple test + var domFile = fileList.files[0]; + is(domFile.name, "prefs.js", "fileName should be prefs.js"); + + clonableObjects.push({ target: "all", data: fileList.files }); + script.destroy(); + next(); + } + + script.addMessageListener("file.opened", onOpened); + script.sendAsyncMessage("file.open"); +} + +function create_directory() { + if (navigator.userAgent.toLowerCase().includes("Android")) { + next(); + return; + } + + var url = SimpleTest.getTestFileURL("script_postmessages_fileList.js"); + var script = SpecialPowers.loadChromeScript(url); + + function onOpened(message) { + var fileList = document.getElementById("fileList"); + SpecialPowers.wrap(fileList).mozSetDirectory(message.dir); + + SpecialPowers.wrap(fileList) + .getFilesAndDirectories() + .then(function (list) { + list = SpecialPowers.unwrap(list); + // Just a simple test + is(list.length, 1, "This list has 1 element"); + ok(list[0] instanceof Directory, "We have a directory."); + + clonableObjects.push({ target: "all", data: list[0] }); + script.destroy(); + next(); + }); + } + + script.addMessageListener("dir.opened", onOpened); + script.sendAsyncMessage("dir.open"); +} + +function create_wasmModule() { + info("Checking if we can play with WebAssembly..."); + + if (!SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported()) { + next(); + return; + } + + ok(WebAssembly, "WebAssembly object should exist"); + ok(WebAssembly.compile, "WebAssembly.compile function should exist"); + + /* + js -e ' + t = wasmTextToBinary(` + (module + (func $foo (result i32) (i32.const 42)) + (export "foo" (func $foo)) + ) + `); + print(t) + ' + */ + // prettier-ignore + const fooModuleCode = new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,127,3,2,1,0,7,7,1,3,102,111,111,0,0,10,6,1,4,0,65,42,11,0,13,4,110,97,109,101,1,6,1,0,3,102,111,111]); + + WebAssembly.compile(fooModuleCode).then( + m => { + ok(m instanceof WebAssembly.Module, "The WasmModule has been compiled."); + clonableObjects.push({ target: "sameProcess", data: m }); + next(); + }, + () => { + ok(false, "The compilation of the wasmModule failed."); + } + ); +} + +function runTests(obj) { + ok( + "clonableObjectsEveryWhere" in obj && + "clonableObjectsSameProcess" in obj && + "transferableObjects" in obj && + (obj.clonableObjectsEveryWhere || + obj.clonableObjectsSameProcess || + obj.transferableObjects), + "We must run some test!" + ); + + // cloning tests - everyWhere + new Promise(function (resolve, reject) { + var clonableObjectsId = 0; + function runClonableTest() { + if (clonableObjectsId >= clonableObjects.length) { + resolve(); + return; + } + + var object = clonableObjects[clonableObjectsId++]; + + if (object.target != "all") { + runClonableTest(); + return; + } + + obj + .send(object.data, []) + .catch(() => { + return { error: true }; + }) + .then(received => { + if (!obj.clonableObjectsEveryWhere) { + ok(received.error, "Error expected"); + } else { + ok(!received.error, "Error not expected"); + compare(received.data, object.data); + } + runClonableTest(); + }); + } + + runClonableTest(); + }) + + // clonable same process + .then(function () { + return new Promise(function (resolve, reject) { + var clonableObjectsId = 0; + function runClonableTest() { + if (clonableObjectsId >= clonableObjects.length) { + resolve(); + return; + } + + var object = clonableObjects[clonableObjectsId++]; + + if (object.target != "sameProcess") { + runClonableTest(); + return; + } + + obj + .send(object.data, []) + .catch(() => { + return { error: true }; + }) + .then(received => { + if (!obj.clonableObjectsSameProcess) { + ok(received.error, "Error expected"); + } else { + ok(!received.error, "Error not expected"); + compare(received.data, object.data); + } + runClonableTest(); + }); + } + + runClonableTest(); + }); + }) + + // transfering tests + .then(function () { + if (!obj.transferableObjects) { + return; + } + + // MessagePort + return new Promise(function (r, rr) { + var mc = new MessageChannel(); + obj.send(42, [mc.port1]).then(function (received) { + is(received.ports.length, 1, "MessagePort has been transferred"); + mc.port2.postMessage("hello world"); + received.ports[0].onmessage = function (e) { + is(e.data, "hello world", "Ports are connected!"); + r(); + }; + }); + }); + }) + + // no dup transfering + .then(function () { + if (!obj.transferableObjects) { + return; + } + + // MessagePort + return new Promise(function (r, rr) { + var mc = new MessageChannel(); + obj + .send(42, [mc.port1, mc.port1]) + .then( + function (received) { + ok(false, "Duplicate ports should throw!"); + }, + function () { + ok(true, "Duplicate ports should throw!"); + } + ) + .then(r); + }); + }) + + // maintaining order of transferred ports + .then(function () { + if (!obj.transferableObjects) { + return; + } + + // MessagePort + return new Promise(function (r, rr) { + var mcs = []; + const NPORTS = 50; + for (let i = 0; i < NPORTS; i++) { + mcs.push(new MessageChannel()); + } + obj + .send( + 42, + mcs.map(channel => channel.port1) + ) + .then(function (received) { + is( + received.ports.length, + NPORTS, + `all ${NPORTS} ports transferred` + ); + const promises = Array(NPORTS) + .fill() + .map( + (_, i) => + new Promise(function (subr, subrr) { + mcs[i].port2.postMessage(i); + received.ports[i].onmessage = e => subr(e.data == i); + }) + ); + return Promise.all(promises); + }) + .then(function (result) { + let in_order = 0; + for (const correct of result) { + if (correct) { + in_order++; + } + } + is(in_order, NPORTS, "All transferred ports are in order"); + }) + .then(r); + }); + }) + + // non transfering tests + .then(function () { + if (obj.transferableObjects) { + return; + } + + // MessagePort + return new Promise(function (r, rr) { + var mc = new MessageChannel(); + obj + .send(42, [mc.port1]) + .then( + function (received) { + ok(false, "This object should not support port transferring"); + }, + function () { + ok(true, "This object should not support port transferring"); + } + ) + .then(r); + }); + }) + + // done. + .then(function () { + obj.finished(); + }); +} + +function next() { + if (!tests.length) { + SimpleTest.finish(); + return; + } + + var test = tests.shift(); + test(); +} + +var tests = [create_fileList, create_directory, create_wasmModule]; diff --git a/dom/base/test/copypaste.js b/dom/base/test/copypaste.js new file mode 100644 index 0000000000..01ec2da1b9 --- /dev/null +++ b/dom/base/test/copypaste.js @@ -0,0 +1,553 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +function modifySelection(s) { + var g = window.getSelection(); + var l = g.getRangeAt(0); + var d = document.createElement("p"); + d.innerHTML = s; + d.appendChild(l.cloneContents()); + + var e = document.createElement("div"); + document.body.appendChild(e); + e.appendChild(d); + var a = document.createRange(); + a.selectNode(d); + g.removeAllRanges(); + g.addRange(a); + window.setTimeout(function () { + e.remove(); + g.removeAllRanges(); + g.addRange(l); + }, 0); +} + +function getLoadContext() { + var Ci = SpecialPowers.Ci; + return SpecialPowers.wrap(window).docShell.QueryInterface(Ci.nsILoadContext); +} + +async function testCopyPaste(isXHTML) { + var suppressUnicodeCheckIfHidden = !!isXHTML; + var suppressHTMLCheck = !!isXHTML; + + var docShell = SpecialPowers.wrap(window).docShell; + + var documentViewer = docShell.contentViewer.QueryInterface( + SpecialPowers.Ci.nsIContentViewerEdit + ); + + var clipboard = SpecialPowers.Services.clipboard; + + var textarea = SpecialPowers.wrap(document.getElementById("input")); + + async function copySelectionToClipboard(suppressUnicodeCheck) { + await SimpleTest.promiseClipboardChange( + () => true, + () => { + documentViewer.copySelection(); + } + ); + if (!suppressUnicodeCheck) { + ok( + clipboard.hasDataMatchingFlavors(["text/plain"], 1), + "check text/plain" + ); + } + if (!suppressHTMLCheck) { + ok(clipboard.hasDataMatchingFlavors(["text/html"], 1), "check text/html"); + } + } + function clear(node, suppressUnicodeCheck) { + textarea.blur(); + var sel = window.getSelection(); + sel.removeAllRanges(); + } + async function copyToClipboard(node, suppressUnicodeCheck) { + clear(); + var r = document.createRange(); + r.selectNode(node); + window.getSelection().addRange(r); + await copySelectionToClipboard(suppressUnicodeCheck); + } + function addRange(startNode, startIndex, endNode, endIndex) { + var sel = window.getSelection(); + var r = document.createRange(); + r.setStart(startNode, startIndex); + r.setEnd(endNode, endIndex); + sel.addRange(r); + } + async function copyRangeToClipboard( + startNode, + startIndex, + endNode, + endIndex, + suppressUnicodeCheck + ) { + clear(); + addRange(startNode, startIndex, endNode, endIndex); + await copySelectionToClipboard(suppressUnicodeCheck); + } + async function copyChildrenToClipboard(id) { + clear(); + window.getSelection().selectAllChildren(document.getElementById(id)); + await copySelectionToClipboard(); + } + function getClipboardData(mime) { + var transferable = SpecialPowers.Cc[ + "@mozilla.org/widget/transferable;1" + ].createInstance(SpecialPowers.Ci.nsITransferable); + transferable.init(getLoadContext()); + transferable.addDataFlavor(mime); + clipboard.getData(transferable, 1); + var data = SpecialPowers.createBlankObject(); + transferable.getTransferData(mime, data); + return data; + } + function testHtmlClipboardValue(mime, expected) { + // For Windows, navigator.platform returns "Win32". + var expectedValue = expected; + if (navigator.platform.includes("Win")) { + // Windows has extra content. + var expectedValue = + kTextHtmlPrefixClipboardDataWindows + + expected.replace(/\n/g, "\n") + + kTextHtmlSuffixClipboardDataWindows; + } + testClipboardValue(mime, expectedValue); + } + function testClipboardValue(mime, expected) { + if (suppressHTMLCheck && mime == "text/html") { + return null; + } + var data = SpecialPowers.wrap(getClipboardData(mime)); + is( + data.value == null + ? data.value + : data.value.QueryInterface(SpecialPowers.Ci.nsISupportsString).data, + expected, + mime + " value in the clipboard" + ); + return data.value; + } + function testPasteText(expected) { + textarea.value = ""; + textarea.focus(); + textarea.editor.paste(1); + is(textarea.value, expected, "value of the textarea after the paste"); + } + function testPasteHTML(id, expected) { + var contentEditable = $(id); + contentEditable.focus(); + synthesizeKey("v", { accelKey: true }); + is(contentEditable.innerHTML, expected, id + ".innerHtml after the paste"); + } + function testSelectionToString(expected) { + is( + window.getSelection().toString().replace(/\r\n/g, "\n"), + expected, + "Selection.toString" + ); + } + function testInnerHTML(id, expected) { + var value = document.getElementById(id).innerHTML; + is(value, expected, id + ".innerHTML"); + } + + await copyChildrenToClipboard("draggable"); + testSelectionToString("This is a draggable bit of text."); + testClipboardValue("text/plain", "This is a draggable bit of text."); + testHtmlClipboardValue( + "text/html", + '
This is a draggable bit of text.
' + ); + testPasteText("This is a draggable bit of text."); + + await copyChildrenToClipboard("alist"); + testSelectionToString(" bla\n\n foo\n bar\n\n"); + testClipboardValue("text/plain", " bla\n\n foo\n bar\n\n"); + testHtmlClipboardValue( + "text/html", + '
\n bla\n
    \n
  • foo
  • \n \n
  • bar
  • \n
\n
' + ); + testPasteText(" bla\n\n foo\n bar\n\n"); + + await copyChildrenToClipboard("blist"); + testSelectionToString(" mozilla\n\n foo\n bar\n\n"); + testClipboardValue("text/plain", " mozilla\n\n foo\n bar\n\n"); + testHtmlClipboardValue( + "text/html", + '
\n mozilla\n
    \n
  1. foo
  2. \n \n
  3. bar
  4. \n
\n
' + ); + testPasteText(" mozilla\n\n foo\n bar\n\n"); + + await copyChildrenToClipboard("clist"); + testSelectionToString(" mzla\n\n foo\n bazzinga!\n bar\n\n"); + testClipboardValue( + "text/plain", + " mzla\n\n foo\n bazzinga!\n bar\n\n" + ); + testHtmlClipboardValue( + "text/html", + '
\n mzla\n
    \n
  • foo
      \n
    • bazzinga!
    • \n
  • \n \n
  • bar
  • \n
\n
' + ); + testPasteText(" mzla\n\n foo\n bazzinga!\n bar\n\n"); + + await copyChildrenToClipboard("div4"); + testSelectionToString(" Tt t t "); + testClipboardValue("text/plain", " Tt t t "); + if (isXHTML) { + testHtmlClipboardValue( + "text/html", + '
\n T\n
' + ); + testInnerHTML( + "div4", + '\n T\n' + ); + } else { + testHtmlClipboardValue( + "text/html", + '
\n T\n
' + ); + testInnerHTML("div4", "\n T\n"); + } + testPasteText(" Tt t t "); + + await copyChildrenToClipboard("div5"); + testSelectionToString(" T "); + testClipboardValue("text/plain", " T "); + if (isXHTML) { + testHtmlClipboardValue( + "text/html", + '
\n T\n
' + ); + testInnerHTML( + "div5", + '\n T\n' + ); + } else { + testHtmlClipboardValue( + "text/html", + '
\n T\n
' + ); + testInnerHTML("div5", "\n T\n"); + } + testPasteText(" T "); + + await copyRangeToClipboard( + $("div6").childNodes[0], + 0, + $("div6").childNodes[1], + 1, + suppressUnicodeCheckIfHidden + ); + testSelectionToString(""); + // START Disabled due to bug 564688 + if (false) { + testClipboardValue("text/plain", ""); + testClipboardValue("text/html", ""); + } + // END Disabled due to bug 564688 + testInnerHTML("div6", "div6"); + + await copyRangeToClipboard( + $("div7").childNodes[0], + 0, + $("div7").childNodes[0], + 4, + suppressUnicodeCheckIfHidden + ); + testSelectionToString(""); + // START Disabled due to bug 564688 + if (false) { + testClipboardValue("text/plain", ""); + testClipboardValue("text/html", ""); + } + // END Disabled due to bug 564688 + testInnerHTML("div7", "div7"); + + await copyRangeToClipboard( + $("div8").childNodes[0], + 0, + $("div8").childNodes[0], + 4, + suppressUnicodeCheckIfHidden + ); + testSelectionToString(""); + // START Disabled due to bug 564688 + if (false) { + testClipboardValue("text/plain", ""); + testClipboardValue("text/html", ""); + } + // END Disabled due to bug 564688 + testInnerHTML("div8", "div8"); + + await copyRangeToClipboard( + $("div9").childNodes[0], + 0, + $("div9").childNodes[0], + 4, + suppressUnicodeCheckIfHidden + ); + testSelectionToString("div9"); + testClipboardValue("text/plain", "div9"); + testHtmlClipboardValue("text/html", "div9"); + testInnerHTML("div9", "div9"); + + await copyToClipboard($("div10"), suppressUnicodeCheckIfHidden); + testSelectionToString(""); + testInnerHTML("div10", "div10"); + + await copyToClipboard($("div10").firstChild, suppressUnicodeCheckIfHidden); + testSelectionToString(""); + + await copyRangeToClipboard( + $("div10").childNodes[0], + 0, + $("div10").childNodes[0], + 1, + suppressUnicodeCheckIfHidden + ); + testSelectionToString(""); + + await copyRangeToClipboard( + $("div10").childNodes[1], + 0, + $("div10").childNodes[1], + 1, + suppressUnicodeCheckIfHidden + ); + testSelectionToString(""); + + if (!isXHTML) { + // ============ copy/paste multi-range selection (bug 1123505) + // with text start node + var sel = window.getSelection(); + sel.removeAllRanges(); + var r = document.createRange(); + var ul = $("ul1"); + var parent = ul.parentNode; + r.setStart(parent, 0); + r.setEnd(parent.firstChild, 15); + sel.addRange(r); //
{Copy1then Paste]
  • LI
  • \n
+ + r = document.createRange(); + r.setStart(ul, 1); + r.setEnd(parent, 2); + sel.addRange(r); //
Copy1then Paste
  • LI{
  • \n
}
+ await copySelectionToClipboard(true); + testPasteHTML("contentEditable1", "Copy1then Paste"); // The
    should not appear because it has no
  • s + + // with text end node + var sel = window.getSelection(); + sel.removeAllRanges(); + var r = document.createRange(); + var ul = $("ul2"); + var parent = ul.parentNode; + r.setStart(parent, 0); + r.setEnd(ul, 1); + sel.addRange(r); //
    {
      \n}
    • LI
    Copy2then Paste
    + + r = document.createRange(); + r.setStart(parent.childNodes[1], 0); + r.setEnd(parent, 2); + sel.addRange(r); //
      \n
    • LI
    [Copy2then Paste}
    + await copySelectionToClipboard(true); + testPasteHTML("contentEditable2", "Copy2then Paste"); // The
      should not appear because it has no
    • s + + // with text end node and non-empty start + var sel = window.getSelection(); + sel.removeAllRanges(); + var r = document.createRange(); + var ul = $("ul3"); + var parent = ul.parentNode; + r.setStart(parent, 0); + r.setEnd(ul, 1); + sel.addRange(r); //
      {
      • \n
      • }
      • LI
      Copy3then Paste
      + + r = document.createRange(); + r.setStart(parent.childNodes[1], 0); + r.setEnd(parent, 2); + sel.addRange(r); //
      • \n
      • LI
      [Copy3then Paste}
      + await copySelectionToClipboard(true); + testPasteHTML( + "contentEditable3", + '
      • \n
      Copy3then Paste' // The
        should appear because it has a
      • + ); + + // with elements of different depth + var sel = window.getSelection(); + sel.removeAllRanges(); + var r = document.createRange(); + var div1 = $("div1s"); + var parent = div1.parentNode; + r.setStart(parent, 0); + r.setEnd(document.getElementById("div1se1"), 1); // after the "inner" DIV + sel.addRange(r); + + r = document.createRange(); + r.setStart(div1.childNodes[1], 0); // the start of "after" + r.setEnd(parent, 1); + sel.addRange(r); + await copySelectionToClipboard(true); + testPasteHTML( + "contentEditable4", + '
        before
        after
        ' + ); + + // with elements of different depth, and a text node at the end + var sel = window.getSelection(); + sel.removeAllRanges(); + var r = document.createRange(); + var div1 = $("div2s"); + var parent = div1.parentNode; + r.setStart(parent, 0); + r.setEnd(document.getElementById("div2se1"), 1); // after the "inner" DIV + sel.addRange(r); + + r = document.createRange(); + r.setStart(div1.childNodes[1], 0); // the start of "after" + r.setEnd(parent, 1); + sel.addRange(r); + await copySelectionToClipboard(true); + testPasteHTML( + "contentEditable5", + '
        before
        after
        ' + ); + + // crash test for bug 1127835 + var e1 = document.getElementById("1127835crash1"); + var e2 = document.getElementById("1127835crash2"); + var e3 = document.getElementById("1127835crash3"); + var t1 = e1.childNodes[0]; + var t3 = e3.childNodes[0]; + + var sel = window.getSelection(); + sel.removeAllRanges(); + + var r = document.createRange(); + r.setStart(t1, 1); + r.setEnd(e2, 0); + sel.addRange(r); //
        \n1[
        }
        \n
        3\n
        + + r = document.createRange(); + r.setStart(e2, 1); + r.setEnd(t3, 0); + sel.addRange(r); //
        \n1
        \n
        {
        ]3\n
        + await copySelectionToClipboard(true); + testPasteHTML( + "contentEditable6", + '
        \n

        ' + ); // Don't strip the empty `` element because of avoiding any dataloss provided by the element + } + + // ============ copy/paste test from/to a textarea + + var val = "1\n 2\n 3"; + textarea.value = val; + textarea.select(); + await SimpleTest.promiseClipboardChange(textarea.value, () => { + textarea.editor.copy(); + }); + textarea.value = ""; + textarea.editor.paste(1); + is(textarea.value, val); + textarea.value = ""; + + // ============ NOSCRIPT should not be copied + + await copyChildrenToClipboard("div13"); + testSelectionToString("__"); + testClipboardValue("text/plain", "__"); + testHtmlClipboardValue("text/html", '
        __
        '); + testPasteText("__"); + + // ============ converting cell boundaries to tabs in tables + + await copyToClipboard($("tr1")); + testClipboardValue("text/plain", "foo\tbar"); + + if (!isXHTML) { + // ============ spanning multiple rows + + await copyRangeToClipboard($("tr2"), 0, $("tr3"), 0); + testClipboardValue("text/plain", "1\t2\n3\t4\n"); + testHtmlClipboardValue( + "text/html", + '
        12
        34
        ' + ); + + // ============ spanning multiple rows in multi-range selection + + clear(); + addRange($("tr2"), 0, $("tr2"), 2); + addRange($("tr3"), 0, $("tr3"), 2); + await copySelectionToClipboard(); + testClipboardValue("text/plain", "1\t2\n5\t6"); + testHtmlClipboardValue( + "text/html", + '
        12
        56
        ' + ); + } + + // ============ manipulating Selection in oncopy + + await copyRangeToClipboard( + $("div11").childNodes[0], + 0, + $("div11").childNodes[1], + 2 + ); + testClipboardValue("text/plain", "Xdiv11"); + testHtmlClipboardValue("text/html", "

        Xdiv11

        "); + + await new Promise(resolve => { + setTimeout(resolve, 0); + }); + testSelectionToString("div11"); + + await new Promise(resolve => { + setTimeout(resolve, 0); + }); + await copyRangeToClipboard( + $("div12").childNodes[0], + 0, + $("div12").childNodes[1], + 2 + ); + + testClipboardValue("text/plain", "Xdiv12"); + testHtmlClipboardValue("text/html", "

        Xdiv12

        "); + await new Promise(resolve => { + setTimeout(resolve, 0); + }); + testSelectionToString("div12"); + + await new Promise(resolve => { + setTimeout(resolve, 0); + }); + + if (!isXHTML) { + // ============ copy from ruby + + const ruby1 = $("ruby1"); + const ruby1Container = ruby1.parentNode; + + // Ruby annotation is included when selecting inside ruby. + await copyRangeToClipboard(ruby1, 0, ruby1, 6); + testClipboardValue("text/plain", "aabb(AABB)"); + + // Ruby annotation is ignored when selecting across ruby. + await copyRangeToClipboard(ruby1Container, 0, ruby1Container, 3); + testClipboardValue("text/plain", "XaabbY"); + + // ... unless converter.html2txt.always_include_ruby is set + await SpecialPowers.pushPrefEnv({ + set: [["converter.html2txt.always_include_ruby", true]], + }); + await copyRangeToClipboard(ruby1Container, 0, ruby1Container, 3); + testClipboardValue("text/plain", "Xaabb(AABB)Y"); + await SpecialPowers.popPrefEnv(); + } +} diff --git a/dom/base/test/delayedServerEvents.sjs b/dom/base/test/delayedServerEvents.sjs new file mode 100644 index 0000000000..cfc1bca508 --- /dev/null +++ b/dom/base/test/delayedServerEvents.sjs @@ -0,0 +1,56 @@ +// this will take strings_to_send.length*500 ms = 5 sec + +var timer = null; +var strings_to_send = [ + "retry:999999999\ndata\r\n\nda", + "ta", + ":", + "de", + "layed1\n\n", + "", + "", + "data:delayed2\n\n", + "", + "", +]; +var resp = null; + +function sendNextString() { + if (!strings_to_send.length) { + timer.cancel(); + resp.finish(); + timer = null; + resp = null; + return; + } + + try { + resp.write(strings_to_send.shift()); + } catch (e) { + timer.cancel(); + timer = null; + resp = null; + } +} + +function handleRequest(request, response) { + var bytes = strings_to_send.reduce((len, s) => len + s.length, 0); + + response.seizePower(); + response.write("HTTP/1.1 200 OK\r\n"); + response.write(`Content-Length: ${bytes}\r\n`); + response.write("Content-Type: text/event-stream; charset=utf-8\r\n"); + response.write("Cache-Control: no-cache, must-revalidate\r\n"); + response.write("\r\n"); + + resp = response; + + timer = Components.classes["@mozilla.org/timer;1"].createInstance( + Components.interfaces.nsITimer + ); + timer.initWithCallback( + sendNextString, + 500, + Components.interfaces.nsITimer.TYPE_REPEATING_SLACK + ); +} diff --git a/dom/base/test/dummy.html b/dom/base/test/dummy.html new file mode 100644 index 0000000000..1a87e28408 --- /dev/null +++ b/dom/base/test/dummy.html @@ -0,0 +1,9 @@ + + +Dummy test page + + + +

        Dummy test page

        + + diff --git a/dom/base/test/embed_bug455472.html b/dom/base/test/embed_bug455472.html new file mode 100644 index 0000000000..d244ea9396 --- /dev/null +++ b/dom/base/test/embed_bug455472.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/empty.html b/dom/base/test/empty.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dom/base/test/eventsource.resource b/dom/base/test/eventsource.resource new file mode 100644 index 0000000000..856e3b1aff --- /dev/null +++ b/dom/base/test/eventsource.resource @@ -0,0 +1,22 @@ +:this file must be enconded in utf8 +:and its Content-Type must be equal to text/event-stream + +retry:500 +data: 1 +unknow: unknow + +event: other_event_name +retry:500 +data: 1 +unknow: unknow + +event: click +retry:500 + +event: blur +retry:500 + +event:keypress +retry:500 + + diff --git a/dom/base/test/eventsource.resource^headers^ b/dom/base/test/eventsource.resource^headers^ new file mode 100644 index 0000000000..6a63b5341d --- /dev/null +++ b/dom/base/test/eventsource.resource^headers^ @@ -0,0 +1,3 @@ +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate + diff --git a/dom/base/test/eventsource_message.sjs b/dom/base/test/eventsource_message.sjs new file mode 100644 index 0000000000..d52e2ee432 --- /dev/null +++ b/dom/base/test/eventsource_message.sjs @@ -0,0 +1,12 @@ +function handleRequest(request, response) { + var match = request.queryString.match(/^status=(.*)$/); + var status = match ? +match[1] : 200; + + if (status != 200) { + response.setStatusLine(request.httpVersion, status, "Err"); + } + response.setHeader("Content-Type", "text/event-stream"); + response.setHeader("Cache-Control", "no-cache"); + response.write("data: msg 1\n"); + response.write("id: 1\n\n"); +} diff --git a/dom/base/test/eventsource_reconnect.sjs b/dom/base/test/eventsource_reconnect.sjs new file mode 100644 index 0000000000..6627fefa9f --- /dev/null +++ b/dom/base/test/eventsource_reconnect.sjs @@ -0,0 +1,18 @@ +function handleRequest(request, response) { + var name = "eventsource_reconnecting_" + request.queryString; + var reconnecting = getState(name); + var body = ""; + if (!reconnecting) { + body = "retry: 2\n"; + setState(name, "0"); + } else if (reconnecting === "0") { + setState(name, ""); + response.setStatusLine(request.httpVersion, 204, "No Content"); + } + + response.setHeader("Content-Type", "text/event-stream"); + response.setHeader("Cache-Control", "no-cache"); + + body += "data: 1\n\n"; + response.write(body); +} diff --git a/dom/base/test/eventsource_redirect.resource b/dom/base/test/eventsource_redirect.resource new file mode 100644 index 0000000000..d073527bfb --- /dev/null +++ b/dom/base/test/eventsource_redirect.resource @@ -0,0 +1,2 @@ +redirected + diff --git a/dom/base/test/eventsource_redirect.resource^headers^ b/dom/base/test/eventsource_redirect.resource^headers^ new file mode 100644 index 0000000000..eb79e2f814 --- /dev/null +++ b/dom/base/test/eventsource_redirect.resource^headers^ @@ -0,0 +1,3 @@ +HTTP 301 Moved Permanently +Location: eventsource_redirect_to.resource + diff --git a/dom/base/test/eventsource_redirect_to.resource b/dom/base/test/eventsource_redirect_to.resource new file mode 100644 index 0000000000..1eb4081ac1 --- /dev/null +++ b/dom/base/test/eventsource_redirect_to.resource @@ -0,0 +1,4 @@ +retry:500 +data: 1 + + diff --git a/dom/base/test/eventsource_redirect_to.resource^headers^ b/dom/base/test/eventsource_redirect_to.resource^headers^ new file mode 100644 index 0000000000..6a63b5341d --- /dev/null +++ b/dom/base/test/eventsource_redirect_to.resource^headers^ @@ -0,0 +1,3 @@ +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate + diff --git a/dom/base/test/eventsource_worker.js b/dom/base/test/eventsource_worker.js new file mode 100644 index 0000000000..863d52eec1 --- /dev/null +++ b/dom/base/test/eventsource_worker.js @@ -0,0 +1,6 @@ +const es = new EventSource( + "http://mochi.test:8888/tests/dom/base/test/eventsource_message.sjs" +); +es.onmessage = function () { + es.close(); +}; diff --git a/dom/base/test/fake_plugin.tst b/dom/base/test/fake_plugin.tst new file mode 100644 index 0000000000..b3d41aed8d --- /dev/null +++ b/dom/base/test/fake_plugin.tst @@ -0,0 +1 @@ +This is used in test_object.html to test loading by extension (.tst -> application/x-test). diff --git a/dom/base/test/file1_setting_opener.html b/dom/base/test/file1_setting_opener.html new file mode 100644 index 0000000000..6bc319bc9e --- /dev/null +++ b/dom/base/test/file1_setting_opener.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file2_setting_opener.html b/dom/base/test/file2_setting_opener.html new file mode 100644 index 0000000000..b0f383ad23 --- /dev/null +++ b/dom/base/test/file2_setting_opener.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file3_setting_opener.html b/dom/base/test/file3_setting_opener.html new file mode 100644 index 0000000000..a40a0706f9 --- /dev/null +++ b/dom/base/test/file3_setting_opener.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file4_setting_opener.html b/dom/base/test/file4_setting_opener.html new file mode 100644 index 0000000000..50b5b54a0e --- /dev/null +++ b/dom/base/test/file4_setting_opener.html @@ -0,0 +1 @@ +Loaded diff --git a/dom/base/test/file_audioLoop.html b/dom/base/test/file_audioLoop.html new file mode 100644 index 0000000000..d680c9a58f --- /dev/null +++ b/dom/base/test/file_audioLoop.html @@ -0,0 +1,2 @@ + +
        Mozilla Bug 1100912 +

        + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                
        1. +
        3 4
        +
        rtl on host
        2. +
        3 4
        +
        rtl on host, ltr slot's parent
        3. +
        3 4
        +
        rtl on host, ltr on slot
        4. +
        1 2
        +
        auto host, rtl in shadow
        5. +
        أخبار
        +
        auto host, rtl in host (in assigned node)
        6. +
        أخبار
        +
        auto host, rtl in host, no assigned node
        7. +
        أخبار
        +
        auto host, rtl in host, explicit ltr in shadow
        8. +
        ‎1 2 أخبار
        +
        auto host, ltr in host, rtl in host, reverse order in slots
        9. +
        أخبار
        +
        auto host, rtl in host (in assigned text node)
        10. +
        1 2
        +
        auto host, 1 2 in host (in assigned text node)
        + + + \ No newline at end of file diff --git a/dom/base/test/file_bug1198095.js b/dom/base/test/file_bug1198095.js new file mode 100644 index 0000000000..2b8c018de7 --- /dev/null +++ b/dom/base/test/file_bug1198095.js @@ -0,0 +1,38 @@ +/* eslint-env mozilla/chrome-script */ + +Cu.importGlobalProperties(["File"]); + +function createFileWithData(message) { + var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService( + Ci.nsIProperties + ); + var testFile = dirSvc.get("ProfD", Ci.nsIFile); + testFile.append("fileAPItestfileBug1198095"); + + var outStream = Cc[ + "@mozilla.org/network/file-output-stream;1" + ].createInstance(Ci.nsIFileOutputStream); + outStream.init( + testFile, + 0x02 | 0x08 | 0x20, // write, create, truncate + 0o666, + 0 + ); + + outStream.write(message, message.length); + outStream.close(); + + return File.createFromNsIFile(testFile); +} + +addMessageListener("file.open", function (message) { + createFileWithData(message).then(function (file) { + sendAsyncMessage("file.opened", file); + }); +}); + +addMessageListener("file.modify", function (message) { + createFileWithData(message).then(function (file) { + sendAsyncMessage("file.modified", file); + }); +}); diff --git a/dom/base/test/file_bug1250148.sjs b/dom/base/test/file_bug1250148.sjs new file mode 100644 index 0000000000..5f8037a08a --- /dev/null +++ b/dom/base/test/file_bug1250148.sjs @@ -0,0 +1,73 @@ +const CC = Components.Constructor; +const BinaryInputStream = CC( + "@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", + "setInputStream" +); + +function utf8decode(s) { + return decodeURIComponent(escape(s)); +} + +function utf8encode(s) { + return unescape(encodeURIComponent(s)); +} + +function handleRequest(request, response) { + var bodyStream = new BinaryInputStream(request.bodyInputStream); + + var requestBody = ""; + while ((bodyAvail = bodyStream.available()) > 0) { + requestBody += bodyStream.readBytes(bodyAvail); + } + + var result = []; + + if (request.method == "POST") { + var contentTypeParams = {}; + request + .getHeader("Content-Type") + .split(/\s*\;\s*/) + .forEach(function (str) { + if (str.indexOf("=") >= 0) { + let [name, value] = str.split("="); + contentTypeParams[name] = value; + } else { + contentTypeParams[""] = str; + } + }); + + if ( + contentTypeParams[""] == "multipart/form-data" && + request.queryString == "" + ) { + requestBody + .split("--" + contentTypeParams.boundary) + .slice(1, -1) + .forEach(function (s) { + let headers = {}; + let headerEnd = s.indexOf("\r\n\r\n"); + s.substr(2, headerEnd - 2) + .split("\r\n") + .forEach(function (str) { + // We're assuming UTF8 for now + let [name, value] = str.split(": "); + headers[name] = utf8decode(value); + }); + + let body = s.substring(headerEnd + 4, s.length - 2); + if ( + !headers["Content-Type"] || + headers["Content-Type"] == "text/plain" + ) { + // We're assuming UTF8 for now + body = utf8decode(body); + } + result.push({ headers, body }); + }); + } + } + + response.setHeader("Content-Type", "text/plain; charset=utf-8", false); + response.write(utf8encode(JSON.stringify(result))); +} diff --git a/dom/base/test/file_bug1268962.sjs b/dom/base/test/file_bug1268962.sjs new file mode 100644 index 0000000000..1aa06fadaa --- /dev/null +++ b/dom/base/test/file_bug1268962.sjs @@ -0,0 +1,92 @@ +// Test server for bug 1268962 +"use strict"; +Components.utils.importGlobalProperties(["URLSearchParams"]); +const HTTPStatus = new Map([ + [100, "Continue"], + [101, "Switching Protocol"], + [200, "OK"], + [201, "Created"], + [202, "Accepted"], + [203, "Non-Authoritative Information"], + [204, "No Content"], + [205, "Reset Content"], + [206, "Partial Content"], + [300, "Multiple Choice"], + [301, "Moved Permanently"], + [302, "Found"], + [303, "See Other"], + [304, "Not Modified"], + [305, "Use Proxy"], + [306, "unused"], + [307, "Temporary Redirect"], + [308, "Permanent Redirect"], + [400, "Bad Request"], + [401, "Unauthorized"], + [402, "Payment Required"], + [403, "Forbidden"], + [404, "Not Found"], + [405, "Method Not Allowed"], + [406, "Not Acceptable"], + [407, "Proxy Authentication Required"], + [408, "Request Timeout"], + [409, "Conflict"], + [410, "Gone"], + [411, "Length Required"], + [412, "Precondition Failed"], + [413, "Request Entity Too Large"], + [414, "Request-URI Too Long"], + [415, "Unsupported Media Type"], + [416, "Requested Range Not Satisfiable"], + [417, "Expectation Failed"], + [500, "Internal Server Error"], + [501, "Not Implemented"], + [502, "Bad Gateway"], + [503, "Service Unavailable"], + [504, "Gateway Timeout"], + [505, "HTTP Version Not Supported"], +]); + +const SAME_ORIGIN = + "http://mochi.test:8888/tests/dom/base/test/file_bug1268962.sjs"; +const CROSS_ORIGIN = + "http://example.com/tests/dom/base/test/file_bug1268962.sjs"; + +function handleRequest(request, response) { + const queryMap = new URLSearchParams(request.queryString); + + // Check redirection before everything else. + if (queryMap.has("redirect")) { + let redirect = queryMap.get("redirect"); + let location; + if (redirect == "sameorigin") { + location = SAME_ORIGIN; + } else if (redirect == "crossorigin") { + location = CROSS_ORIGIN; + } + + if (location) { + // Use HTTP 302 redirection. + response.setStatusLine("1.1", 302, HTTPStatus.get(302)); + + // Forward query strings except the redirect option. + queryMap.delete("redirect"); + response.setHeader("Location", location + "?" + queryMap.toString()); + + return; + } + } + + if (queryMap.has("statusCode")) { + let statusCode = parseInt(queryMap.get("statusCode")); + let statusText = HTTPStatus.get(statusCode); + response.setStatusLine("1.1", statusCode, statusText); + } + if (queryMap.has("cacheControl")) { + let cacheControl = queryMap.get("cacheControl"); + response.setHeader("Cache-Control", cacheControl); + } + if (queryMap.has("allowOrigin")) { + let allowOrigin = queryMap.get("allowOrigin"); + response.setHeader("Access-Control-Allow-Origin", allowOrigin); + } +} diff --git a/dom/base/test/file_bug1274806.html b/dom/base/test/file_bug1274806.html new file mode 100644 index 0000000000..62bef3044b --- /dev/null +++ b/dom/base/test/file_bug1274806.html @@ -0,0 +1,33 @@ + + + + + + + + +

        + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur elit nisi, convallis sed scelerisque sit amet, vestibulum eu odio. Pellentesque et quam et nibh sollicitudin rutrum. Fusce tristique hendrerit ligula, et euismod sapien facilisis quis. Donec tincidunt turpis tortor, in pharetra tellus euismod ac. Vestibulum consectetur nulla lacinia, consectetur mauris ac, tempus libero. Nam non dui id enim dapibus porta id sed lectus. Praesent at suscipit neque. Vestibulum tellus lorem, placerat et volutpat sed, elementum eget lacus. Sed interdum nisi et imperdiet varius. Sed non magna odio. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus velit risus, accumsan nec efficitur nec, semper sed arcu. Praesent consectetur lectus justo, fringilla imperdiet neque lobortis id. Donec efficitur pulvinar finibus. + +

        +

        test

        + + diff --git a/dom/base/test/file_bug1303838.html b/dom/base/test/file_bug1303838.html new file mode 100644 index 0000000000..d11444a449 --- /dev/null +++ b/dom/base/test/file_bug1303838.html @@ -0,0 +1,34 @@ + + + + + + Tests for tab switching on link clicks. + + + + Link 1, + Link 2, + Link 3, + Link 4, + Link 5, + Link 6, + Link 7, + Anchor Link 1, + Anchor Link 2, + Anchor Link 3, + Frame Link 1, + Frame Link 2, + Frame Link 3, + + diff --git a/dom/base/test/file_bug1303838_target.html b/dom/base/test/file_bug1303838_target.html new file mode 100644 index 0000000000..b1c8871f6b --- /dev/null +++ b/dom/base/test/file_bug1303838_target.html @@ -0,0 +1,21 @@ + + + + + + Tests for tab switching on link clicks. + + +
        Foo
        +
        Bar
        +
        Baz
        + + + + diff --git a/dom/base/test/file_bug1303838_target_bar.html b/dom/base/test/file_bug1303838_target_bar.html new file mode 100644 index 0000000000..2f1aa2bdef --- /dev/null +++ b/dom/base/test/file_bug1303838_target_bar.html @@ -0,0 +1 @@ +bar diff --git a/dom/base/test/file_bug1303838_target_baz.html b/dom/base/test/file_bug1303838_target_baz.html new file mode 100644 index 0000000000..7b4e4c0ef3 --- /dev/null +++ b/dom/base/test/file_bug1303838_target_baz.html @@ -0,0 +1 @@ +baz diff --git a/dom/base/test/file_bug1303838_target_foo.html b/dom/base/test/file_bug1303838_target_foo.html new file mode 100644 index 0000000000..f0ab6775c0 --- /dev/null +++ b/dom/base/test/file_bug1303838_target_foo.html @@ -0,0 +1 @@ +foo diff --git a/dom/base/test/file_bug1303838_target_ibar.html b/dom/base/test/file_bug1303838_target_ibar.html new file mode 100644 index 0000000000..4832b38ce6 --- /dev/null +++ b/dom/base/test/file_bug1303838_target_ibar.html @@ -0,0 +1 @@ +ibar diff --git a/dom/base/test/file_bug1303838_target_ibaz.html b/dom/base/test/file_bug1303838_target_ibaz.html new file mode 100644 index 0000000000..243b786a5b --- /dev/null +++ b/dom/base/test/file_bug1303838_target_ibaz.html @@ -0,0 +1 @@ +ibaz diff --git a/dom/base/test/file_bug1303838_target_ifoo.html b/dom/base/test/file_bug1303838_target_ifoo.html new file mode 100644 index 0000000000..b6c3a90e2e --- /dev/null +++ b/dom/base/test/file_bug1303838_target_ifoo.html @@ -0,0 +1 @@ +ifoo diff --git a/dom/base/test/file_bug1303838_with_iframe.html b/dom/base/test/file_bug1303838_with_iframe.html new file mode 100644 index 0000000000..d949ad7383 --- /dev/null +++ b/dom/base/test/file_bug1303838_with_iframe.html @@ -0,0 +1,13 @@ + + + + + + Tests for tab switching on link clicks. + + + + + diff --git a/dom/base/test/file_bug1554070_1.html b/dom/base/test/file_bug1554070_1.html new file mode 100644 index 0000000000..0294485293 --- /dev/null +++ b/dom/base/test/file_bug1554070_1.html @@ -0,0 +1,14 @@ + + + + + + Test for Bug 1554070 + + + + file_bug1554070_2.html + + diff --git a/dom/base/test/file_bug1554070_2.html b/dom/base/test/file_bug1554070_2.html new file mode 100644 index 0000000000..9287f535d4 --- /dev/null +++ b/dom/base/test/file_bug1554070_2.html @@ -0,0 +1,13 @@ + + + + + + Test for Bug 1554070 + + + example.org + + diff --git a/dom/base/test/file_bug1639328.html b/dom/base/test/file_bug1639328.html new file mode 100644 index 0000000000..97c96cf96c --- /dev/null +++ b/dom/base/test/file_bug1639328.html @@ -0,0 +1,8 @@ + + diff --git a/dom/base/test/file_bug1691214.html b/dom/base/test/file_bug1691214.html new file mode 100644 index 0000000000..e370166598 --- /dev/null +++ b/dom/base/test/file_bug1691214.html @@ -0,0 +1,4 @@ + +Open in window. +
        +Open in window. diff --git a/dom/base/test/file_bug1700871.html b/dom/base/test/file_bug1700871.html new file mode 100644 index 0000000000..3bc1808c66 --- /dev/null +++ b/dom/base/test/file_bug1700871.html @@ -0,0 +1,18 @@ + +Open in window. +
        + + +
        + diff --git a/dom/base/test/file_bug1703472.html b/dom/base/test/file_bug1703472.html new file mode 100644 index 0000000000..9607663bc3 --- /dev/null +++ b/dom/base/test/file_bug1703472.html @@ -0,0 +1,6 @@ + + + + diff --git a/dom/base/test/file_bug28293.sjs b/dom/base/test/file_bug28293.sjs new file mode 100644 index 0000000000..1b3e19402d --- /dev/null +++ b/dom/base/test/file_bug28293.sjs @@ -0,0 +1,4 @@ +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/plain", false); + response.write(decodeURIComponent(request.queryString)); +} diff --git a/dom/base/test/file_bug326337.xml b/dom/base/test/file_bug326337.xml new file mode 100644 index 0000000000..d328051e74 --- /dev/null +++ b/dom/base/test/file_bug326337.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_bug326337_inner.html b/dom/base/test/file_bug326337_inner.html new file mode 100644 index 0000000000..01a1929ac8 --- /dev/null +++ b/dom/base/test/file_bug326337_inner.html @@ -0,0 +1,44 @@ + + + + + Inner file for Bug 326337 + + + + + + diff --git a/dom/base/test/file_bug326337_outer.html b/dom/base/test/file_bug326337_outer.html new file mode 100644 index 0000000000..9d63f72632 --- /dev/null +++ b/dom/base/test/file_bug326337_outer.html @@ -0,0 +1,15 @@ + + + + + + + diff --git a/dom/base/test/file_bug357450.js b/dom/base/test/file_bug357450.js new file mode 100644 index 0000000000..6d0d703e78 --- /dev/null +++ b/dom/base/test/file_bug357450.js @@ -0,0 +1,74 @@ +/** Test for Bug 357450 **/ + +SimpleTest.waitForExplicitFinish(); + +function testGetElements(root, classtestCount) { + ok(root.getElementsByClassName, "getElementsByClassName exists"); + is( + typeof root.getElementsByClassName, + "function", + "getElementsByClassName is a function" + ); + + var nodes = root.getElementsByClassName("f"); + + is(typeof nodes.item, "function"); + is(typeof nodes.length, "number"); + is(nodes.length, 0, "string with no matching class should get an empty list"); + + nodes = root.getElementsByClassName("foo"); + ok(nodes, "should have nodelist object"); + + // HTML5 says ints are allowed in class names + // should match int class + + nodes = root.getElementsByClassName("1"); + is(nodes[0], $("int-class"), "match integer class name"); + nodes = root.getElementsByClassName([1]); + is(nodes[0], $("int-class"), "match integer class name 2"); + nodes = root.getElementsByClassName(["1 junk"]); + + is(nodes.length, 0, "two classes, but no elements have both"); + + nodes = root.getElementsByClassName("test1"); + is(nodes[0], $("test1"), "Id and class name turn up the same node"); + nodes = root.getElementsByClassName("test1 test2"); + is(nodes.length, 0, "two classes, but no elements have both"); + + // WHATWG examples + nodes = document.getElementById("example").getElementsByClassName("aaa"); + is(nodes.length, 2, "returns 2 elements"); + + nodes = document.getElementById("example").getElementsByClassName("ccc bbb"); + is( + nodes.length, + 1, + "only match elements that have all the classes specified in that array. tokenize string arg." + ); + is(nodes[0], $("p3"), "matched tokenized string"); + + nodes = document.getElementById("example").getElementsByClassName(""); + is(nodes.length, 0, "class name with empty string shouldn't return nodes"); + + nodes = root.getElementsByClassName({}); + ok(nodes, "bogus arg shouldn't be null"); + is(typeof nodes.item, "function"); + is(typeof nodes.length, "number"); + is(nodes.length, 0, "bogus arg should get an empty nodelist"); +} + +addLoadEvent(function () { + if (document.getElementsByName) { + var anchorNodes = document.getElementsByName("nametest"); + is(anchorNodes.length, 1, "getElementsByName still works"); + is( + anchorNodes[0].getAttribute("name"), + "nametest", + "getElementsByName still works" + ); + } + testGetElements($("content"), 1); + testGetElements(document.documentElement, 3); + testGetElements(document, 3); +}); +addLoadEvent(SimpleTest.finish); diff --git a/dom/base/test/file_bug416317.xhtml b/dom/base/test/file_bug416317.xhtml new file mode 100644 index 0000000000..e46c650cb1 --- /dev/null +++ b/dom/base/test/file_bug416317.xhtml @@ -0,0 +1,1468 @@ + + + + + selectorTest + + + body { background-color: green; } + .test > .blox1 { background-color: lime; } + + /* test 2 : attribute existence selector */ + /* attribute with a value */ + .blox2[align] { background-color: lime; } + /* attribute with empty value */ + .blox3[align] { background-color: lime; } + /* attribute with almost similar name */ + .blox4, .blox5 { background-color: lime } + .blox4[align], .blox5[align] { background-color: red; } + + /* test3 : attribute value selector */ + .blox6[align="center"] { background-color: lime; } + .blox6[align="c"] { background-color: red; } + .blox6[align="centera"] { background-color: red; } + .blox6[foo="\e9"] { background-color: lime; } + .blox6[\_foo="\e9"] { background-color: lime; } + + /* test 4 : [~=] */ + .blox7[class~="foo"] { background-color: lime; } + .blox8, .blox9, .blox10 { background-color: lime; } + .blox8[class~=""] { background-color: red; } + .blox9[foo~=""] { background-color: red; } + .blox10[foo~="foo"] { background-color: red; } + + /* test5 [^=] */ + .attrStart > .t3 { background-color: lime; } + .attrStart > .t1[class^="unit"] { background-color: lime; } + .attrStart > .t2 { background-color: lime; } + .attrStart > .t2[class^="nit"] { background-color: red; } + .attrStart > .t3[align^=""] { background-color: red; } + .attrStart > .t4[foo^="\e9"] { background-color: lime; } + + /* test6 [$=] */ + .attrEnd > .t3 { background-color: lime; } + .attrEnd > .t1[class$="t1"] { background-color: lime; } + .attrEnd > .t2 { background-color: lime; } + .attrEnd > .t2[class$="unit"] { background-color: red; } + .attrEnd > .t3[align$=""] { background-color: red; } + .attrEnd > .t4[foo$="\e9"] { background-color: lime; } + + /* test7 [*=] */ + .attrMiddle > .t3 { background-color: lime; } + .attrMiddle > .t1[class*="t t"] { background-color: lime; } + .attrMiddle > .t2 { background-color: lime; } + .attrMiddle > .t2[class*="a"] { background-color: red; } + .attrMiddle > .t3[align*=""] { background-color: red; } + .attrMiddle > .t4[foo*="\e9"] { background-color: lime; } + + /* :first-child tests */ + .firstChild .unitTest:first-child { background-color: lime; } + .blox12:first-child { background-color: red; } + .blox13:first-child { background-color: red; } + .blox12, .blox13 { background-color: lime } + + /* :root tests */ + :root { background-color: green; } + + /* :scope tests */ + :scope { background-color: green; } + + /* :nth-child(n) tests */ + .nthchild1 > :nth-last-child(odd) { background-color: lime; } + .nthchild1 > :nth-child(odd) { background-color: lime; } + + .nthchild2 > :nth-last-child(even) { background-color: lime; } + .nthchild2 > :nth-child(even) { background-color: lime; } + + .nthchild3 > :nth-child(3n+2) { background-color: lime; } + .nthchild3 > :nth-last-child(3n+1) { background-color: lime; } + .nthchild3 > :nth-last-child(3n+3) { background-color: lime; } + + .nthoftype1 > div:nth-of-type(odd) { background-color: lime; } + .nthoftype1 > div:nth-last-of-type(odd) { background-color: lime; } + .nthoftype1 > p { background-color: green; } + + .nthoftype2 > div:nth-of-type(even) { background-color: lime; } + .nthoftype2 > div:nth-last-of-type(even) { background-color: lime; } + .nthoftype2 > p { background-color: green; } + + .nthoftype3 > div:nth-of-type(3n+1) { background-color: lime; } + .nthoftype3 > div:nth-last-of-type(3n+1) { background-color: lime; } + .nthoftype3 > div:nth-last-of-type(3n+2) { background-color: lime; } + .nthoftype3 > p { background-color: green; } + + /* :not() tests */ + .blox14:not(span) { background-color: lime; } + .blox15:not([foo="blox14"]) { background-color: lime; } + .blox16:not(.blox15) { background-color: lime; } + + /* :only-of-type tests */ + .blox17:only-of-type { background-color: lime; } + .blox18:only-of-type { background-color: red; } + .blox18:not(:only-of-type) { background-color: lime; } + + /* :last-child tests */ + .lastChild > :last-child { background-color: lime } + .lastChild > :not(:last-child) { background-color: lime } + + /* :first-of-type tests */ + .firstOfType > *:first-of-type { background-color: lime; } + *.firstOfType > :not(:first-of-type) { background-color: lime; } + + /* :last-of-type tests */ + .lastOfType > *:last-of-type { background-color: lime; } + *.lastOfType > :not(:last-of-type) { background-color: lime; } + + /* :only-child tests */ + .onlyChild > *:not(:only-child) { background-color: lime; } + .onlyChild > .unitTest > *:only-child { background-color: lime; } + + /* :only-of-type tests */ + .onlyOfType *:only-of-type { background-color: lime; } + .onlyOfType *:not(:only-of-type) { background-color: lime; } + + /* :empty tests */ + .empty > *.isEmpty:empty { background-color: lime; color: lime; } + .empty > .isNotEmpty { background-color: blue; color: blue; } + .empty > .isNotEmpty:empty { background-color: red; color: red; } + .empty > .isNotEmpty:not(:empty) { background-color: lime; color: lime; } + + /* :lang() tests */ + .lang :lang(en) { background-color: lime; } + .lang :lang(fr) { background-color: lime; } + .lang .t1 { background-color: blue; } + .lang .t1:lang(es) { background-color: lime; } + .lang :lang(es-AR) { background-color: red; } + + /* [|=] tests */ + .attrLang .t1 { background-color: lime; } + .attrLang .t1[lang|="en"] { background-color: red; } + .attrLang [lang|="fr"] { background-color: lime; } + .attrLang .t2[lang|="en"] { background-color: lime; } + .attrLang .t3 { background-color: blue; } + .attrLang .t3[lang|="es"] { background-color: lime; } + .attrLang [lang|="es-AR"] { background-color: red; } + + /* UI tests */ + .UI .t1:enabled > .unitTest { background-color: lime; } + .UI .t2:disabled > .unitTest { background-color: lime; } + .UI .t3:checked + div { background-color: lime; } + .UI .t4:not(:checked) + div { background-color: lime; } + + /* ~ combinator tests */ + .tilda .t1 { background-color: white; } + .tilda .t1 ~ .unitTest { background-color: lime; } + .tilda .t1:hover ~ .unitTest { background-color: red; } + + /* ~ combinator tests */ + .plus .t1, .plus .t2 { background-color: white; } + .plus .t1 + .unitTest + .unitTest { background-color: lime; } + .plus .t1:hover + .unitTest + .unitTest { background-color: red; } + ]]> + + /* Tests from http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20060307/html/index.html */ + + div, { background: red; } + .5cm { background: red; } + [*=test] { background: red; } + [*|*=test] { background: red; } + + div:subject { background: red; } + :canvas { background: red; } + :viewport { background: red; } + :window { background: red; } + :menu { background: red; } + :table { background: red; } + :select { background: red; } + ::canvas { background: red; } + ::viewport { background: red; } + ::window { background: red; } + ::menu { background: red; } + ::table { background: red; } + ::select { background: red; } + + ..test { background: red; color: yellow; } + .foo..quux { background: red; color: yellow; } + .bar. { background: red; color: yellow; } + + + + +

        Selectors API Test Suite

        +

        Testrunner by John Resig, tests by John Resig, Disruptive Innovations, W3C CSS Working Group, jQuery JavaScript Library.

        +
        +
        +

        CSS 3 Selectors tests

        +

        (c) Disruptive Innovations 2008
        + Last update: 2008-06-06

        +
        + +
        +
        +
        + +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +

        +

        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +

        +

        +
        +

        +
        +
        +
        +
        +
        +

        +

        +
        +

        +
        +
        +
        +
        +
        +

        +

        +
        +

        +
        +
        +

        +
        +
        +
        + +
        +

        +
          +
        + +
        +

        +
        +

        +
        +
        + +
        +

        +
        +

        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +

        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
         
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        + + +
        +
        +
        + the previous square should be green when the checkbox is checked and become red when you uncheck it +
        +
        +
        + the previous square should be green when the checkbox is NOT checked and become red when you check it +
        + +
        +
        +
        +
        +
        + the three last squares should be green and become red when the pointer hovers over the white square +
        +
        +
        +
        +
        + the last square should be green and become red when the pointer hovers over the FIRST white square +
        +
        +
        +
        +

        CSS 3 Selectors tests

        +

        (c) Disruptive Innovations 2008
        + Last update: 2008-06-06

        +
        + +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +

        +

        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +

        +

        +
        +

        +
        +
        +
        +
        +
        +

        +

        +
        +

        +
        +
        +
        +
        +
        +

        +

        +
        +

        +
        +
        +

        +
        +
        +
        + +
        +

        +
          +
        + +
        +

        +
        +

        +
        +
        + +
        +

        +
        +

        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +

        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
         
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + +
        + + +
        +
        +
        + the previous square should be green when the checkbox is checked and become red when you uncheck it +
        +
        +
        + the previous square should be green when the checkbox is NOT checked and become red when you check it +
        + +
        +
        +
        +
        +
        + the three last squares should be green and become red when the pointer hovers over the white square +
        +
        +
        +
        +
        + the last square should be green and become red when the pointer hovers over the FIRST white square +
        +
        +
        +
        + + + Example circle01 - circle filled with red and stroked with blue + + + + + + Example circle01 - circle filled with red and stroked with blue + + + + + + Example circle01 - circle filled with red and stroked with blue + + + +
        + +

        jQuery Test Suite

        + +

        + + +
        + +
        +
        + + + + + + + + +
          +
          +
            + + diff --git a/dom/base/test/file_bug426646-1.html b/dom/base/test/file_bug426646-1.html new file mode 100644 index 0000000000..4319311b08 --- /dev/null +++ b/dom/base/test/file_bug426646-1.html @@ -0,0 +1,37 @@ + +Bug 426646, Using location.replace breaks iframe history + + + + diff --git a/dom/base/test/file_bug426646-2.html b/dom/base/test/file_bug426646-2.html new file mode 100644 index 0000000000..2da090b32f --- /dev/null +++ b/dom/base/test/file_bug426646-2.html @@ -0,0 +1,65 @@ + +Bug 426646, Using location.replace breaks iframe history + + + + diff --git a/dom/base/test/file_bug428847-1.xhtml b/dom/base/test/file_bug428847-1.xhtml new file mode 100644 index 0000000000..b88701ece2 --- /dev/null +++ b/dom/base/test/file_bug428847-1.xhtml @@ -0,0 +1,4 @@ + + + + diff --git a/dom/base/test/file_bug428847-2.xhtml b/dom/base/test/file_bug428847-2.xhtml new file mode 100644 index 0000000000..75c60b7792 --- /dev/null +++ b/dom/base/test/file_bug428847-2.xhtml @@ -0,0 +1,4 @@ + + + + diff --git a/dom/base/test/file_bug498897.css b/dom/base/test/file_bug498897.css new file mode 100644 index 0000000000..84beffdefc --- /dev/null +++ b/dom/base/test/file_bug498897.css @@ -0,0 +1 @@ +body { background: orange; } diff --git a/dom/base/test/file_bug498897.html b/dom/base/test/file_bug498897.html new file mode 100644 index 0000000000..b0d36f4ca5 --- /dev/null +++ b/dom/base/test/file_bug498897.html @@ -0,0 +1,23 @@ + + + Testcase for bug 498897 + + + + + diff --git a/dom/base/test/file_bug498897.html^headers^ b/dom/base/test/file_bug498897.html^headers^ new file mode 100644 index 0000000000..09b46ca4ee --- /dev/null +++ b/dom/base/test/file_bug498897.html^headers^ @@ -0,0 +1 @@ +Link: ; rel=stylesheet diff --git a/dom/base/test/file_bug503473-frame.sjs b/dom/base/test/file_bug503473-frame.sjs new file mode 100644 index 0000000000..f642241091 --- /dev/null +++ b/dom/base/test/file_bug503473-frame.sjs @@ -0,0 +1,22 @@ +function handleRequest(request, response) { + response.processAsync(); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + response.setHeader("Cache-Control", "no-cache", false); + + response.write( + "" + + "
            " + + "" + ); + + response.bodyOutputStream.flush(); + // leave the stream open +} diff --git a/dom/base/test/file_bug503481.sjs b/dom/base/test/file_bug503481.sjs new file mode 100644 index 0000000000..9aaeb31744 --- /dev/null +++ b/dom/base/test/file_bug503481.sjs @@ -0,0 +1,54 @@ +// 'timer' is global to avoid getting GCed which would cancel the timer +var timer; +const nsITimer = Components.interfaces.nsITimer; + +function attemptUnblock(s) { + try { + let blockedResponse = null; + getObjectState("bug503481_" + s, function (x) { + blockedResponse = x.wrappedJSObject.r; + }); + blockedResponse.finish(); + setObjectState("bug503481_" + s, null); + } catch (e) { + dump("unable to unblock " + s + "retrying in half a second\n"); + timer = Components.classes["@mozilla.org/timer;1"].createInstance(nsITimer); + timer.initWithCallback( + function () { + attemptUnblock(s); + }, + 500, + nsITimer.TYPE_ONE_SHOT + ); + } +} + +function handleRequest(request, response) { + var query = {}; + request.queryString.split("&").forEach(function (val) { + var [name, value] = val.split("="); + query[name] = unescape(value); + }); + + dump("processing:" + request.queryString + "\n"); + + if (query.unblock) { + attemptUnblock(query.unblock); + } + + if (query.blockOn) { + response.processAsync(); + x = { + r: response, + QueryInterface(iid) { + return this; + }, + }; + x.wrappedJSObject = x; + setObjectState("bug503481_" + query.blockOn, x); + } + + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.write(query.body); +} diff --git a/dom/base/test/file_bug503481b_inner.html b/dom/base/test/file_bug503481b_inner.html new file mode 100644 index 0000000000..6b34bc47b6 --- /dev/null +++ b/dom/base/test/file_bug503481b_inner.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/file_bug518104.js b/dom/base/test/file_bug518104.js new file mode 100644 index 0000000000..72a684522f --- /dev/null +++ b/dom/base/test/file_bug518104.js @@ -0,0 +1,3 @@ +document.write("

            "); +parent.done(); +document.close(); diff --git a/dom/base/test/file_bug541937.html b/dom/base/test/file_bug541937.html new file mode 100644 index 0000000000..93056754f9 --- /dev/null +++ b/dom/base/test/file_bug541937.html @@ -0,0 +1,7 @@ + + Test + foo + + +

            Hello world

            + \ No newline at end of file diff --git a/dom/base/test/file_bug541937.xhtml b/dom/base/test/file_bug541937.xhtml new file mode 100644 index 0000000000..f4e5f3d320 --- /dev/null +++ b/dom/base/test/file_bug541937.xhtml @@ -0,0 +1,12 @@ + + + + + Test + foo + + + +

            Hello world

            + + \ No newline at end of file diff --git a/dom/base/test/file_bug557892.html b/dom/base/test/file_bug557892.html new file mode 100644 index 0000000000..4b91ddafdd --- /dev/null +++ b/dom/base/test/file_bug557892.html @@ -0,0 +1,25 @@ + +Crash [@ nsGenericElement::SetAttr] with classList.toggle + + + + + + + diff --git a/dom/base/test/file_bug562137.txt b/dom/base/test/file_bug562137.txt new file mode 100644 index 0000000000..4a21b817e5 --- /dev/null +++ b/dom/base/test/file_bug562137.txt @@ -0,0 +1 @@ +I have nbsp diff --git a/dom/base/test/file_bug590812-ref.xhtml b/dom/base/test/file_bug590812-ref.xhtml new file mode 100644 index 0000000000..7309425fb4 --- /dev/null +++ b/dom/base/test/file_bug590812-ref.xhtml @@ -0,0 +1,3 @@ +
            <out>Here be sea hags</out>
            diff --git a/dom/base/test/file_bug590812.xml b/dom/base/test/file_bug590812.xml new file mode 100644 index 0000000000..759d5066cf --- /dev/null +++ b/dom/base/test/file_bug590812.xml @@ -0,0 +1 @@ +Here be sea hags diff --git a/dom/base/test/file_bug590870.html b/dom/base/test/file_bug590870.html new file mode 100644 index 0000000000..4432b01d3c --- /dev/null +++ b/dom/base/test/file_bug590870.html @@ -0,0 +1,16 @@ + + + + + + Here be dragons! + + diff --git a/dom/base/test/file_bug601803a.html b/dom/base/test/file_bug601803a.html new file mode 100644 index 0000000000..c39ff7219e --- /dev/null +++ b/dom/base/test/file_bug601803a.html @@ -0,0 +1,22 @@ + + + + Test for Bug 601803 + + + + + + diff --git a/dom/base/test/file_bug601803b.html b/dom/base/test/file_bug601803b.html new file mode 100644 index 0000000000..0363654c06 --- /dev/null +++ b/dom/base/test/file_bug601803b.html @@ -0,0 +1,11 @@ + + + + Test for Bug 601803 + + + + + diff --git a/dom/base/test/file_bug604660-1.xml b/dom/base/test/file_bug604660-1.xml new file mode 100644 index 0000000000..231b4357d6 --- /dev/null +++ b/dom/base/test/file_bug604660-1.xml @@ -0,0 +1,3 @@ + + + diff --git a/dom/base/test/file_bug604660-2.xsl b/dom/base/test/file_bug604660-2.xsl new file mode 100644 index 0000000000..16611726ce --- /dev/null +++ b/dom/base/test/file_bug604660-2.xsl @@ -0,0 +1,19 @@ + + + + + + XSLT script execution test + + + + + + + + + + + + + diff --git a/dom/base/test/file_bug604660-3.js b/dom/base/test/file_bug604660-3.js new file mode 100644 index 0000000000..c11ae68f28 --- /dev/null +++ b/dom/base/test/file_bug604660-3.js @@ -0,0 +1 @@ +parent.scriptRan(2); diff --git a/dom/base/test/file_bug604660-4.js b/dom/base/test/file_bug604660-4.js new file mode 100644 index 0000000000..2bd5b43e5b --- /dev/null +++ b/dom/base/test/file_bug604660-4.js @@ -0,0 +1 @@ +parent.scriptRan(4); diff --git a/dom/base/test/file_bug604660-5.xml b/dom/base/test/file_bug604660-5.xml new file mode 100644 index 0000000000..58c6382836 --- /dev/null +++ b/dom/base/test/file_bug604660-5.xml @@ -0,0 +1,2 @@ + + diff --git a/dom/base/test/file_bug604660-6.xsl b/dom/base/test/file_bug604660-6.xsl new file mode 100644 index 0000000000..4a75777d90 --- /dev/null +++ b/dom/base/test/file_bug604660-6.xsl @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dom/base/test/file_bug622088.sjs b/dom/base/test/file_bug622088.sjs new file mode 100644 index 0000000000..87acdc3b8b --- /dev/null +++ b/dom/base/test/file_bug622088.sjs @@ -0,0 +1,5 @@ +function handleRequest(request, response) { + // Echos the referrer back to the requester. + response.setHeader("Content-Type", "text/plain", false); + response.write(request.getHeader("Referer")); +} diff --git a/dom/base/test/file_bug622088_inner.html b/dom/base/test/file_bug622088_inner.html new file mode 100644 index 0000000000..e89273d89b --- /dev/null +++ b/dom/base/test/file_bug622088_inner.html @@ -0,0 +1,38 @@ + + + + + + + + + + + diff --git a/dom/base/test/file_bug675121.sjs b/dom/base/test/file_bug675121.sjs new file mode 100644 index 0000000000..29fef155df --- /dev/null +++ b/dom/base/test/file_bug675121.sjs @@ -0,0 +1,19 @@ +var timer; + +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.write("Responded"); + response.processAsync(); + timer = Components.classes["@mozilla.org/timer;1"].createInstance( + Components.interfaces.nsITimer + ); + timer.initWithCallback( + function () { + response.finish(); + // 50ms certainly be enough for one refresh driver firing to happen! + }, + 50, + Components.interfaces.nsITimer.TYPE_ONE_SHOT + ); +} diff --git a/dom/base/test/file_bug687859-16.js b/dom/base/test/file_bug687859-16.js new file mode 100644 index 0000000000..58f82cdda3 Binary files /dev/null and b/dom/base/test/file_bug687859-16.js differ diff --git a/dom/base/test/file_bug687859-16.js^headers^ b/dom/base/test/file_bug687859-16.js^headers^ new file mode 100644 index 0000000000..e0d4fce5d0 --- /dev/null +++ b/dom/base/test/file_bug687859-16.js^headers^ @@ -0,0 +1 @@ +Content-Type: text/javascript; charset=tis-620 diff --git a/dom/base/test/file_bug687859-bom.js b/dom/base/test/file_bug687859-bom.js new file mode 100644 index 0000000000..7536004bb6 --- /dev/null +++ b/dom/base/test/file_bug687859-bom.js @@ -0,0 +1 @@ +var stringFromBomScript = "€"; diff --git a/dom/base/test/file_bug687859-bom.js^headers^ b/dom/base/test/file_bug687859-bom.js^headers^ new file mode 100644 index 0000000000..e0d4fce5d0 --- /dev/null +++ b/dom/base/test/file_bug687859-bom.js^headers^ @@ -0,0 +1 @@ +Content-Type: text/javascript; charset=tis-620 diff --git a/dom/base/test/file_bug687859-charset.js b/dom/base/test/file_bug687859-charset.js new file mode 100644 index 0000000000..e812a1e37f --- /dev/null +++ b/dom/base/test/file_bug687859-charset.js @@ -0,0 +1 @@ +var stringFromCharsetScript = "¡"; \ No newline at end of file diff --git a/dom/base/test/file_bug687859-http.js b/dom/base/test/file_bug687859-http.js new file mode 100644 index 0000000000..1b1456d480 --- /dev/null +++ b/dom/base/test/file_bug687859-http.js @@ -0,0 +1 @@ +var stringFromHttpScript = "ä"; diff --git a/dom/base/test/file_bug687859-http.js^headers^ b/dom/base/test/file_bug687859-http.js^headers^ new file mode 100644 index 0000000000..e0d4fce5d0 --- /dev/null +++ b/dom/base/test/file_bug687859-http.js^headers^ @@ -0,0 +1 @@ +Content-Type: text/javascript; charset=tis-620 diff --git a/dom/base/test/file_bug687859-inherit.js b/dom/base/test/file_bug687859-inherit.js new file mode 100644 index 0000000000..b83f60b2fb --- /dev/null +++ b/dom/base/test/file_bug687859-inherit.js @@ -0,0 +1 @@ +var stringFromInheritScript = "¡"; \ No newline at end of file diff --git a/dom/base/test/file_bug692434.xml b/dom/base/test/file_bug692434.xml new file mode 100644 index 0000000000..2d559c3aed --- /dev/null +++ b/dom/base/test/file_bug692434.xml @@ -0,0 +1 @@ +Þ diff --git a/dom/base/test/file_bug704320_preload_attr.html b/dom/base/test/file_bug704320_preload_attr.html new file mode 100644 index 0000000000..e10f1727df --- /dev/null +++ b/dom/base/test/file_bug704320_preload_attr.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/file_bug704320_preload_common.js b/dom/base/test/file_bug704320_preload_common.js new file mode 100644 index 0000000000..c7a409e297 --- /dev/null +++ b/dom/base/test/file_bug704320_preload_common.js @@ -0,0 +1,32 @@ +// Common code for the iframes used by bug704320_preload. + +var loadCount = 0; + +// Called by the various onload handlers to indicate that a resource has +// been fully loaded. We require three loads to complete (img, script, +// link) for this test. +function incrementLoad(tag) { + loadCount++; + if (loadCount == 3) { + window.parent.postMessage("childLoadComplete", window.location.origin); + } else if (loadCount > 3) { + document.write("

            Too Many Load Events!

            "); + window.parent.postMessage("childOverload", window.location.origin); + } +} + +// This is same as incrementLoad, but the caller passes in the loadCount. +function incrementLoad2(tag, expectedLoadCount) { + loadCount++; + if (loadCount == expectedLoadCount) { + window.parent.postMessage("childLoadComplete", window.location.origin); + } else if (loadCount > expectedLoadCount) { + document.write("

            Too Many Load Events!

            "); + window.parent.postMessage("childOverload", window.location.origin); + } +} + +// in case something fails to load, cause the test to fail. +function postfail(msg) { + window.parent.postMessage("fail-" + msg, window.location.origin); +} diff --git a/dom/base/test/file_bug704320_preload_reuse.html b/dom/base/test/file_bug704320_preload_reuse.html new file mode 100644 index 0000000000..5643e3d8d6 --- /dev/null +++ b/dom/base/test/file_bug704320_preload_reuse.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/file_bug704320_redirect.html b/dom/base/test/file_bug704320_redirect.html new file mode 100644 index 0000000000..09ed05d6fd --- /dev/null +++ b/dom/base/test/file_bug704320_redirect.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/dom/base/test/file_bug707142_baseline.json b/dom/base/test/file_bug707142_baseline.json new file mode 100644 index 0000000000..8c850a5fd2 --- /dev/null +++ b/dom/base/test/file_bug707142_baseline.json @@ -0,0 +1 @@ +{ "foo": "bar" } diff --git a/dom/base/test/file_bug707142_bom.json b/dom/base/test/file_bug707142_bom.json new file mode 100644 index 0000000000..e961357349 --- /dev/null +++ b/dom/base/test/file_bug707142_bom.json @@ -0,0 +1 @@ +{ "foo": "bar" } diff --git a/dom/base/test/file_bug707142_utf-16.json b/dom/base/test/file_bug707142_utf-16.json new file mode 100644 index 0000000000..eb28f6bb7e Binary files /dev/null and b/dom/base/test/file_bug707142_utf-16.json differ diff --git a/dom/base/test/file_bug708620-2.html b/dom/base/test/file_bug708620-2.html new file mode 100644 index 0000000000..86899201df --- /dev/null +++ b/dom/base/test/file_bug708620-2.html @@ -0,0 +1,4 @@ + + +Non-UTF form target + diff --git a/dom/base/test/file_bug708620.html b/dom/base/test/file_bug708620.html new file mode 100644 index 0000000000..a90e6aeeba --- /dev/null +++ b/dom/base/test/file_bug708620.html @@ -0,0 +1,7 @@ + + +Non-UTF form + +
            + +
            diff --git a/dom/base/test/file_bug753278.html b/dom/base/test/file_bug753278.html new file mode 100644 index 0000000000..922bc0c658 --- /dev/null +++ b/dom/base/test/file_bug753278.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_bug769117.html b/dom/base/test/file_bug769117.html new file mode 100644 index 0000000000..424f8dff1c --- /dev/null +++ b/dom/base/test/file_bug769117.html @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/dom/base/test/file_bug782342.txt b/dom/base/test/file_bug782342.txt new file mode 100644 index 0000000000..3b18e512db --- /dev/null +++ b/dom/base/test/file_bug782342.txt @@ -0,0 +1 @@ +hello world diff --git a/dom/base/test/file_bug787778.sjs b/dom/base/test/file_bug787778.sjs new file mode 100644 index 0000000000..d22d67d9c9 --- /dev/null +++ b/dom/base/test/file_bug787778.sjs @@ -0,0 +1,7 @@ +function handleRequest(request, response) { + response.processAsync(); + response.setHeader("Content-Type", "text/plain", false); + response.setHeader("X-Frame-Options", "DENY", false); + + response.finish(); +} diff --git a/dom/base/test/file_bug869432.eventsource b/dom/base/test/file_bug869432.eventsource new file mode 100644 index 0000000000..de92d4dd86 --- /dev/null +++ b/dom/base/test/file_bug869432.eventsource @@ -0,0 +1,4 @@ +retry:500 +data: data + + diff --git a/dom/base/test/file_bug869432.eventsource^headers^ b/dom/base/test/file_bug869432.eventsource^headers^ new file mode 100644 index 0000000000..b8db77c582 --- /dev/null +++ b/dom/base/test/file_bug869432.eventsource^headers^ @@ -0,0 +1,3 @@ +HTTP 304 NO CONTENT (CLOSE) +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate \ No newline at end of file diff --git a/dom/base/test/file_bug902350.html b/dom/base/test/file_bug902350.html new file mode 100644 index 0000000000..2101f80c7d --- /dev/null +++ b/dom/base/test/file_bug902350.html @@ -0,0 +1,19 @@ + + + + + + Test for Bug 902350 + + + +
            + +
            + + + + diff --git a/dom/base/test/file_bug902350_frame.html b/dom/base/test/file_bug902350_frame.html new file mode 100644 index 0000000000..183dabe255 --- /dev/null +++ b/dom/base/test/file_bug902350_frame.html @@ -0,0 +1,14 @@ + + + + + + Tests for Mixed Content Frame Navigation + + +Go to http site + + diff --git a/dom/base/test/file_bug907892.html b/dom/base/test/file_bug907892.html new file mode 100644 index 0000000000..9f5948661c --- /dev/null +++ b/dom/base/test/file_bug907892.html @@ -0,0 +1,12 @@ + + diff --git a/dom/base/test/file_bug945152.jar b/dom/base/test/file_bug945152.jar new file mode 100644 index 0000000000..eb732980d9 Binary files /dev/null and b/dom/base/test/file_bug945152.jar differ diff --git a/dom/base/test/file_bug945152_worker.js b/dom/base/test/file_bug945152_worker.js new file mode 100644 index 0000000000..9664045b6d --- /dev/null +++ b/dom/base/test/file_bug945152_worker.js @@ -0,0 +1,99 @@ +var gData1 = "TEST_DATA_1:ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +var gData2 = "TEST_DATA_2:1234567890"; +var gPaddingChar = "."; +var gPaddingSize = 10000; +var gPadding = ""; + +for (var i = 0; i < gPaddingSize; i++) { + gPadding += gPaddingChar; +} + +function ok(a, msg) { + postMessage({ type: "status", status: !!a, msg }); +} + +function is(a, b, msg) { + postMessage({ type: "status", status: a === b, msg }); +} + +function checkData(response, data_head, cb) { + ok(response, "Data is non-null"); + var str = String.fromCharCode.apply(null, new Uint8Array(response)); + ok(str.length == data_head.length + gPaddingSize, "Data size is correct"); + ok(str.slice(0, data_head.length) == data_head, "Data head is correct"); + ok(str.slice(data_head.length) == gPadding, "Data padding is correct"); + cb(); +} + +self.onmessage = function onmessage(event) { + var jar = event.data; + + function makeJarURL(entry) { + return "jar:" + jar + "!/" + entry; + } + + function test_mapped_sync() { + var xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true }); + xhr.open("GET", makeJarURL("data_1.txt"), false); + xhr.responseType = "arraybuffer"; + xhr.send(); + if (xhr.status) { + ok(xhr.status == 200, "Status is 200"); + var ct = xhr.getResponseHeader("Content-Type"); + ok(ct.includes("mem-mapped"), "Data is memory-mapped"); + checkData(xhr.response, gData1, runTests); + } + } + + function test_mapped_async() { + var xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true }); + xhr.open("GET", makeJarURL("data_1.txt")); + xhr.responseType = "arraybuffer"; + xhr.onreadystatechange = function () { + if (xhr.readyState !== xhr.DONE) { + return; + } + if (xhr.status) { + ok(xhr.status == 200, "Status is 200"); + var ct = xhr.getResponseHeader("Content-Type"); + ok(ct.includes("mem-mapped"), "Data is memory-mapped"); + checkData(xhr.response, gData1, runTests); + } + }; + xhr.send(); + } + + // Make sure array buffer retrieved from compressed file in package is + // handled by memory allocation instead of memory mapping. + function test_non_mapped() { + var xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true }); + xhr.open("GET", makeJarURL("data_2.txt")); + xhr.responseType = "arraybuffer"; + xhr.onreadystatechange = function () { + if (xhr.readyState !== xhr.DONE) { + return; + } + if (xhr.status) { + ok(xhr.status == 200, "Status is 200"); + var ct = xhr.getResponseHeader("Content-Type"); + ok(!ct.includes("mem-mapped"), "Data is not memory-mapped"); + checkData(xhr.response, gData2, runTests); + } + }; + xhr.send(); + } + + var tests = [test_mapped_sync, test_mapped_async, test_non_mapped]; + + function runTests() { + if (!tests.length) { + postMessage({ type: "finish" }); + return; + } + + var test = tests.shift(); + test(); + } + + runTests(); +}; diff --git a/dom/base/test/file_change_policy_redirect.html b/dom/base/test/file_change_policy_redirect.html new file mode 100644 index 0000000000..e48386d97c --- /dev/null +++ b/dom/base/test/file_change_policy_redirect.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/dom/base/test/file_current_inner_window.html b/dom/base/test/file_current_inner_window.html new file mode 100644 index 0000000000..8156e29000 --- /dev/null +++ b/dom/base/test/file_current_inner_window.html @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/dom/base/test/file_delazification_strategy.html b/dom/base/test/file_delazification_strategy.html new file mode 100644 index 0000000000..a8f58c60f1 --- /dev/null +++ b/dom/base/test/file_delazification_strategy.html @@ -0,0 +1,10 @@ + + + + + Add a tag script to check delazification strategy + + + + + diff --git a/dom/base/test/file_delazification_strategy.js b/dom/base/test/file_delazification_strategy.js new file mode 100644 index 0000000000..5afcbeed53 --- /dev/null +++ b/dom/base/test/file_delazification_strategy.js @@ -0,0 +1,91 @@ +function baz() {} +function bar() {} +function foo() { + bar(); +} +foo(); + +// For testing, we require the script to be parsed off-htread. To schedule a +// script off-thread, we require the script to be at least 5 KB. Thus, here is +// one comment which is used to trick this heuristics: +// +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWX0Oxoc;,.... ....,;coxO0XWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX0kdlc;'.. ..';:ldk0XWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKkoc,.. ..,cok0NWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKko:'. .':okKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKkl,. .,lkKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOo;. .;oONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXkl'. 'lkXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOl' 'lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMWKo, ,oKWMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMNk:. .:kNMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMXx, ,xXMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMWXd' 'dXWMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMXd' 'dXMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMNx' 'xNMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMWO; ;OWMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMKl. .lXMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMWk, ,kWMMMMMMMMMMMMM +// MMMMMMMMMMMMXo. .lXMMMMMMMMMMMM +// MMMMMMMMMMW0; ...... ;0WMMMMMMMMMM +// MMMMMMMMMWk' ..,:loxxkOOkxdo:,. 'kWMMMMMMMMM +// MMMMMMMMWx. .':lxO000000000000000ko;. .xWMMMMMMMM +// MMMMMMMNd. .'cdk00000000000000000000000x;. ..',;ccloodddddddollc:;,'.. .dNMMMMMMM +// MMMMMMNd. ,dO000000000000000000000000000Oo' ..;coxk00000000000000000000000Okdlc;'. .dNMMMMMM +// MMMMMNd. .cO000000000000000000000000000000k; .;lxO0000000000000000000000000000000000Okoc,. .dWMMMMM +// MMMMWx. .'cO0000000000000000000000000000Oc. .;ok0000K00000000000000000000000000000000000000ko, .kWMMMM +// MMMMO' ,kK0000000000000000000000000000Oc. .:x000000000000000OkdoollcccllodxkO0000K00000000000k' 'OMMMM +// MMMK; .'lO000000000000000000000000000000Ol'... 'd000000000000Odl;'.. ..',:ldkO00000000KO, ;KMMM +// MMNo ,dkO0K00000000000000000000000000000000OOkxdoc;,,ck0000000000Oo;. .'ck000000KO; oNMM +// MMk. .o0000000000000000000000000000000000000000000000000000000000d, .o000000K0: .OMM +// MX: .o00000000000000000000000000000000000000000000000000000000Oc. c000000K0l. :XM +// Wx. .c00000000000000000000000000000000000000000000000000000000x, :OK000000o. .xW +// X: .:dxO00000000000000000000000000000000000000000000000000000Oo' ,k0000000d. :X +// O. .:xOO0000000000000000000000000000000000000000000000000000Ol. .x000000Kd. .O +// o ..'''''''',,:lx000000000000000000000000000000000000000000x, .lOOOOkkko. o +// ; .:x00000000000000000000000000000000000000000O:. ......... ; +// . 'd00000000000000000000000000000000000000000Ol. . +// . ,k000000000000000000000000000000000000000000o. . +// .o0000000000000000000000000000000000000000000d. +// c00000000000000000000000000000000000000000000o. +// ;OK0000000000000000000000000000000000000000000o. +// ,kK00000000000000000000000000000000000000000000xoc:,'.. +// .x00000000000000000000000000000000000000000000000000Okxolc;,'.. +// .d000000000000000K000000000000000000000000000000000000000000OOxdl:,.. +// . .o00000000000000OO0000000000000000000000000000000000000000000000000Oxo:'. . +// . .l0000000000000Oc:k0000000000000000000000000000000000000000000000000000Oxl,. . +// ; c000000000000Kk, ,x000000000000000000000000000000xodkO00000000000000000000xc. ; +// o ..''.. :000000000000Kx' ,k0000000000000000000000000000Oc. ..';codkO000000000000000k:. o +// O. .,lxO00Okxl:,. :O000000000000d. ;k0000000000000000000000000000l. ..,cok0000000000000d' .O +// X: ,d000000000000kdc;. :O000000000000l. .c0000000000000000000000000000o. .;oO00000000000k; :X +// Wx. 'x00000000000000000Oxl;..:O00000000000O: .x000000000000000000000000000d. 'oO00000K0000k, .kW +// MX: c0000000000000000000000Oxk00000000000Kk, cO00000000000000000000000000d. ;k0000000000d. :XM +// MMO. :O000000000000000000000000000000000000x. cO00000000000000000000000000d. ,k000000000O: .OMM +// MMNo .d000000000000000000000000000000000000l. .d000000000000000000000000000o. cO000000000o. .oNMM +// MMMK; 'd00000000000000000000000000000000000c ,k000000000000000000000000000l. 'x000000000d. ;KMMM +// MMMMO' .lO000000000000000000000000000000000kl;. .o00000000000000000000000000K0c .d000000000d. 'OMMMM +// MMMMWx. ;x00000000000000000000000000000000000ko:lO000000000000000000000000000O; .x000000000d. .xWMMMM +// MMMMMWd. .ck00000000000000000000000000000000000000000000000000000000000000000k, ;kK00000000l. .dWMMMMM +// MMMMMMNd. .:x000000000000000000000000000000000000000000000000000000000000000d. .o000000000O; .dNMMMMMM +// MMMMMMMNd. .;dO000000000000000000000000000000000000000000000000000000000000l. .o0000000000d. .dNMMMMMMM +// MMMMMMMMWx. .,,'.. 'cx00000000000000000000000000000000000000000000000000000000KO: .;d0000000000x, .xWMMMMMMMM +// MMMMMMMMMWk' 'd00Oxdl;'. .,lx000000000000000000000000000000000000000000000000000000k' .:dO0000000000x, 'kWMMMMMMMMM +// MMMMMMMMMMW0; .:x000000kd:'. .,lk000000000000000000000000000000000000000000000000000d. ..,cdk0K000000000Oo. :0WMMMMMMMMMM +// MMMMMMMMMMMMXo. .,ok000000Odc. ,x000000000000000000000000000000000000000000000000000d,...'',;:cldxO000000000000K0d;. .oXMMMMMMMMMMMM +// MMMMMMMMMMMMMWk, .:x0000000Oo;.. .,oO000000000000000000000000000000000000000000000000000000OOOO00000000000000000000Od;. ,kWMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMXl. .;dO0000000Oxdoooxk0000000000OxxO0000000000000000000000000000000000000000000000000000000000000000Oxc' .lXMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMWO; 'lk00000000000000000000Oxc' ..:oxO0K000000000000000000000000000000000000000000000000000000Oko:'. ;OWMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMNx, .;ok00000000000000kdc'. ..;cdxO00000000000000000000000000000000000000000000Okxdoc;'. ,xNMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMXd' .,:ldxkkkkxdl:,. ..,:cldxkkkO000000000000Okkxdlc:;;;:::::;;;,,'... 'dXMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMXd' ...... ....'',,,,,,,,'.... 'dXWMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMXx,. ,xXMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMNk:. .:kNMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMWKo,. .,oKWMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOl' 'lONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMXkl'. .'lkXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOo;. .;oONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKkl;. .,lkKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKko:'. .':okKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKkoc,.. ..,cok0NWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX0kdlc;'.. ..';:ldk0XWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWX0Oxoc;,.... ....,;coxO0XNWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM diff --git a/dom/base/test/file_domwindowutils_animation.html b/dom/base/test/file_domwindowutils_animation.html new file mode 100644 index 0000000000..dfcc8fc05c --- /dev/null +++ b/dom/base/test/file_domwindowutils_animation.html @@ -0,0 +1,217 @@ + + + + + DOMWindowUtils test with animation + + + + + + + diff --git a/dom/base/test/file_domwindowutils_dynamic_toolbar.html b/dom/base/test/file_domwindowutils_dynamic_toolbar.html new file mode 100644 index 0000000000..becb4bf08f --- /dev/null +++ b/dom/base/test/file_domwindowutils_dynamic_toolbar.html @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/dom/base/test/file_empty.html b/dom/base/test/file_empty.html new file mode 100644 index 0000000000..495c23ec8a --- /dev/null +++ b/dom/base/test/file_empty.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_explicit_user_agent.sjs b/dom/base/test/file_explicit_user_agent.sjs new file mode 100644 index 0000000000..33b9a5c505 --- /dev/null +++ b/dom/base/test/file_explicit_user_agent.sjs @@ -0,0 +1,6 @@ +function handleRequest(request, response) { + if (request.hasHeader("User-Agent")) { + response.setHeader("Result-User-Agent", request.getHeader("User-Agent")); + } + response.write(""); +} diff --git a/dom/base/test/file_external_script.html b/dom/base/test/file_external_script.html new file mode 100644 index 0000000000..16f059d558 --- /dev/null +++ b/dom/base/test/file_external_script.html @@ -0,0 +1,11 @@ + + + + + + + + +

            Hello Mochitest

            + + diff --git a/dom/base/test/file_external_script.xhtml b/dom/base/test/file_external_script.xhtml new file mode 100644 index 0000000000..4327c499cb --- /dev/null +++ b/dom/base/test/file_external_script.xhtml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/dom/base/test/file_focus_display_none_xorigin_iframe_inner.html b/dom/base/test/file_focus_display_none_xorigin_iframe_inner.html new file mode 100644 index 0000000000..5831df882c --- /dev/null +++ b/dom/base/test/file_focus_display_none_xorigin_iframe_inner.html @@ -0,0 +1,15 @@ + + +

            Inner

            +
            + diff --git a/dom/base/test/file_focus_shadow_dom.html b/dom/base/test/file_focus_shadow_dom.html new file mode 100644 index 0000000000..6fa9d1b88e --- /dev/null +++ b/dom/base/test/file_focus_shadow_dom.html @@ -0,0 +1,999 @@ + + + Test for Bug 1453693 + + + + + + + + + diff --git a/dom/base/test/file_general_document.html b/dom/base/test/file_general_document.html new file mode 100644 index 0000000000..2539669de9 --- /dev/null +++ b/dom/base/test/file_general_document.html @@ -0,0 +1,10 @@ + + + + +General document for testing + + +

            Hello mochitest!

            + + diff --git a/dom/base/test/file_history_document_open.html b/dom/base/test/file_history_document_open.html new file mode 100644 index 0000000000..b9f05f7c2c --- /dev/null +++ b/dom/base/test/file_history_document_open.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_htmlserializer_1.html b/dom/base/test/file_htmlserializer_1.html new file mode 100644 index 0000000000..9576b5d7d6 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1.html @@ -0,0 +1,44 @@ + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_bodyonly.html b/dom/base/test/file_htmlserializer_1_bodyonly.html new file mode 100644 index 0000000000..848167c62a --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_bodyonly.html @@ -0,0 +1,43 @@ + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_format.html b/dom/base/test/file_htmlserializer_1_format.html new file mode 100644 index 0000000000..09f80467e4 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_format.html @@ -0,0 +1,57 @@ + + + + + Test for html serializer + + +

            Hello world

            +

            Lorem ipsum dolor sit amet, consectetuer + adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis + ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent + taciti sociosqu ad litora torquent per conubia + nostra, per inceptos hymenaeos.

            +
              +
            • Nam tellus massa,éàèçù
            • +
            • fringilla aliquam,
            • +
            • fermentum sit amet,
            • +
            • posuere ac,
            • +
            • est.
            • +
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + +
              +
            1. Fusce a ipsum
            2. +
            3. non lacus posuere aliquet.
            4. +
            5. Sed fermentum posuere nulla
            6. +
            7. Donec tempor.
            8. +
            + Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            + ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus + aliquet lectus. Nunc vitae eros. Class aptent taciti

            + + diff --git a/dom/base/test/file_htmlserializer_1_linebreak.html b/dom/base/test/file_htmlserializer_1_linebreak.html new file mode 100644 index 0000000000..8194b8b415 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_linebreak.html @@ -0,0 +1,47 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_links.html b/dom/base/test/file_htmlserializer_1_links.html new file mode 100644 index 0000000000..f0864c940c --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_links.html @@ -0,0 +1,47 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            diff --git a/dom/base/test/file_htmlserializer_1_nested_body.html b/dom/base/test/file_htmlserializer_1_nested_body.html new file mode 100644 index 0000000000..94f67547e3 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_nested_body.html @@ -0,0 +1,47 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            this is an other body element

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_no_body.html b/dom/base/test/file_htmlserializer_1_no_body.html new file mode 100644 index 0000000000..9c749721b1 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_no_body.html @@ -0,0 +1,5 @@ + + + Test for html serializer + + \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_noflag.html b/dom/base/test/file_htmlserializer_1_noflag.html new file mode 100644 index 0000000000..8194b8b415 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_noflag.html @@ -0,0 +1,47 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_noformatpre.html b/dom/base/test/file_htmlserializer_1_noformatpre.html new file mode 100644 index 0000000000..aba95b62c8 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_noformatpre.html @@ -0,0 +1,51 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            +
            + Cras quis
            +
            + nisi at odio
            +
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, 
            +
            +lacus risus pulvinar ante.
            +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_raw.html b/dom/base/test/file_htmlserializer_1_raw.html new file mode 100644 index 0000000000..c646f26963 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_raw.html @@ -0,0 +1,45 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_sibling_body.html b/dom/base/test/file_htmlserializer_1_sibling_body.html new file mode 100644 index 0000000000..f533e6679a --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_sibling_body.html @@ -0,0 +1,47 @@ + + + Test for html serializer + +

            this is an other body element

            +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_sibling_body_only_body.html b/dom/base/test/file_htmlserializer_1_sibling_body_only_body.html new file mode 100644 index 0000000000..97c1625156 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_sibling_body_only_body.html @@ -0,0 +1,43 @@ +

            this is an other body element

            +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_1_wrap.html b/dom/base/test/file_htmlserializer_1_wrap.html new file mode 100644 index 0000000000..4552e9cba5 --- /dev/null +++ b/dom/base/test/file_htmlserializer_1_wrap.html @@ -0,0 +1,52 @@ + + + Test for html serializer + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu + ad + litora torquent per + conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum +posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros leo ut libero +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus +aliquet lectus. Nunc vitae eros. Class aptent taciti

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_2.html b/dom/base/test/file_htmlserializer_2.html new file mode 100644 index 0000000000..2156b1610c --- /dev/null +++ b/dom/base/test/file_htmlserializer_2.html @@ -0,0 +1,22 @@ +Test for html serializer with entities + + +

            The basic set is just   & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ +Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø +Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê +ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý +þ ÿ

            +

            symbols, math.. ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ +Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς +σ τ υ φ χ ψ ω ϑ ϒ ϖ • … ′ ″ ‾ ⁄ ℘ ℑ ℜ +™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉ +∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ ⌉ ⌊ ⌋ ◊ ♠ ♣ ♥ ♦ +

            +

            others +Œ œ Š š Ÿ ˆ ˜       ‌ ‍ ‎ ‏–— ‘ ’ +‚“ ” „ † ‡ ‰ ‹ › € +

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_2_basic.html b/dom/base/test/file_htmlserializer_2_basic.html new file mode 100644 index 0000000000..56ac95dfdd --- /dev/null +++ b/dom/base/test/file_htmlserializer_2_basic.html @@ -0,0 +1,24 @@ + + +Test for html serializer with entities + + +

            The basic set is just   & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À à Â Ã Ä Å Æ +Ç È É Ê Ë Ì à Î à à Ñ Ò Ó Ô Õ Ö × Ø +Ù Ú Û Ü à Þ ß à á â ã ä å æ ç è é ê +ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý +þ ÿ

            +

            symbols, math.. Æ’ Α Î’ Γ Δ Ε Ζ Η Θ Ι Κ Λ Îœ ΠΞ Ο Π Ρ Σ Τ Î¥ +Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο Ï€ Ï Ï‚ +σ Ï„ Ï… φ χ ψ ω Ï‘ Ï’ Ï– • … ′ ″ ‾ ℠℘ â„‘ â„œ +â„¢ ℵ ↠↑ → ↓ ↔ ↵ ⇠⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉ +∋ ∠∑ − ∗ √ ∠∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ â‹… ⌈ ⌉ ⌊ ⌋ â—Š â™  ♣ ♥ ♦ +

            +

            others +Å’ Å“ Å  Å¡ Ÿ ˆ Ëœ       ‌ †‎ â€â€“— ‘ ’ +‚“ †„ † ‡ ‰ ‹ › € +

            \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_ipv6.html b/dom/base/test/file_htmlserializer_ipv6.html new file mode 100644 index 0000000000..298493e718 --- /dev/null +++ b/dom/base/test/file_htmlserializer_ipv6.html @@ -0,0 +1,5 @@ + + Testcase for IPv6 addresses + + Test + \ No newline at end of file diff --git a/dom/base/test/file_htmlserializer_ipv6_out.html b/dom/base/test/file_htmlserializer_ipv6_out.html new file mode 100644 index 0000000000..675a406d85 --- /dev/null +++ b/dom/base/test/file_htmlserializer_ipv6_out.html @@ -0,0 +1,6 @@ + + + Testcase for IPv6 addresses + + Test + \ No newline at end of file diff --git a/dom/base/test/file_inline_script.html b/dom/base/test/file_inline_script.html new file mode 100644 index 0000000000..838c70f946 --- /dev/null +++ b/dom/base/test/file_inline_script.html @@ -0,0 +1,11 @@ + + + + + + + + +

            Hello Mochitest

            + + diff --git a/dom/base/test/file_inline_script.xhtml b/dom/base/test/file_inline_script.xhtml new file mode 100644 index 0000000000..525daf29fe --- /dev/null +++ b/dom/base/test/file_inline_script.xhtml @@ -0,0 +1,11 @@ + + + + + + +</head> +<body> + <p>Hello Mochitest</p> +</body> +</html> diff --git a/dom/base/test/file_js_cache.html b/dom/base/test/file_js_cache.html new file mode 100644 index 0000000000..6feb94d872 --- /dev/null +++ b/dom/base/test/file_js_cache.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>Add a tag script to save the bytecode + + + + + diff --git a/dom/base/test/file_js_cache.js b/dom/base/test/file_js_cache.js new file mode 100644 index 0000000000..b9b966775c --- /dev/null +++ b/dom/base/test/file_js_cache.js @@ -0,0 +1,5 @@ +function baz() {} +function bar() {} +function foo() { bar() } +foo(); + diff --git a/dom/base/test/file_js_cache_module.html b/dom/base/test/file_js_cache_module.html new file mode 100644 index 0000000000..36d549c945 --- /dev/null +++ b/dom/base/test/file_js_cache_module.html @@ -0,0 +1,13 @@ + + + + + Load the script as a module + + + + + + diff --git a/dom/base/test/file_js_cache_save_after_load.html b/dom/base/test/file_js_cache_save_after_load.html new file mode 100644 index 0000000000..8a696c0026 --- /dev/null +++ b/dom/base/test/file_js_cache_save_after_load.html @@ -0,0 +1,10 @@ + + + + + Save the bytecode when all scripts are executed + + + + + diff --git a/dom/base/test/file_js_cache_save_after_load.js b/dom/base/test/file_js_cache_save_after_load.js new file mode 100644 index 0000000000..7f5a20b524 --- /dev/null +++ b/dom/base/test/file_js_cache_save_after_load.js @@ -0,0 +1,15 @@ +function send_ping() { + window.dispatchEvent(new Event("ping")); +} +send_ping(); // ping (=1) + +window.addEventListener("load", function () { + send_ping(); // ping (=2) + + // Append a script which should call |foo|, before the encoding of this script + // bytecode. + var script = document.createElement("script"); + script.type = "text/javascript"; + script.innerText = "send_ping();"; // ping (=3) + document.head.appendChild(script); +}); diff --git a/dom/base/test/file_js_cache_syntax_error.html b/dom/base/test/file_js_cache_syntax_error.html new file mode 100644 index 0000000000..cc4a9b2daa --- /dev/null +++ b/dom/base/test/file_js_cache_syntax_error.html @@ -0,0 +1,10 @@ + + + + + Do not save bytecode on compilation errors + + + + + diff --git a/dom/base/test/file_js_cache_syntax_error.js b/dom/base/test/file_js_cache_syntax_error.js new file mode 100644 index 0000000000..fcf587ae70 --- /dev/null +++ b/dom/base/test/file_js_cache_syntax_error.js @@ -0,0 +1 @@ +var // SyntaxError: missing variable name. diff --git a/dom/base/test/file_js_cache_with_sri.html b/dom/base/test/file_js_cache_with_sri.html new file mode 100644 index 0000000000..38ecb26984 --- /dev/null +++ b/dom/base/test/file_js_cache_with_sri.html @@ -0,0 +1,12 @@ + + + + + Add a tag script to save the bytecode + + + + + diff --git a/dom/base/test/file_location_href_unknown_protocol.html b/dom/base/test/file_location_href_unknown_protocol.html new file mode 100644 index 0000000000..10c994fbde --- /dev/null +++ b/dom/base/test/file_location_href_unknown_protocol.html @@ -0,0 +1,15 @@ + + diff --git a/dom/base/test/file_lock_orientation_with_pending_fullscreen.html b/dom/base/test/file_lock_orientation_with_pending_fullscreen.html new file mode 100644 index 0000000000..07af0fc67d --- /dev/null +++ b/dom/base/test/file_lock_orientation_with_pending_fullscreen.html @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/dom/base/test/file_messagemanager_unload.html b/dom/base/test/file_messagemanager_unload.html new file mode 100644 index 0000000000..f01e60bae2 --- /dev/null +++ b/dom/base/test/file_messagemanager_unload.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/dom/base/test/file_module_js_cache.html b/dom/base/test/file_module_js_cache.html new file mode 100644 index 0000000000..ecf14903d9 --- /dev/null +++ b/dom/base/test/file_module_js_cache.html @@ -0,0 +1,10 @@ + + + + + Add a tag module script to save the bytecode + + + + + diff --git a/dom/base/test/file_module_js_cache.js b/dom/base/test/file_module_js_cache.js new file mode 100644 index 0000000000..1b08386c81 --- /dev/null +++ b/dom/base/test/file_module_js_cache.js @@ -0,0 +1,6 @@ +function baz() {} +function bar() {} +function foo() { + bar(); +} +foo(); diff --git a/dom/base/test/file_module_js_cache_no_module.html b/dom/base/test/file_module_js_cache_no_module.html new file mode 100644 index 0000000000..fd5e23fb37 --- /dev/null +++ b/dom/base/test/file_module_js_cache_no_module.html @@ -0,0 +1,10 @@ + + + + + Load the module script as a regular script + + + + + diff --git a/dom/base/test/file_module_js_cache_with_sri.html b/dom/base/test/file_module_js_cache_with_sri.html new file mode 100644 index 0000000000..60b2ca4f7a --- /dev/null +++ b/dom/base/test/file_module_js_cache_with_sri.html @@ -0,0 +1,12 @@ + + + + + Add a tag module script to save the bytecode + + + + + diff --git a/dom/base/test/file_mozfiledataurl_img.jpg b/dom/base/test/file_mozfiledataurl_img.jpg new file mode 100644 index 0000000000..dcd99b9670 Binary files /dev/null and b/dom/base/test/file_mozfiledataurl_img.jpg differ diff --git a/dom/base/test/file_navigator_resolve_identity_xrays.xhtml b/dom/base/test/file_navigator_resolve_identity_xrays.xhtml new file mode 100644 index 0000000000..bdce7c7b64 --- /dev/null +++ b/dom/base/test/file_navigator_resolve_identity_xrays.xhtml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/dom/base/test/file_receiveMessage.html b/dom/base/test/file_receiveMessage.html new file mode 100644 index 0000000000..66f421270f --- /dev/null +++ b/dom/base/test/file_receiveMessage.html @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/dom/base/test/file_restrictedEventSource.sjs b/dom/base/test/file_restrictedEventSource.sjs new file mode 100644 index 0000000000..b7ca11002a --- /dev/null +++ b/dom/base/test/file_restrictedEventSource.sjs @@ -0,0 +1,69 @@ +function handleRequest(request, response) { + if ( + (request.queryString == "test=user1_xhr" && + request.hasHeader("Authorization") && + request.getHeader("Authorization") == "Basic dXNlciAxOnBhc3N3b3JkIDE=") || + (request.queryString == "test=user1_evtsrc" && + request.hasHeader("Authorization") && + request.getHeader("Authorization") == "Basic dXNlciAxOnBhc3N3b3JkIDE=") + ) { + response.setStatusLine(null, 200, "OK"); + response.setHeader("Content-Type", "text/event-stream", false); + response.setHeader( + "Access-Control-Allow-Origin", + "http://mochi.test:8888", + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + response.setHeader("Cache-Control", "no-cache, must-revalidate", false); + if (request.queryString == "test=user1_xhr") { + response.setHeader("Set-Cookie", "test=5c", false); + } + response.write("event: message\ndata: 1\n\n"); + } else if ( + (request.queryString == "test=user2_xhr" && + request.hasHeader("Authorization") && + request.getHeader("Authorization") == "Basic dXNlciAyOnBhc3N3b3JkIDI=") || + (request.queryString == "test=user2_evtsrc" && + request.hasHeader("Authorization") && + request.getHeader("Authorization") == "Basic dXNlciAyOnBhc3N3b3JkIDI=" && + request.hasHeader("Cookie") && + request.getHeader("Cookie") == "test=5d") + ) { + response.setStatusLine(null, 200, "OK"); + response.setHeader("Content-Type", "text/event-stream", false); + response.setHeader( + "Access-Control-Allow-Origin", + "http://mochi.test:8888", + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + response.setHeader("Cache-Control", "no-cache, must-revalidate", false); + if (request.queryString == "test=user2_xhr") { + response.setHeader("Set-Cookie", "test=5d", false); + } + response.write("event: message\ndata: 1\n\n"); + } else if ( + request.queryString == "test=user1_xhr" || + request.queryString == "test=user2_xhr" + ) { + response.setStatusLine(null, 401, "Unauthorized"); + response.setHeader("WWW-Authenticate", 'basic realm="restricted"', false); + response.setHeader( + "Access-Control-Allow-Origin", + "http://mochi.test:8888", + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + response.write("Unauthorized"); + } else { + response.setStatusLine(null, 403, "Forbidden"); + response.setHeader( + "Access-Control-Allow-Origin", + "http://mochi.test:8888", + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + response.write("Forbidden"); + } +} diff --git a/dom/base/test/file_sandbox_and_document_uri.html b/dom/base/test/file_sandbox_and_document_uri.html new file mode 100644 index 0000000000..ac23cd1fec --- /dev/null +++ b/dom/base/test/file_sandbox_and_document_uri.html @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/dom/base/test/file_script.js b/dom/base/test/file_script.js new file mode 100644 index 0000000000..3e15525fa6 --- /dev/null +++ b/dom/base/test/file_script.js @@ -0,0 +1 @@ +window.scriptRan = true; diff --git a/dom/base/test/file_script_module_dynamic_and_element.html b/dom/base/test/file_script_module_dynamic_and_element.html new file mode 100644 index 0000000000..dce909fcf9 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_element.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_dynamic_and_element.js b/dom/base/test/file_script_module_dynamic_and_element.js new file mode 100644 index 0000000000..4f5c707a4c --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_element.js @@ -0,0 +1,19 @@ +const { f } = await import( + "./file_script_module_dynamic_and_element_imported_1.js" +); +import { g } from "./file_script_module_dynamic_and_element_imported_2.js"; +import { h } from "./file_script_module_dynamic_and_element_imported_3.js"; +f(); +g(); +h(); + +let script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute( + "src", + "file_script_module_dynamic_and_element_imported_1.js" +); +document.body.appendChild(script); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_dynamic_and_element_imported_1.js b/dom/base/test/file_script_module_dynamic_and_element_imported_1.js new file mode 100644 index 0000000000..0be3913c65 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_element_imported_1.js @@ -0,0 +1,6 @@ +import { g } from "./file_script_module_dynamic_and_element_imported_2.js"; +import { h } from "./file_script_module_dynamic_and_element_imported_3.js"; +g(); +h(); + +export function f() {} diff --git a/dom/base/test/file_script_module_dynamic_and_element_imported_2.js b/dom/base/test/file_script_module_dynamic_and_element_imported_2.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_element_imported_2.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_dynamic_and_element_imported_3.js b/dom/base/test/file_script_module_dynamic_and_element_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_element_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_script_module_dynamic_and_static.html b/dom/base/test/file_script_module_dynamic_and_static.html new file mode 100644 index 0000000000..2a19772af1 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_static.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_dynamic_and_static.js b/dom/base/test/file_script_module_dynamic_and_static.js new file mode 100644 index 0000000000..3e2a50b7ab --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_static.js @@ -0,0 +1,10 @@ +const { f } = await import( + "./file_script_module_dynamic_and_static_imported_1.js" +); +import { g } from "./file_script_module_dynamic_and_static_imported_2.js"; +import { h } from "./file_script_module_dynamic_and_static_imported_3.js"; +f(); +g(); +h(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_dynamic_and_static_imported_1.js b/dom/base/test/file_script_module_dynamic_and_static_imported_1.js new file mode 100644 index 0000000000..671704ea17 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_static_imported_1.js @@ -0,0 +1,4 @@ +import { h } from "./file_script_module_dynamic_and_static_imported_3.js"; +h(); + +export function f() {} diff --git a/dom/base/test/file_script_module_dynamic_and_static_imported_2.js b/dom/base/test/file_script_module_dynamic_and_static_imported_2.js new file mode 100644 index 0000000000..e1a0050bce --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_static_imported_2.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_dynamic_and_static_imported_1.js"; +f(); + +export function g() {} diff --git a/dom/base/test/file_script_module_dynamic_and_static_imported_3.js b/dom/base/test/file_script_module_dynamic_and_static_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_and_static_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_script_module_dynamic_import.html b/dom/base/test/file_script_module_dynamic_import.html new file mode 100644 index 0000000000..574e7f8411 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_import.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_dynamic_import.js b/dom/base/test/file_script_module_dynamic_import.js new file mode 100644 index 0000000000..c0ae8cf5d2 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_import.js @@ -0,0 +1,4 @@ +const { f } = await import("./file_script_module_dynamic_import_imported.js"); +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_dynamic_import_imported.js b/dom/base/test/file_script_module_dynamic_import_imported.js new file mode 100644 index 0000000000..8b38a11158 --- /dev/null +++ b/dom/base/test/file_script_module_dynamic_import_imported.js @@ -0,0 +1 @@ +export function f() {} diff --git a/dom/base/test/file_script_module_element_and_dynamic.html b/dom/base/test/file_script_module_element_and_dynamic.html new file mode 100644 index 0000000000..178e76d797 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_dynamic.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_element_and_dynamic.js b/dom/base/test/file_script_module_element_and_dynamic.js new file mode 100644 index 0000000000..6bd59930bb --- /dev/null +++ b/dom/base/test/file_script_module_element_and_dynamic.js @@ -0,0 +1,10 @@ +const { f } = await import( + "./file_script_module_element_and_dynamic_imported_1.js" +); +import { g } from "./file_script_module_element_and_dynamic_imported_2.js"; +import { h } from "./file_script_module_element_and_dynamic_imported_3.js"; +f(); +g(); +h(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_element_and_dynamic_imported_1.js b/dom/base/test/file_script_module_element_and_dynamic_imported_1.js new file mode 100644 index 0000000000..d56c222120 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_dynamic_imported_1.js @@ -0,0 +1,12 @@ +import { g } from "./file_script_module_element_and_dynamic_imported_2.js"; +import { h } from "./file_script_module_element_and_dynamic_imported_3.js"; +g(); +h(); + +export function f() {} + +let script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute("src", "file_script_module_element_and_dynamic.js"); +document.body.appendChild(script); diff --git a/dom/base/test/file_script_module_element_and_dynamic_imported_2.js b/dom/base/test/file_script_module_element_and_dynamic_imported_2.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_dynamic_imported_2.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_element_and_dynamic_imported_3.js b/dom/base/test/file_script_module_element_and_dynamic_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_dynamic_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_script_module_element_and_import.html b/dom/base/test/file_script_module_element_and_import.html new file mode 100644 index 0000000000..97d67f129e --- /dev/null +++ b/dom/base/test/file_script_module_element_and_import.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_element_and_import.js b/dom/base/test/file_script_module_element_and_import.js new file mode 100644 index 0000000000..18d0f57727 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_import.js @@ -0,0 +1,8 @@ +import { f } from "./file_script_module_element_and_import_imported_1.js"; +import { g } from "./file_script_module_element_and_import_imported_2.js"; +import { h } from "./file_script_module_element_and_import_imported_3.js"; +f(); +g(); +h(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_element_and_import_imported_1.js b/dom/base/test/file_script_module_element_and_import_imported_1.js new file mode 100644 index 0000000000..a257a40da9 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_import_imported_1.js @@ -0,0 +1,12 @@ +import { g } from "./file_script_module_element_and_import_imported_2.js"; +import { h } from "./file_script_module_element_and_import_imported_3.js"; +g(); +h(); + +export function f() {} + +let script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute("src", "file_script_module_element_and_import.js"); +document.body.appendChild(script); diff --git a/dom/base/test/file_script_module_element_and_import_imported_2.js b/dom/base/test/file_script_module_element_and_import_imported_2.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_import_imported_2.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_element_and_import_imported_3.js b/dom/base/test/file_script_module_element_and_import_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_element_and_import_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_script_module_frames_dynamic.html b/dom/base/test/file_script_module_frames_dynamic.html new file mode 100644 index 0000000000..9f07e094fa --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic.html @@ -0,0 +1,24 @@ + + + + + Test module script bytecode across iframe + + + + + + + diff --git a/dom/base/test/file_script_module_frames_dynamic_load.html b/dom/base/test/file_script_module_frames_dynamic_load.html new file mode 100644 index 0000000000..eebb0fa36e --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic_load.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_dynamic_load.js b/dom/base/test/file_script_module_frames_dynamic_load.js new file mode 100644 index 0000000000..ba14638f8c --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic_load.js @@ -0,0 +1,4 @@ +const { f } = await import("./file_script_module_frames_dynamic_shared.js"); +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_frames_dynamic_save.html b/dom/base/test/file_script_module_frames_dynamic_save.html new file mode 100644 index 0000000000..64d9e01482 --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic_save.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_dynamic_save.js b/dom/base/test/file_script_module_frames_dynamic_save.js new file mode 100644 index 0000000000..ba14638f8c --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic_save.js @@ -0,0 +1,4 @@ +const { f } = await import("./file_script_module_frames_dynamic_shared.js"); +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_frames_dynamic_shared.js b/dom/base/test/file_script_module_frames_dynamic_shared.js new file mode 100644 index 0000000000..8b38a11158 --- /dev/null +++ b/dom/base/test/file_script_module_frames_dynamic_shared.js @@ -0,0 +1 @@ +export function f() {} diff --git a/dom/base/test/file_script_module_frames_element.html b/dom/base/test/file_script_module_frames_element.html new file mode 100644 index 0000000000..aec8dfa5f0 --- /dev/null +++ b/dom/base/test/file_script_module_frames_element.html @@ -0,0 +1,24 @@ + + + + + Test module script bytecode across iframe + + + + + + + diff --git a/dom/base/test/file_script_module_frames_element_load.html b/dom/base/test/file_script_module_frames_element_load.html new file mode 100644 index 0000000000..940d9ad599 --- /dev/null +++ b/dom/base/test/file_script_module_frames_element_load.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_element_save.html b/dom/base/test/file_script_module_frames_element_save.html new file mode 100644 index 0000000000..b665416676 --- /dev/null +++ b/dom/base/test/file_script_module_frames_element_save.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_element_shared.js b/dom/base/test/file_script_module_frames_element_shared.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_frames_element_shared.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_frames_import.html b/dom/base/test/file_script_module_frames_import.html new file mode 100644 index 0000000000..a71d372724 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import.html @@ -0,0 +1,24 @@ + + + + + Test module script bytecode across iframe + + + + + + + diff --git a/dom/base/test/file_script_module_frames_import_load.html b/dom/base/test/file_script_module_frames_import_load.html new file mode 100644 index 0000000000..d340e6c040 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import_load.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_import_load.js b/dom/base/test/file_script_module_frames_import_load.js new file mode 100644 index 0000000000..3bae471015 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import_load.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_frames_import_shared.js"; +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_frames_import_save.html b/dom/base/test/file_script_module_frames_import_save.html new file mode 100644 index 0000000000..532745d444 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import_save.html @@ -0,0 +1,19 @@ + + + + + Test module script bytecode across iframe + + + + + + diff --git a/dom/base/test/file_script_module_frames_import_save.js b/dom/base/test/file_script_module_frames_import_save.js new file mode 100644 index 0000000000..3bae471015 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import_save.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_frames_import_shared.js"; +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_frames_import_shared.js b/dom/base/test/file_script_module_frames_import_shared.js new file mode 100644 index 0000000000..8b38a11158 --- /dev/null +++ b/dom/base/test/file_script_module_frames_import_shared.js @@ -0,0 +1 @@ +export function f() {} diff --git a/dom/base/test/file_script_module_frames_relay.js b/dom/base/test/file_script_module_frames_relay.js new file mode 100644 index 0000000000..141f202962 --- /dev/null +++ b/dom/base/test/file_script_module_frames_relay.js @@ -0,0 +1,22 @@ +function relay(event) { + if (event.type != "test_evaluated") { + if (!/^watchme/.test(event.target.id)) { + return; + } + } + + const type = `${window.name}_${event.type}`; + + window.parent.dispatchEvent(new window.parent.Event(type)); +} + +window.addEventListener("scriptloader_load_source", relay); +window.addEventListener("scriptloader_load_bytecode", relay); +window.addEventListener("scriptloader_execute", relay); +window.addEventListener("scriptloader_evaluate_module", relay); +window.addEventListener("scriptloader_encode", relay); +window.addEventListener("scriptloader_no_encode", relay); +window.addEventListener("scriptloader_bytecode_saved", relay); +window.addEventListener("scriptloader_bytecode_failed", relay); +window.addEventListener("scriptloader_fallback", relay); +window.addEventListener("test_evaluated", relay); diff --git a/dom/base/test/file_script_module_import.html b/dom/base/test/file_script_module_import.html new file mode 100644 index 0000000000..f298586da7 --- /dev/null +++ b/dom/base/test/file_script_module_import.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_import.js b/dom/base/test/file_script_module_import.js new file mode 100644 index 0000000000..d0c92afc66 --- /dev/null +++ b/dom/base/test/file_script_module_import.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_import_imported.js"; +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_import_and_element.html b/dom/base/test/file_script_module_import_and_element.html new file mode 100644 index 0000000000..de5754eab2 --- /dev/null +++ b/dom/base/test/file_script_module_import_and_element.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_import_and_element.js b/dom/base/test/file_script_module_import_and_element.js new file mode 100644 index 0000000000..685d0199b2 --- /dev/null +++ b/dom/base/test/file_script_module_import_and_element.js @@ -0,0 +1,17 @@ +import { f } from "./file_script_module_import_and_element_imported_1.js"; +import { g } from "./file_script_module_import_and_element_imported_2.js"; +import { h } from "./file_script_module_import_and_element_imported_3.js"; +f(); +g(); +h(); + +let script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute( + "src", + "file_script_module_import_and_element_imported_1.js" +); +document.body.appendChild(script); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_import_and_element_imported_1.js b/dom/base/test/file_script_module_import_and_element_imported_1.js new file mode 100644 index 0000000000..4413bfbf85 --- /dev/null +++ b/dom/base/test/file_script_module_import_and_element_imported_1.js @@ -0,0 +1,6 @@ +import { g } from "./file_script_module_import_and_element_imported_2.js"; +import { h } from "./file_script_module_import_and_element_imported_3.js"; +g(); +h(); + +export function f() {} diff --git a/dom/base/test/file_script_module_import_and_element_imported_2.js b/dom/base/test/file_script_module_import_and_element_imported_2.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_import_and_element_imported_2.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_import_and_element_imported_3.js b/dom/base/test/file_script_module_import_and_element_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_import_and_element_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_script_module_import_imported.js b/dom/base/test/file_script_module_import_imported.js new file mode 100644 index 0000000000..8b38a11158 --- /dev/null +++ b/dom/base/test/file_script_module_import_imported.js @@ -0,0 +1 @@ +export function f() {} diff --git a/dom/base/test/file_script_module_import_multi.html b/dom/base/test/file_script_module_import_multi.html new file mode 100644 index 0000000000..5636bd0f2d --- /dev/null +++ b/dom/base/test/file_script_module_import_multi.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_import_multi.js b/dom/base/test/file_script_module_import_multi.js new file mode 100644 index 0000000000..54d7855d64 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi.js @@ -0,0 +1,6 @@ +import { f } from "./file_script_module_import_multi_imported_once.js"; +import { g } from "./file_script_module_import_multi_imported_twice.js"; +f(); +g(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_import_multi_elems.html b/dom/base/test/file_script_module_import_multi_elems.html new file mode 100644 index 0000000000..42edd06c52 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_import_multi_elems_1.js b/dom/base/test/file_script_module_import_multi_elems_1.js new file mode 100644 index 0000000000..11648d3d1a --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_1.js @@ -0,0 +1,14 @@ +import { f } from "./file_script_module_import_multi_elems_imported_once_1.js"; +import { h } from "./file_script_module_import_multi_elems_imported_twice.js"; +f(); +h(); + +// Dynamically insert the element after loading all source, so that +// the module import doesn't race. +const script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute("src", "file_script_module_import_multi_elems_2.js"); +document.body.appendChild(script); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_import_multi_elems_2.js b/dom/base/test/file_script_module_import_multi_elems_2.js new file mode 100644 index 0000000000..062c263fc4 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_2.js @@ -0,0 +1,6 @@ +import { g } from "./file_script_module_import_multi_elems_imported_once_2.js"; +import { h } from "./file_script_module_import_multi_elems_imported_twice.js"; +g(); +h(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_import_multi_elems_imported_once_1.js b/dom/base/test/file_script_module_import_multi_elems_imported_once_1.js new file mode 100644 index 0000000000..8b38a11158 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_imported_once_1.js @@ -0,0 +1 @@ +export function f() {} diff --git a/dom/base/test/file_script_module_import_multi_elems_imported_once_2.js b/dom/base/test/file_script_module_import_multi_elems_imported_once_2.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_imported_once_2.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_import_multi_elems_imported_once_3.js b/dom/base/test/file_script_module_import_multi_elems_imported_once_3.js new file mode 100644 index 0000000000..411595cafc --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_imported_once_3.js @@ -0,0 +1 @@ +export function i() {} diff --git a/dom/base/test/file_script_module_import_multi_elems_imported_twice.js b/dom/base/test/file_script_module_import_multi_elems_imported_twice.js new file mode 100644 index 0000000000..fd0ddd25b4 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_elems_imported_twice.js @@ -0,0 +1,3 @@ +import { i } from "./file_script_module_import_multi_elems_imported_once_3.js"; +i(); +export function h() {} diff --git a/dom/base/test/file_script_module_import_multi_imported_once.js b/dom/base/test/file_script_module_import_multi_imported_once.js new file mode 100644 index 0000000000..448c6641e5 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_imported_once.js @@ -0,0 +1,4 @@ +import { g } from "./file_script_module_import_multi_imported_twice.js"; +g(); + +export function f() {} diff --git a/dom/base/test/file_script_module_import_multi_imported_twice.js b/dom/base/test/file_script_module_import_multi_imported_twice.js new file mode 100644 index 0000000000..f75e8c9b21 --- /dev/null +++ b/dom/base/test/file_script_module_import_multi_imported_twice.js @@ -0,0 +1 @@ +export function g() {} diff --git a/dom/base/test/file_script_module_single.html b/dom/base/test/file_script_module_single.html new file mode 100644 index 0000000000..ec2c6f217c --- /dev/null +++ b/dom/base/test/file_script_module_single.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_single.js b/dom/base/test/file_script_module_single.js new file mode 100644 index 0000000000..9a5745f516 --- /dev/null +++ b/dom/base/test/file_script_module_single.js @@ -0,0 +1,8 @@ +function baz() {} +function bar() {} +function foo() { + bar(); +} +foo(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_basic.html b/dom/base/test/file_script_module_sri_basic.html new file mode 100644 index 0000000000..743bcafbc7 --- /dev/null +++ b/dom/base/test/file_script_module_sri_basic.html @@ -0,0 +1,11 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_basic.js b/dom/base/test/file_script_module_sri_basic.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_sri_basic.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_basic_prep.html b/dom/base/test/file_script_module_sri_basic_prep.html new file mode 100644 index 0000000000..743bcafbc7 --- /dev/null +++ b/dom/base/test/file_script_module_sri_basic_prep.html @@ -0,0 +1,11 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_dynamic_elem.html b/dom/base/test/file_script_module_sri_dynamic_elem.html new file mode 100644 index 0000000000..a340f5f612 --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_dynamic_elem.js b/dom/base/test/file_script_module_sri_dynamic_elem.js new file mode 100644 index 0000000000..b68c9bb80c --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem.js @@ -0,0 +1,4 @@ +const { f } = await import("./file_script_module_sri_dynamic_elem_imported.js"); +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_imported.js b/dom/base/test/file_script_module_sri_dynamic_elem_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.html b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.html new file mode 100644 index 0000000000..3f0a5f8c7b --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.js b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.js new file mode 100644 index 0000000000..5139b0c34d --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload.js @@ -0,0 +1,20 @@ +const { f } = await import( + "./file_script_module_sri_dynamic_elem_nopreload_imported.js" +); +f(); + +// Dynamically insert the script element in order to suppress preload. +const script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute( + "src", + "file_script_module_sri_dynamic_elem_nopreload_imported.js" +); +script.setAttribute( + "integrity", + "sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J" +); +document.body.appendChild(script); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_imported.js b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_prep.html b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_prep.html new file mode 100644 index 0000000000..da70674200 --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_nopreload_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_dynamic_elem_prep.html b/dom/base/test/file_script_module_sri_dynamic_elem_prep.html new file mode 100644 index 0000000000..598e8519fa --- /dev/null +++ b/dom/base/test/file_script_module_sri_dynamic_elem_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_dynamic.html b/dom/base/test/file_script_module_sri_elem_dynamic.html new file mode 100644 index 0000000000..00741ca010 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_dynamic.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_dynamic.js b/dom/base/test/file_script_module_sri_elem_dynamic.js new file mode 100644 index 0000000000..597038a066 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_dynamic.js @@ -0,0 +1,4 @@ +const { f } = await import("./file_script_module_sri_elem_dynamic_imported.js"); +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_dynamic_imported.js b/dom/base/test/file_script_module_sri_elem_dynamic_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_dynamic_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_dynamic_prep.html b/dom/base/test/file_script_module_sri_elem_dynamic_prep.html new file mode 100644 index 0000000000..607fc0634f --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_dynamic_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_elem_1.html b/dom/base/test/file_script_module_sri_elem_elem_1.html new file mode 100644 index 0000000000..38312d7245 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_1.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_elem_1.js b/dom/base/test/file_script_module_sri_elem_elem_1.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_1.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_elem_1_prep.html b/dom/base/test/file_script_module_sri_elem_elem_1_prep.html new file mode 100644 index 0000000000..4617920deb --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_1_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_elem_2.html b/dom/base/test/file_script_module_sri_elem_elem_2.html new file mode 100644 index 0000000000..b39d018d8e --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_2.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_elem_2.js b/dom/base/test/file_script_module_sri_elem_elem_2.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_2.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_elem_2_prep.html b/dom/base/test/file_script_module_sri_elem_elem_2_prep.html new file mode 100644 index 0000000000..600b7607cb --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_elem_2_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_import.html b/dom/base/test/file_script_module_sri_elem_import.html new file mode 100644 index 0000000000..22e2712f21 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_import.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_elem_import.js b/dom/base/test/file_script_module_sri_elem_import.js new file mode 100644 index 0000000000..5ecd8e4704 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_import.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_sri_elem_import_imported.js"; +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_import_imported.js b/dom/base/test/file_script_module_sri_elem_import_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_import_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_elem_import_prep.html b/dom/base/test/file_script_module_sri_elem_import_prep.html new file mode 100644 index 0000000000..3b23ab7f3f --- /dev/null +++ b/dom/base/test/file_script_module_sri_elem_import_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_fallback.html b/dom/base/test/file_script_module_sri_fallback.html new file mode 100644 index 0000000000..5d54141816 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback.html @@ -0,0 +1,11 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_fallback.js b/dom/base/test/file_script_module_sri_fallback.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_fallback_failure.html b/dom/base/test/file_script_module_sri_fallback_failure.html new file mode 100644 index 0000000000..01eb0028f5 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback_failure.html @@ -0,0 +1,15 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_fallback_failure.js b/dom/base/test/file_script_module_sri_fallback_failure.js new file mode 100644 index 0000000000..741b76cd09 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback_failure.js @@ -0,0 +1 @@ +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_fallback_failure_prep.html b/dom/base/test/file_script_module_sri_fallback_failure_prep.html new file mode 100644 index 0000000000..a66b18dff0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback_failure_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_fallback_prep.html b/dom/base/test/file_script_module_sri_fallback_prep.html new file mode 100644 index 0000000000..dd1b6a0cc5 --- /dev/null +++ b/dom/base/test/file_script_module_sri_fallback_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_import_elem.html b/dom/base/test/file_script_module_sri_import_elem.html new file mode 100644 index 0000000000..e37c05ac49 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem.html @@ -0,0 +1,12 @@ + + + + + Test module script bytecode fallback + + + + + + diff --git a/dom/base/test/file_script_module_sri_import_elem.js b/dom/base/test/file_script_module_sri_import_elem.js new file mode 100644 index 0000000000..36c43f4d58 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem.js @@ -0,0 +1,4 @@ +import { f } from "./file_script_module_sri_import_elem_imported.js"; +f(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_import_elem_imported.js b/dom/base/test/file_script_module_sri_import_elem_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_import_elem_nopreload.html b/dom/base/test/file_script_module_sri_import_elem_nopreload.html new file mode 100644 index 0000000000..5321288e33 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_nopreload.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_import_elem_nopreload.js b/dom/base/test/file_script_module_sri_import_elem_nopreload.js new file mode 100644 index 0000000000..21606f7a8c --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_nopreload.js @@ -0,0 +1,18 @@ +import { f } from "./file_script_module_sri_import_elem_nopreload_imported.js"; +f(); + +// Dynamically insert the script element in order to suppress preload. +const script = document.createElement("script"); +script.id = "watchme2"; +script.setAttribute("type", "module"); +script.setAttribute( + "src", + "file_script_module_sri_import_elem_nopreload_imported.js" +); +script.setAttribute( + "integrity", + "sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J" +); +document.body.appendChild(script); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_import_elem_nopreload_imported.js b/dom/base/test/file_script_module_sri_import_elem_nopreload_imported.js new file mode 100644 index 0000000000..bf624148c0 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_nopreload_imported.js @@ -0,0 +1,3 @@ +export function f() {} + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_sri_import_elem_nopreload_prep.html b/dom/base/test/file_script_module_sri_import_elem_nopreload_prep.html new file mode 100644 index 0000000000..7fa9b011f8 --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_nopreload_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_sri_import_elem_prep.html b/dom/base/test/file_script_module_sri_import_elem_prep.html new file mode 100644 index 0000000000..5abdb1d16d --- /dev/null +++ b/dom/base/test/file_script_module_sri_import_elem_prep.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode fallback + + + + + diff --git a/dom/base/test/file_script_module_static_and_dynamic.html b/dom/base/test/file_script_module_static_and_dynamic.html new file mode 100644 index 0000000000..ae614c85c1 --- /dev/null +++ b/dom/base/test/file_script_module_static_and_dynamic.html @@ -0,0 +1,10 @@ + + + + + Test module script bytecode + + + + + diff --git a/dom/base/test/file_script_module_static_and_dynamic.js b/dom/base/test/file_script_module_static_and_dynamic.js new file mode 100644 index 0000000000..60766106af --- /dev/null +++ b/dom/base/test/file_script_module_static_and_dynamic.js @@ -0,0 +1,8 @@ +import { f } from "./file_script_module_static_and_dynamic_imported_1.js"; +import { g } from "./file_script_module_static_and_dynamic_imported_2.js"; +import { h } from "./file_script_module_static_and_dynamic_imported_3.js"; +f(); +g(); +h(); + +window.dispatchEvent(new Event("test_evaluated")); diff --git a/dom/base/test/file_script_module_static_and_dynamic_imported_1.js b/dom/base/test/file_script_module_static_and_dynamic_imported_1.js new file mode 100644 index 0000000000..420667f36f --- /dev/null +++ b/dom/base/test/file_script_module_static_and_dynamic_imported_1.js @@ -0,0 +1,4 @@ +import { h } from "./file_script_module_static_and_dynamic_imported_3.js"; +h(); + +export function f() {} diff --git a/dom/base/test/file_script_module_static_and_dynamic_imported_2.js b/dom/base/test/file_script_module_static_and_dynamic_imported_2.js new file mode 100644 index 0000000000..c171417531 --- /dev/null +++ b/dom/base/test/file_script_module_static_and_dynamic_imported_2.js @@ -0,0 +1,6 @@ +const { f } = await import( + "./file_script_module_static_and_dynamic_imported_1.js" +); +f(); + +export function g() {} diff --git a/dom/base/test/file_script_module_static_and_dynamic_imported_3.js b/dom/base/test/file_script_module_static_and_dynamic_imported_3.js new file mode 100644 index 0000000000..6b340b7588 --- /dev/null +++ b/dom/base/test/file_script_module_static_and_dynamic_imported_3.js @@ -0,0 +1 @@ +export function h() {} diff --git a/dom/base/test/file_serializer_noscript.html b/dom/base/test/file_serializer_noscript.html new file mode 100644 index 0000000000..440baf036c --- /dev/null +++ b/dom/base/test/file_serializer_noscript.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_setname.html b/dom/base/test/file_setname.html new file mode 100644 index 0000000000..0830feb53a --- /dev/null +++ b/dom/base/test/file_setname.html @@ -0,0 +1,8 @@ + + + + + + diff --git a/dom/base/test/file_settimeout_inner.html b/dom/base/test/file_settimeout_inner.html new file mode 100644 index 0000000000..cfc66dfffb --- /dev/null +++ b/dom/base/test/file_settimeout_inner.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_suppressed_events_and_scrolling.html b/dom/base/test/file_suppressed_events_and_scrolling.html new file mode 100644 index 0000000000..edf6793dfb --- /dev/null +++ b/dom/base/test/file_suppressed_events_and_scrolling.html @@ -0,0 +1,30 @@ + + + + diff --git a/dom/base/test/file_suppressed_events_inner.html b/dom/base/test/file_suppressed_events_inner.html new file mode 100644 index 0000000000..44cc45254d --- /dev/null +++ b/dom/base/test/file_suppressed_events_inner.html @@ -0,0 +1,16 @@ + + + +Test event suppression + + +
            Inner
            + + + diff --git a/dom/base/test/file_suppressed_events_middle.html b/dom/base/test/file_suppressed_events_middle.html new file mode 100644 index 0000000000..86b1f05374 --- /dev/null +++ b/dom/base/test/file_suppressed_events_middle.html @@ -0,0 +1,10 @@ + + + +Test event suppression + + +
            Middle
            + + + diff --git a/dom/base/test/file_suppressed_events_top.html b/dom/base/test/file_suppressed_events_top.html new file mode 100644 index 0000000000..ca031abb70 --- /dev/null +++ b/dom/base/test/file_suppressed_events_top.html @@ -0,0 +1,79 @@ + + + +Test event suppression + + + + + + + +
            Top
            + + + + diff --git a/dom/base/test/file_suppressed_events_top_modalstate.html b/dom/base/test/file_suppressed_events_top_modalstate.html new file mode 100644 index 0000000000..e20938bb28 --- /dev/null +++ b/dom/base/test/file_suppressed_events_top_modalstate.html @@ -0,0 +1,79 @@ + + + +Test event suppression + + + + + + + +
            Top
            + + + + diff --git a/dom/base/test/file_suppressed_events_top_xhr.html b/dom/base/test/file_suppressed_events_top_xhr.html new file mode 100644 index 0000000000..79299e291e --- /dev/null +++ b/dom/base/test/file_suppressed_events_top_xhr.html @@ -0,0 +1,82 @@ + + + +Test event suppression + + + + + + + +
            Top
            + + + + diff --git a/dom/base/test/file_timer_flood.html b/dom/base/test/file_timer_flood.html new file mode 100644 index 0000000000..dc729d7e42 --- /dev/null +++ b/dom/base/test/file_timer_flood.html @@ -0,0 +1,19 @@ + + + + + + diff --git a/dom/base/test/file_title.xhtml b/dom/base/test/file_title.xhtml new file mode 100644 index 0000000000..d1b04418aa --- /dev/null +++ b/dom/base/test/file_title.xhtml @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_toScreenRect.html b/dom/base/test/file_toScreenRect.html new file mode 100644 index 0000000000..990d9326f2 --- /dev/null +++ b/dom/base/test/file_toScreenRect.html @@ -0,0 +1,48 @@ + + + + + +
            + diff --git a/dom/base/test/file_use_counter_bfcache.html b/dom/base/test/file_use_counter_bfcache.html new file mode 100644 index 0000000000..6baf738945 --- /dev/null +++ b/dom/base/test/file_use_counter_bfcache.html @@ -0,0 +1,38 @@ + + diff --git a/dom/base/test/file_use_counter_bfcache_helper.html b/dom/base/test/file_use_counter_bfcache_helper.html new file mode 100644 index 0000000000..a5da790ae6 --- /dev/null +++ b/dom/base/test/file_use_counter_bfcache_helper.html @@ -0,0 +1,40 @@ + +b +c + + diff --git a/dom/base/test/file_use_counter_outer.html b/dom/base/test/file_use_counter_outer.html new file mode 100644 index 0000000000..1a7eb90f7c --- /dev/null +++ b/dom/base/test/file_use_counter_outer.html @@ -0,0 +1,17 @@ + + + + + + Test for Bug 968923 + + +Mozilla Bug 968923 + + + + diff --git a/dom/base/test/file_use_counter_outer_display_none.html b/dom/base/test/file_use_counter_outer_display_none.html new file mode 100644 index 0000000000..22c4c4c8ab --- /dev/null +++ b/dom/base/test/file_use_counter_outer_display_none.html @@ -0,0 +1,16 @@ + + + + + + Test for Bug 968923 + + +Mozilla Bug 968923 + + + diff --git a/dom/base/test/file_use_counter_style.html b/dom/base/test/file_use_counter_style.html new file mode 100644 index 0000000000..52880c0e40 --- /dev/null +++ b/dom/base/test/file_use_counter_style.html @@ -0,0 +1,14 @@ + + + +
            diff --git a/dom/base/test/file_use_counter_svg_currentScale.svg b/dom/base/test/file_use_counter_svg_currentScale.svg new file mode 100644 index 0000000000..cf4d64aba0 --- /dev/null +++ b/dom/base/test/file_use_counter_svg_currentScale.svg @@ -0,0 +1,17 @@ + + + Test graphic for hitting currentScale + + + + + + + + + diff --git a/dom/base/test/file_use_counter_svg_fill_pattern.svg b/dom/base/test/file_use_counter_svg_fill_pattern.svg new file mode 100644 index 0000000000..1cd84dd5e1 --- /dev/null +++ b/dom/base/test/file_use_counter_svg_fill_pattern.svg @@ -0,0 +1,16 @@ + + + Borrowed from http://www.w3.org/TR/SVG/pservers.html + + + + + + + + + diff --git a/dom/base/test/file_use_counter_svg_fill_pattern_data.svg b/dom/base/test/file_use_counter_svg_fill_pattern_data.svg new file mode 100644 index 0000000000..9a180b2432 --- /dev/null +++ b/dom/base/test/file_use_counter_svg_fill_pattern_data.svg @@ -0,0 +1,13 @@ + + + Borrowed from http://www.w3.org/TR/SVG/pservers.html + + + + + + diff --git a/dom/base/test/file_use_counter_svg_fill_pattern_definition.svg b/dom/base/test/file_use_counter_svg_fill_pattern_definition.svg new file mode 100644 index 0000000000..a84292a63f --- /dev/null +++ b/dom/base/test/file_use_counter_svg_fill_pattern_definition.svg @@ -0,0 +1,12 @@ + + + Borrowed from http://www.w3.org/TR/SVG/pservers.html + + + + + + diff --git a/dom/base/test/file_use_counter_svg_fill_pattern_internal.svg b/dom/base/test/file_use_counter_svg_fill_pattern_internal.svg new file mode 100644 index 0000000000..47adafe38c --- /dev/null +++ b/dom/base/test/file_use_counter_svg_fill_pattern_internal.svg @@ -0,0 +1,24 @@ + + + Borrowed from http://www.w3.org/TR/SVG/pservers.html + + + + + + + + + + + + + + + diff --git a/dom/base/test/file_use_counter_svg_getElementById.svg b/dom/base/test/file_use_counter_svg_getElementById.svg new file mode 100644 index 0000000000..7cd12ba315 --- /dev/null +++ b/dom/base/test/file_use_counter_svg_getElementById.svg @@ -0,0 +1,22 @@ + + + Test graphic for hitting getElementById + + + + + + + + + diff --git a/dom/base/test/file_viewport_metrics_on_landscape_content.html b/dom/base/test/file_viewport_metrics_on_landscape_content.html new file mode 100644 index 0000000000..02b079aeac --- /dev/null +++ b/dom/base/test/file_viewport_metrics_on_landscape_content.html @@ -0,0 +1,65 @@ + + + + + +
            + + diff --git a/dom/base/test/file_viewport_scroll_quirks.html b/dom/base/test/file_viewport_scroll_quirks.html new file mode 100644 index 0000000000..992b8a9968 --- /dev/null +++ b/dom/base/test/file_viewport_scroll_quirks.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_viewport_scroll_xml.xml b/dom/base/test/file_viewport_scroll_xml.xml new file mode 100644 index 0000000000..1453e9b1ea --- /dev/null +++ b/dom/base/test/file_viewport_scroll_xml.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/file_webaudio_startstop.html b/dom/base/test/file_webaudio_startstop.html new file mode 100644 index 0000000000..c0e4fafb01 --- /dev/null +++ b/dom/base/test/file_webaudio_startstop.html @@ -0,0 +1,36 @@ + + diff --git a/dom/base/test/file_window_close.html b/dom/base/test/file_window_close.html new file mode 100644 index 0000000000..5adec04ec4 --- /dev/null +++ b/dom/base/test/file_window_close.html @@ -0,0 +1,68 @@ + + + + + + + + diff --git a/dom/base/test/file_window_close_2.html b/dom/base/test/file_window_close_2.html new file mode 100644 index 0000000000..c06ec90a8b --- /dev/null +++ b/dom/base/test/file_window_close_2.html @@ -0,0 +1,4 @@ + + + + diff --git a/dom/base/test/file_window_focus_by_close_and_open.html b/dom/base/test/file_window_focus_by_close_and_open.html new file mode 100644 index 0000000000..ab5ad72ae3 --- /dev/null +++ b/dom/base/test/file_window_focus_by_close_and_open.html @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/dom/base/test/file_x-frame-options_main.html b/dom/base/test/file_x-frame-options_main.html new file mode 100644 index 0000000000..903f951e08 --- /dev/null +++ b/dom/base/test/file_x-frame-options_main.html @@ -0,0 +1,44 @@ + + +X-Frame-Options tests + + + + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + + + + + + + diff --git a/dom/base/test/file_x-frame-options_page.sjs b/dom/base/test/file_x-frame-options_page.sjs new file mode 100644 index 0000000000..13c9aa7cac --- /dev/null +++ b/dom/base/test/file_x-frame-options_page.sjs @@ -0,0 +1,67 @@ +// SJS file for X-Frame-Options mochitests +function handleRequest(request, response) { + var query = {}; + var BOUNDARY = "BOUNDARYOMG3984"; + request.queryString.split("&").forEach(function (val) { + var [name, value] = val.split("="); + query[name] = unescape(value); + }); + + if (query.multipart == "1") { + response.setHeader( + "Content-Type", + "multipart/x-mixed-replace;boundary=" + BOUNDARY, + false + ); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.write("--" + BOUNDARY + "\r\n"); + response.write("Content-Type: text/html\r\n\r\n"); + } else { + response.setHeader("Content-Type", "text/html", false); + response.setHeader("Cache-Control", "no-cache", false); + } + + var testHeaders = { + deny: "DENY", + sameorigin: "SAMEORIGIN", + sameorigin2: "SAMEORIGIN, SAMEORIGIN", + sameorigin3: "SAMEORIGIN,SAMEORIGIN , SAMEORIGIN", + mixedpolicy: "DENY,SAMEORIGIN", + + /* added for bug 836132 */ + afa: "ALLOW-FROM http://mochi.test:8888/", + afd: "ALLOW-FROM http://example.com/", + afa1: "ALLOW-FROM http://mochi.test:8888", + afd1: "ALLOW-FROM:example.com", + afd2: "ALLOW-FROM: example.com", + afd3: "ALLOW-FROM example.com", + afd4: "ALLOW-FROM:http://example.com", + afd5: "ALLOW-FROM: http://example.com", + afd6: "ALLOW-FROM http://example.com", + afd7: "ALLOW-FROM:mochi.test:8888", + afd8: "ALLOW-FROM: mochi.test:8888", + afd9: "ALLOW-FROM:http://mochi.test:8888", + afd10: "ALLOW-FROM: http://mochi.test:8888", + afd11: "ALLOW-FROM mochi.test:8888", + afd12: "ALLOW-FROM", + afd13: "ALLOW-FROM ", + afd14: "ALLOW-FROM:", + }; + + if (testHeaders.hasOwnProperty(query.xfo)) { + response.setHeader("X-Frame-Options", testHeaders[query.xfo], false); + } + + // from the test harness we'll be checking for the presence of this element + // to test if the page loaded + response.write('

            ' + query.testid + "

            "); + + if (query.testid == "postmessage") { + response.write(""); + } + + if (query.multipart == "1") { + response.write("\r\n--" + BOUNDARY + "\r\n"); + } +} diff --git a/dom/base/test/file_xhtmlserializer_1.xhtml b/dom/base/test/file_xhtmlserializer_1.xhtml new file mode 100644 index 0000000000..64271ce2ce --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1.xhtml @@ -0,0 +1,60 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + diff --git a/dom/base/test/file_xhtmlserializer_1_bodyonly.xhtml b/dom/base/test/file_xhtmlserializer_1_bodyonly.xhtml new file mode 100644 index 0000000000..fbefe91d6e --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_bodyonly.xhtml @@ -0,0 +1,56 @@ + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_format.xhtml b/dom/base/test/file_xhtmlserializer_1_format.xhtml new file mode 100644 index 0000000000..d62cc367ba --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_format.xhtml @@ -0,0 +1,71 @@ + + + + + + Test for html serializer + + +

            Hello world

            +

            Lorem ipsum dolor sit amet, consectetuer + adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis + ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent + taciti sociosqu ad litora torquent per conubia + nostra, per inceptos hymenaeos.

            +
              +
            • Nam tellus massa,éàèçù
            • +
            • fringilla aliquam,
            • +
            • fermentum sit amet,
            • +
            • posuere ac,
            • +
            • est.
            • +
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + +
              +
            1. Fusce a ipsum
            2. +
            3. non lacus posuere aliquet.
            4. +
            5. Sed fermentum posuere nulla
            6. +
            7. Donec tempor.
            8. +
            + Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            + ut gravida eros
            + leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus + aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia
            +      libero ullamcorper laoreet.
            Cras quis
            nisi at + odio
            consectetuer molestie. Curabitur consectetuer urna a + sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in + faucibus orci luctus et ultrices posuere cubilia Curae; Sed + sollicitudin, nulla at pharetra rutrum, +
            + lacus risus pulvinar ante. +
            + + diff --git a/dom/base/test/file_xhtmlserializer_1_linebreak.xhtml b/dom/base/test/file_xhtmlserializer_1_linebreak.xhtml new file mode 100644 index 0000000000..a0aecdd2c6 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_linebreak.xhtml @@ -0,0 +1,65 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_links.xhtml b/dom/base/test/file_xhtmlserializer_1_links.xhtml new file mode 100644 index 0000000000..0c2814311b --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_links.xhtml @@ -0,0 +1,65 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + diff --git a/dom/base/test/file_xhtmlserializer_1_nested_body.xhtml b/dom/base/test/file_xhtmlserializer_1_nested_body.xhtml new file mode 100644 index 0000000000..120f8e7dcb --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_nested_body.xhtml @@ -0,0 +1,65 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            +

            this is an other body element

            + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_no_body.xhtml b/dom/base/test/file_xhtmlserializer_1_no_body.xhtml new file mode 100644 index 0000000000..6f5055bd57 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_no_body.xhtml @@ -0,0 +1,10 @@ + + + + + + Test for html serializer + + + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_noflag.xhtml b/dom/base/test/file_xhtmlserializer_1_noflag.xhtml new file mode 100644 index 0000000000..a0aecdd2c6 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_noflag.xhtml @@ -0,0 +1,65 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_noformatpre.xhtml b/dom/base/test/file_xhtmlserializer_1_noformatpre.xhtml new file mode 100644 index 0000000000..a5eb6e9692 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_noformatpre.xhtml @@ -0,0 +1,69 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            +
            + Cras quis
            +
            + nisi at odio
            +
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, 
            +
            +lacus risus pulvinar ante.
            +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_raw.xhtml b/dom/base/test/file_xhtmlserializer_1_raw.xhtml new file mode 100644 index 0000000000..d13fce2ccd --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_raw.xhtml @@ -0,0 +1,60 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_sibling_body.xhtml b/dom/base/test/file_xhtmlserializer_1_sibling_body.xhtml new file mode 100644 index 0000000000..9ef4840e36 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_sibling_body.xhtml @@ -0,0 +1,65 @@ + + + + + + Test for html serializer + + +

            this is an other body element

            +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml b/dom/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml new file mode 100644 index 0000000000..f9f92a0670 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml @@ -0,0 +1,56 @@ +

            this is an other body element

            +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu ad + litora torquent per conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_1_wrap.xhtml b/dom/base/test/file_xhtmlserializer_1_wrap.xhtml new file mode 100644 index 0000000000..6b156278ad --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_1_wrap.xhtml @@ -0,0 +1,70 @@ + + + + + + Test for html serializer + + + +

            Hello world

            + + Lorem ipsum dolor sit amet, consectetuer +adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. +Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti sociosqu + ad + litora torquent per + conubia +nostra, per inceptos hymenaeos.

            + + +
            • Nam tellus massa,éàèçù
            • + fringilla +aliquam,
            • fermentum sit amet,
            • posuere ac,
            • est.
            +
            Duis tristique egestas ligula. Mauris quis felis.
            + + + +
            1. Fusce + a ipsum
            2. non lacus posuere aliquet.
            3. Sed fermentum +posuere nulla
            4. Donec tempor.
            +Donec sollicitudin tortor + +
            lacinia libero ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum,
            +lacus risus pulvinar ante. +
            +ut gravida eros
            leo ut libero + +

            + +

            Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus +aliquet lectus. Nunc vitae eros. Class aptent taciti

            +
            lacinia libero 
            +ullamcorper laoreet.
            + Cras quis
            + nisi at odio
            + consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non +urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci +luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at +pharetra rutrum,
            +lacus risus pulvinar ante. +
            + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_2.xhtml b/dom/base/test/file_xhtmlserializer_2.xhtml new file mode 100644 index 0000000000..2a9c55b95d --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_2.xhtml @@ -0,0 +1,30 @@ + + + + + Test for html serializer with entities + + + +

            The basic set is just " " & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ +Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø +Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê +ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý +þ ÿ

            +

            symbols, math.. ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ +Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς +σ τ υ φ χ ψ ω ϑ ϒ ϖ • … ′ ″ ‾ ⁄ ℘ ℑ ℜ +™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉ +∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ ⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥ ♦ +

            +

            others +Œ œ Š š Ÿ ˆ ˜       ‌ ‍ ‎ ‏–— ‘ ’ +‚“ ” „ † ‡ ‰ ‹ › € +

            + + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_2_basic.xhtml b/dom/base/test/file_xhtmlserializer_2_basic.xhtml new file mode 100644 index 0000000000..c35cc48cf8 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_2_basic.xhtml @@ -0,0 +1,31 @@ + + + + + + Test for html serializer with entities + + + +

            The basic set is just " " & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À à Â Ã Ä Å Æ +Ç È É Ê Ë Ì à Î à à Ñ Ò Ó Ô Õ Ö × Ø +Ù Ú Û Ü à Þ ß à á â ã ä å æ ç è é ê +ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý +þ ÿ

            +

            symbols, math.. Æ’ Α Î’ Γ Δ Ε Ζ Η Θ Ι Κ Λ Îœ ΠΞ Ο Π Ρ Σ Τ Î¥ +Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο Ï€ Ï Ï‚ +σ Ï„ Ï… φ χ ψ ω Ï‘ Ï’ Ï– • … ′ ″ ‾ ℠℘ â„‘ â„œ +â„¢ ℵ ↠↑ → ↓ ↔ ↵ ⇠⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉ +∋ ∠∑ − ∗ √ ∠∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ â‹… ⌈ ⌉ ⌊ ⌋ ⟨ ⟩ â—Š â™  ♣ ♥ ♦ +

            +

            others +Å’ Å“ Å  Å¡ Ÿ ˆ Ëœ       ‌ †‎ â€â€“— ‘ ’ +‚“ †„ † ‡ ‰ ‹ › € +

            + + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_2_enthtml.xhtml b/dom/base/test/file_xhtmlserializer_2_enthtml.xhtml new file mode 100644 index 0000000000..0ba1c8421c --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_2_enthtml.xhtml @@ -0,0 +1,55 @@ + + + + + + Test for html serializer with entities + + + +

            The basic set is just   & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ +© ª « ¬ ­ ® ¯ ° ± ² +³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ +¾ ¿ À Á Â Ã Ä Å +Æ +Ç È É Ê Ë Ì Í Î +Ï Ð Ñ Ò Ó Ô Õ Ö × +Ø +Ù Ú Û Ü Ý Þ ß à +á â ã ä å æ ç è +é ê +ë ì í î ï ð ñ ò ó + ô õ ö ÷ ø ù ú û +ü ý +þ ÿ

            +

            symbols, math.. ƒ Α Β Γ Δ Ε +Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο +Π Ρ Σ Τ Υ +Φ Χ Ψ Ω α β γ δ ε +ζ η θ ι κ λ μ ν ξ ο +π ρ ς +σ τ υ φ χ ψ ω ϑ ϒ +ϖ • … ′ ″ ‾ ⁄ ℘ ℑ +ℜ +™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ +⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ +∈ ∉ +∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ +∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ +≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ +⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥ +♦ +

            +

            others +Œ œ Š š Ÿ ˆ ˜     +  ‌ ‍ ‎ ‏–— ‘ ’ +‚“ ” „ † ‡ ‰ ‹ +› € +

            + + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_2_entw3c.xhtml b/dom/base/test/file_xhtmlserializer_2_entw3c.xhtml new file mode 100644 index 0000000000..0ba1c8421c --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_2_entw3c.xhtml @@ -0,0 +1,55 @@ + + + + + + Test for html serializer with entities + + + +

            The basic set is just   & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ +© ª « ¬ ­ ® ¯ ° ± ² +³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ +¾ ¿ À Á Â Ã Ä Å +Æ +Ç È É Ê Ë Ì Í Î +Ï Ð Ñ Ò Ó Ô Õ Ö × +Ø +Ù Ú Û Ü Ý Þ ß à +á â ã ä å æ ç è +é ê +ë ì í î ï ð ñ ò ó + ô õ ö ÷ ø ù ú û +ü ý +þ ÿ

            +

            symbols, math.. ƒ Α Β Γ Δ Ε +Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο +Π Ρ Σ Τ Υ +Φ Χ Ψ Ω α β γ δ ε +ζ η θ ι κ λ μ ν ξ ο +π ρ ς +σ τ υ φ χ ψ ω ϑ ϒ +ϖ • … ′ ″ ‾ ⁄ ℘ ℑ +ℜ +™ ℵ ← ↑ → ↓ ↔ ↵ ⇐ +⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ +∈ ∉ +∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ +∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ +≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌈ +⌉ ⌊ ⌋ ⟨ ⟩ ◊ ♠ ♣ ♥ +♦ +

            +

            others +Œ œ Š š Ÿ ˆ ˜     +  ‌ ‍ ‎ ‏–— ‘ ’ +‚“ ” „ † ‡ ‰ ‹ +› € +

            + + + \ No newline at end of file diff --git a/dom/base/test/file_xhtmlserializer_2_latin1.xhtml b/dom/base/test/file_xhtmlserializer_2_latin1.xhtml new file mode 100644 index 0000000000..59b564ca77 --- /dev/null +++ b/dom/base/test/file_xhtmlserializer_2_latin1.xhtml @@ -0,0 +1,41 @@ + + + + + + Test for html serializer with entities + + + +

            The basic set is just   & < > " for interoperability with older products that don't support α and friends.

            + +

            latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ +© ª « ¬ ­ ® ¯ ° ± ² +³ ´ +µ ¶ · ¸ ¹ º » ¼ ½ +¾ ¿ À Á Â Ã Ä Å +Æ +Ç È É Ê Ë Ì Í Î +Ï Ð Ñ Ò Ó Ô Õ Ö × +Ø +Ù Ú Û Ü Ý Þ ß à +á â ã ä å æ ç è +é ê +ë ì í î ï ð ñ ò ó + ô õ ö ÷ ø ù ú û +ü ý +þ ÿ

            +

            symbols, math.. Æ’ Α Î’ Γ Δ Ε Ζ Η Θ Ι Κ Λ Îœ ΠΞ Ο Π Ρ Σ Τ Î¥ +Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο Ï€ Ï Ï‚ +σ Ï„ Ï… φ χ ψ ω Ï‘ Ï’ Ï– • … ′ ″ ‾ ℠℘ â„‘ â„œ +â„¢ ℵ ↠↑ → ↓ ↔ ↵ ⇠⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∇ ∈ ∉ +∋ ∠∑ − ∗ √ ∠∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ +⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ â‹… ⌈ ⌉ ⌊ ⌋ ⟨ ⟩ â—Š â™  ♣ ♥ ♦ +

            +

            others +Å’ Å“ Å  Å¡ Ÿ ˆ Ëœ       ‌ †‎ â€â€“— ‘ ’ +‚“ †„ † ‡ ‰ ‹ › € +

            + + + \ No newline at end of file diff --git a/dom/base/test/file_youtube_flash_embed.html b/dom/base/test/file_youtube_flash_embed.html new file mode 100644 index 0000000000..0eb63477f4 --- /dev/null +++ b/dom/base/test/file_youtube_flash_embed.html @@ -0,0 +1,65 @@ + + + + + + Test for Bug 1240471 + + + + + + + + + + diff --git a/dom/base/test/fmm/browser.ini b/dom/base/test/fmm/browser.ini new file mode 100644 index 0000000000..19f9b584e4 --- /dev/null +++ b/dom/base/test/fmm/browser.ini @@ -0,0 +1 @@ +[browser_frame_message_manager_cache.js] diff --git a/dom/base/test/fmm/browser_frame_message_manager_cache.js b/dom/base/test/fmm/browser_frame_message_manager_cache.js new file mode 100644 index 0000000000..fcedd6721a --- /dev/null +++ b/dom/base/test/fmm/browser_frame_message_manager_cache.js @@ -0,0 +1,23 @@ +add_task(async function testCacheAfterInvalidate() { + // Load some page to make scripts cached. + let tab1 = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:addons" + ); + + // Discard ScriptPreloader cache. + Services.obs.notifyObservers(null, "startupcache-invalidate"); + + // Load some other page to use the cache in nsMessageManagerScriptExecutor + // cache. + let tab2 = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:preferences" + ); + + // Verify the browser doesn't crash. + ok(true); + + BrowserTestUtils.removeTab(tab1); + BrowserTestUtils.removeTab(tab2); +}); diff --git a/dom/base/test/forRemoval.resource b/dom/base/test/forRemoval.resource new file mode 100644 index 0000000000..09e882b3ba --- /dev/null +++ b/dom/base/test/forRemoval.resource @@ -0,0 +1,24 @@ +:this file must be enconded in utf8 +:and its Content-Type must be equal to text/event-stream + +retry:500 +event: message +data: 1 + +retry:500 +event: message +data: 2 + +retry:500 +event: message +data: 3 + +retry:500 +event: message +data: 4 + +retry:500 +event: message +data: 5 + + diff --git a/dom/base/test/forRemoval.resource^headers^ b/dom/base/test/forRemoval.resource^headers^ new file mode 100644 index 0000000000..6a63b5341d --- /dev/null +++ b/dom/base/test/forRemoval.resource^headers^ @@ -0,0 +1,3 @@ +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate + diff --git a/dom/base/test/formReset.html b/dom/base/test/formReset.html new file mode 100644 index 0000000000..faee1e5b4d --- /dev/null +++ b/dom/base/test/formReset.html @@ -0,0 +1,15 @@ + + + + Form Elements + + + +

            Check me!
            + Uncheck me!
            +
            +
            +

            + + diff --git a/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml new file mode 100644 index 0000000000..93f00311e7 --- /dev/null +++ b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + diff --git a/dom/base/test/fullscreen/browser.ini b/dom/base/test/fullscreen/browser.ini new file mode 100644 index 0000000000..c472e09b5c --- /dev/null +++ b/dom/base/test/fullscreen/browser.ini @@ -0,0 +1,40 @@ +[DEFAULT] +tags = fullscreen +head = head.js +support-files = + dummy_page.html + file_fullscreen-api-keys.html + file_fullscreen-iframe-inner.html + file_fullscreen-iframe-middle.html + file_fullscreen-iframe-top.html + file_fullscreen-newtab.html + fullscreen_helpers.js + +[browser_fullscreen-api-keys.js] +[browser_fullscreen-document-mutation.js] +[browser_fullscreen-document-mutation-navigation.js] +[browser_fullscreen-document-mutation-race.js] +[browser_fullscreen-contextmenu-esc.js] +[browser_fullscreen-navigation.js] +skip-if = + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure +[browser_fullscreen-navigation-history.js] +[browser_fullscreen-navigation-race.js] +[browser_fullscreen-newtab.js] +skip-if = + os == 'mac' # Bug 1494843 + os == 'linux' && bits == 64 && os_version == '18.04' # Bug 1601460 + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure +[browser_fullscreen-tab-close.js] +[browser_fullscreen-tab-close-race.js] +skip-if = !fission # Bug 1750901 +[browser_fullscreen-bug-1798219.js] +skip-if = + !fission + !nightly_build # Bug 1818608 +support-files = + file_fullscreen-bug-1798219.html + file_fullscreen-bug-1798219-2.html +[browser_fullscreen-window-open-race.js] +[browser_fullscreen-sizemode.js] +[browser_fullscreen_exit_on_external_protocol.js] diff --git a/dom/base/test/fullscreen/browser_fullscreen-api-keys.js b/dom/base/test/fullscreen/browser_fullscreen-api-keys.js new file mode 100644 index 0000000000..1b1a07975e --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-api-keys.js @@ -0,0 +1,218 @@ +"use strict"; + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +/** Test for Bug 545812 **/ + +// List of key codes which should exit full-screen mode. +const kKeyList = [ + { key: "Escape", keyCode: "VK_ESCAPE", suppressed: true }, + { key: "F11", keyCode: "VK_F11", suppressed: false }, +]; + +function receiveExpectedKeyEvents(aBrowser, aKeyCode, aTrusted) { + return SpecialPowers.spawn( + aBrowser, + [aKeyCode, aTrusted], + (keyCode, trusted) => { + return new Promise(resolve => { + let events = trusted + ? ["keydown", "keyup"] + : ["keydown", "keypress", "keyup"]; + if (trusted && keyCode == content.wrappedJSObject.KeyEvent.DOM_VK_F11) { + // trusted `F11` key shouldn't be fired because of reserved when it's + // a shortcut key for exiting from the full screen mode. + events.shift(); + } + function listener(event) { + let expected = events.shift(); + Assert.equal( + event.type, + expected, + `Should receive a ${expected} event` + ); + Assert.equal( + event.keyCode, + keyCode, + `Should receive the event with key code ${keyCode}` + ); + if (!events.length) { + content.document.removeEventListener("keydown", listener, true); + content.document.removeEventListener("keyup", listener, true); + content.document.removeEventListener("keypress", listener, true); + resolve(); + } + } + + content.document.addEventListener("keydown", listener, true); + content.document.addEventListener("keyup", listener, true); + content.document.addEventListener("keypress", listener, true); + }); + } + ); +} + +const kPage = + "https://example.org/browser/" + + "dom/base/test/fullscreen/file_fullscreen-api-keys.html"; + +add_task(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"] + ); + + let tab = BrowserTestUtils.addTab(gBrowser, kPage); + let browser = tab.linkedBrowser; + gBrowser.selectedTab = tab; + registerCleanupFunction(() => gBrowser.removeTab(tab)); + await waitForDocLoadComplete(); + + // Wait for the document being activated, so that + // fullscreen request won't be denied. + await SpecialPowers.spawn(browser, [], () => { + return ContentTaskUtils.waitForCondition( + () => content.browsingContext.isActive && content.document.hasFocus(), + "document is active" + ); + }); + + // Register listener to capture unexpected events + let keyEventsCount = 0; + let fullScreenEventsCount = 0; + let removeFullScreenListener = BrowserTestUtils.addContentEventListener( + browser, + "fullscreenchange", + () => fullScreenEventsCount++ + ); + let removeKeyDownListener = BrowserTestUtils.addContentEventListener( + browser, + "keydown", + () => keyEventsCount++, + { wantUntrusted: true } + ); + let removeKeyPressListener = BrowserTestUtils.addContentEventListener( + browser, + "keypress", + () => keyEventsCount++, + { wantUntrusted: true } + ); + let removeKeyUpListener = BrowserTestUtils.addContentEventListener( + browser, + "keyup", + () => keyEventsCount++, + { wantUntrusted: true } + ); + + let expectedFullScreenEventsCount = 0; + let expectedKeyEventsCount = 0; + + for (let { key, keyCode, suppressed } of kKeyList) { + let keyCodeValue = KeyEvent["DOM_" + keyCode]; + info(`Test keycode ${key} (${keyCodeValue})`); + + info("Enter fullscreen"); + let state = new Promise(resolve => { + let removeFun = BrowserTestUtils.addContentEventListener( + browser, + "fullscreenchange", + async () => { + removeFun(); + resolve( + await SpecialPowers.spawn(browser, [], () => { + return !!content.document.fullscreenElement; + }) + ); + } + ); + }); + // request fullscreen + SpecialPowers.spawn(browser, [], () => { + content.document.body.requestFullscreen(); + }); + ok(await state, "The content should have entered fullscreen"); + ok(document.fullscreenElement, "The chrome should also be in fullscreen"); + + is( + fullScreenEventsCount, + ++expectedFullScreenEventsCount, + "correct number of fullscreen events occurred" + ); + + info("Dispatch untrusted key events from content"); + let promiseExpectedKeyEvents = receiveExpectedKeyEvents( + browser, + keyCodeValue, + false + ); + + SpecialPowers.spawn(browser, [keyCode], keyCodeChild => { + var evt = new content.CustomEvent("Test:DispatchKeyEvents", { + detail: Cu.cloneInto({ code: keyCodeChild }, content), + }); + content.dispatchEvent(evt); + }); + await promiseExpectedKeyEvents; + + expectedKeyEventsCount += 3; + is( + keyEventsCount, + expectedKeyEventsCount, + "correct number of key events occurred" + ); + + info("Send trusted key events"); + + state = new Promise(resolve => { + let removeFun = BrowserTestUtils.addContentEventListener( + browser, + "fullscreenchange", + async () => { + removeFun(); + resolve( + await SpecialPowers.spawn(browser, [], () => { + return !!content.document.fullscreenElement; + }) + ); + } + ); + }); + + promiseExpectedKeyEvents = suppressed + ? Promise.resolve() + : receiveExpectedKeyEvents(browser, keyCodeValue, true); + await SpecialPowers.spawn(browser, [], () => {}); + + EventUtils.synthesizeKey("KEY_" + key); + await promiseExpectedKeyEvents; + + ok(!(await state), "The content should have exited fullscreen"); + ok( + !document.fullscreenElement, + "The chrome should also have exited fullscreen" + ); + + is( + fullScreenEventsCount, + ++expectedFullScreenEventsCount, + "correct number of fullscreen events occurred" + ); + if (!suppressed) { + expectedKeyEventsCount += keyCode == "VK_F11" ? 1 : 3; + } + is( + keyEventsCount, + expectedKeyEventsCount, + "correct number of key events occurred" + ); + } + + removeFullScreenListener(); + removeKeyDownListener(); + removeKeyPressListener(); + removeKeyUpListener(); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-bug-1798219.js b/dom/base/test/fullscreen/browser_fullscreen-bug-1798219.js new file mode 100644 index 0000000000..2aef23b042 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-bug-1798219.js @@ -0,0 +1,127 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Import helpers +/* import-globals-from fullscreen_helpers.js */ +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error, https://bugzilla.mozilla.org/show_bug.cgi?id=1742890. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +async function waitAndCheckFullscreenState(aWindow) { + // Wait fullscreen exit event if browser is still in fullscreen mode. + if ( + aWindow.fullScreen || + aWindow.document.documentElement.hasAttribute("inFullscreen") + ) { + info("The widget is still in fullscreen, wait again"); + await waitWidgetFullscreenEvent(aWindow, false, true); + } + if (aWindow.document.documentElement.hasAttribute("inDOMFullscreen")) { + info("The chrome document is still in fullscreen, wait again"); + await waitForFullScreenObserver(aWindow, false, true); + } + + // Ensure the browser exits fullscreen state. + ok(!aWindow.fullScreen, "The widget should not be in fullscreen"); + ok( + !aWindow.document.documentElement.hasAttribute("inFullscreen"), + "The chrome window should not be in fullscreen" + ); + ok( + !aWindow.document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); +} + +add_task(async () => { + const URL = + "http://mochi.test:8888/browser/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html"; + // We need this dummy tab which load the same URL as test tab to keep the + // original content process alive after test page navigates away. + let dummyTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: URL, + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], function () { + content.document.querySelector("button").click(); + }); + + // Test requests fullscreen and performs navigation simultaneously, + // the fullscreen request might be rejected directly if navigation happens + // first, so there might be no reliable state that we can wait. So give + // some time for possible fullscreen transition instead and ensure window + // should end up exiting fullscreen. + await new Promise(aResolve => { + SimpleTest.executeSoon(() => { + SimpleTest.executeSoon(aResolve); + }); + }); + await waitAndCheckFullscreenState(window); + } + ); + + let dummyTabClosed = BrowserTestUtils.waitForTabClosing(dummyTab); + BrowserTestUtils.removeTab(dummyTab); + await dummyTabClosed; +}); + +add_task(async () => { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: "http://mochi.test:8888/browser/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html", + }, + async function (browser) { + // Open a new window to run the tests, the original window will keep the + // original content process alive after the test window navigates away. + let promiseWin = BrowserTestUtils.waitForNewWindow(); + await SpecialPowers.spawn(browser, [], function () { + content.document.querySelector("button").click(); + }); + let newWindow = await promiseWin; + + await SpecialPowers.spawn( + newWindow.gBrowser.selectedTab.linkedBrowser, + [], + function () { + content.document.querySelector("button").click(); + } + ); + + // Test requests fullscreen and performs navigation simultaneously, + // the fullscreen request might be rejected directly if navigation happens + // first, so there might be no reliable state that we can wait. So give + // some time for possible fullscreen transition instead and ensure window + // should end up exiting fullscreen. + await new Promise(aResolve => { + SimpleTest.executeSoon(() => { + SimpleTest.executeSoon(aResolve); + }); + }); + await waitAndCheckFullscreenState(newWindow); + + newWindow.close(); + } + ); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-contextmenu-esc.js b/dom/base/test/fullscreen/browser_fullscreen-contextmenu-esc.js new file mode 100644 index 0000000000..e89409a90f --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-contextmenu-esc.js @@ -0,0 +1,128 @@ +"use strict"; + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +function captureUnexpectedFullscreenChange() { + ok(false, "Caught an unexpected fullscreen change"); +} + +const kPage = + "https://example.org/browser/dom/base/test/fullscreen/dummy_page.html"; + +function waitForDocActivated(aBrowser) { + return SpecialPowers.spawn(aBrowser, [], () => { + return ContentTaskUtils.waitForCondition( + () => content.browsingContext.isActive && content.document.hasFocus() + ); + }); +} + +add_task(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"] + ); + + let tab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + opening: kPage, + waitForStateStop: true, + }); + let browser = tab.linkedBrowser; + + // As requestFullscreen checks the active state of the docshell, + // wait for the document to be activated, just to be sure that + // the fullscreen request won't be denied. + await SpecialPowers.spawn(browser, [], () => { + return ContentTaskUtils.waitForCondition( + () => content.browsingContext.isActive && content.document.hasFocus() + ); + }); + + let contextMenu = document.getElementById("contentAreaContextMenu"); + ok(contextMenu, "Got context menu"); + + let state; + info("Enter DOM fullscreen"); + let fullScreenChangedPromise = BrowserTestUtils.waitForContentEvent( + browser, + "fullscreenchange" + ); + await SpecialPowers.spawn(browser, [], () => { + content.document.body.requestFullscreen(); + }); + + await fullScreenChangedPromise; + state = await SpecialPowers.spawn(browser, [], () => { + return !!content.document.fullscreenElement; + }); + ok(state, "The content should have entered fullscreen"); + ok(document.fullscreenElement, "The chrome should also be in fullscreen"); + + let removeContentEventListener = BrowserTestUtils.addContentEventListener( + browser, + "fullscreenchange", + captureUnexpectedFullscreenChange + ); + + info("Open context menu"); + is(contextMenu.state, "closed", "Should not have opened context menu"); + + let popupShownPromise = promiseWaitForEvent(window, "popupshown"); + + EventUtils.synthesizeMouse( + browser, + screen.width / 2, + screen.height / 2, + { type: "contextmenu", button: 2 }, + window + ); + await popupShownPromise; + is(contextMenu.state, "open", "Should have opened context menu"); + + let popupHidePromise = promiseWaitForEvent(window, "popuphidden"); + + if ( + !AppConstants.platform == "macosx" || + !Services.prefs.getBoolPref("widget.macos.native-context-menus", false) + ) { + info("Send the first escape"); + EventUtils.synthesizeKey("KEY_Escape"); + } else { + // We cannot synthesize key events at native macOS menus. + // We also do not see key events that are processed by native macOS menus, + // so we cannot accidentally exit fullscreen when the user closes a native + // menu with Escape. + // Close the menu normally. + info("Close the context menu"); + contextMenu.hidePopup(); + } + await popupHidePromise; + is(contextMenu.state, "closed", "Should have closed context menu"); + + // Wait a small time to confirm that the first ESC key + // does not exit fullscreen. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(resolve => setTimeout(resolve, 1000)); + state = await SpecialPowers.spawn(browser, [], () => { + return !!content.document.fullscreenElement; + }); + ok(state, "The content should still be in fullscreen"); + ok(document.fullscreenElement, "The chrome should still be in fullscreen"); + + removeContentEventListener(); + info("Send the second escape"); + let fullscreenExitPromise = BrowserTestUtils.waitForContentEvent( + browser, + "fullscreenchange" + ); + EventUtils.synthesizeKey("KEY_Escape"); + await fullscreenExitPromise; + ok(!document.fullscreenElement, "The chrome should have exited fullscreen"); + + gBrowser.removeTab(tab); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-document-mutation-navigation.js b/dom/base/test/fullscreen/browser_fullscreen-document-mutation-navigation.js new file mode 100644 index 0000000000..f6b5715f59 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-document-mutation-navigation.js @@ -0,0 +1,141 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +async function startTests(testFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = waitForFullscreenState(document, true); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // This should exit fullscreen + promiseFsState = waitForFullscreenState(document, false, true); + await testFun(browser); + await promiseFsState; + + // This test triggers a fullscreen request during the fullscreen exit + // process, so it could be possible that the widget or the chrome + // document goes into fullscreen mode again, but they should end up + // leaving fullscreen mode again. + if ( + window.fullScreen || + document.documentElement.hasAttribute("inFullscreen") + ) { + info("widget is still in fullscreen, wait again"); + await waitWidgetFullscreenEvent(window, false, true); + } + if (document.documentElement.hasAttribute("inDOMFullscreen")) { + info("chrome document is still in fullscreen, wait again"); + await waitForFullScreenObserver(document, false, true); + } + + // Ensure the browser exits fullscreen state. + ok(!window.fullScreen, "The widget should not be in fullscreen"); + ok( + !document.documentElement.hasAttribute("inFullscreen"), + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +function MutateAndNavigateFromRemoteDocument( + aBrowsingContext, + aElementId, + aURL +) { + return SpecialPowers.spawn( + aBrowsingContext, + [aElementId, aURL], + async function (id, url) { + let element = content.document.getElementById(id); + element.requestFullscreen(); + content.document.body.appendChild(element); + content.location.href = url; + } + ); +} + +startTests(async browser => { + // toplevel + await MutateAndNavigateFromRemoteDocument( + browser.browsingContext, + "div", + "about:blank" + ); +}, "document_mutation_navigation_toplevel"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + ]); + // middle iframe + await MutateAndNavigateFromRemoteDocument( + browser.browsingContext.children[0], + "div", + "about:blank" + ); + await promiseRemoteFsState; +}, "document_mutation_navigation_middle_frame"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + ]); + // innermost iframe + await MutateAndNavigateFromRemoteDocument( + browser.browsingContext.children[0].children[0], + "div", + "about:blank" + ); + await promiseRemoteFsState; +}, "document_mutation_navigation_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-document-mutation-race.js b/dom/base/test/fullscreen/browser_fullscreen-document-mutation-race.js new file mode 100644 index 0000000000..75ca199aaa --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-document-mutation-race.js @@ -0,0 +1,122 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +async function startTests(setupFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = Promise.all([ + setupFun(browser), + waitForFullscreenState(document, false, true), + ]); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok( + !window.fullScreen, + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +function RemoveElementFromRemoteDocument(aBrowsingContext, aElementId) { + return SpecialPowers.spawn( + aBrowsingContext, + [aElementId], + async function (id) { + content.document.addEventListener( + "fullscreenchange", + function () { + content.document.getElementById(id).remove(); + }, + { once: true } + ); + } + ); +} + +startTests(async browser => { + // toplevel + let promise = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + ]); + await RemoveElementFromRemoteDocument(browser.browsingContext, "div"); + return promise; +}, "document_mutation_toplevel"); + +startTests(async browser => { + // middle iframe + let promise = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + ]); + await RemoveElementFromRemoteDocument( + browser.browsingContext.children[0], + "div" + ); + return promise; +}, "document_mutation_middle_frame"); + +startTests(async browser => { + // innermost iframe + let promise = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + [browser.browsingContext.children[0].children[0], "inner"], + ]); + await RemoveElementFromRemoteDocument( + browser.browsingContext.children[0].children[0], + "div" + ); + return promise; +}, "document_mutation_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-document-mutation.js b/dom/base/test/fullscreen/browser_fullscreen-document-mutation.js new file mode 100644 index 0000000000..7cecdabb95 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-document-mutation.js @@ -0,0 +1,118 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +async function startTests(testFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = waitForFullscreenState(document, true); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // This should exit fullscreen + promiseFsState = waitForFullscreenState(document, false); + await testFun(browser); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok( + !window.fullScreen, + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +function RemoveElementFromRemoteDocument(aBrowsingContext, aElementId) { + return SpecialPowers.spawn( + aBrowsingContext, + [aElementId], + async function (id) { + content.document.getElementById(id).remove(); + } + ); +} + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + ]); + // toplevel + await RemoveElementFromRemoteDocument(browser.browsingContext, "div"); + await promiseRemoteFsState; +}, "document_mutation_toplevel"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + ]); + // middle iframe + await RemoveElementFromRemoteDocument( + browser.browsingContext.children[0], + "div" + ); + await promiseRemoteFsState; +}, "document_mutation_middle_frame"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + [browser.browsingContext.children[0].children[0], "inner"], + ]); + // innermost iframe + await RemoveElementFromRemoteDocument( + browser.browsingContext.children[0].children[0], + "div" + ); + await promiseRemoteFsState; +}, "document_mutation_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-navigation-history.js b/dom/base/test/fullscreen/browser_fullscreen-navigation-history.js new file mode 100644 index 0000000000..08624ed327 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-navigation-history.js @@ -0,0 +1,100 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error, bug 1742890. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +function preventBFCache(aBrowsingContext, aPrevent) { + return SpecialPowers.spawn(aBrowsingContext, [aPrevent], prevent => { + if (prevent) { + // Using a dummy onunload listener to disable the bfcache. + content.window.addEventListener("unload", () => {}); + } + content.window.addEventListener( + "pagehide", + e => { + // XXX checking persisted property causes intermittent failures, so we + // dump the value instead, bug 1822263. + // is(e.persisted, !prevent, `Check BFCache state`); + info(`Check BFCache state: e.persisted is ${e.persisted}`); + }, + { once: true } + ); + }); +} + +[true, false].forEach(crossOrigin => { + [true, false].forEach(initialPagePreventsBFCache => { + [true, false].forEach(fullscreenPagePreventsBFCache => { + add_task(async function navigation_history() { + info( + `crossOrigin: ${crossOrigin}, initialPagePreventsBFCache: ${initialPagePreventsBFCache}, fullscreenPagePreventsBFCache: ${fullscreenPagePreventsBFCache}` + ); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: "http://mochi.test:8888/browser/dom/base/test/fullscreen/dummy_page.html", + }, + async function (browser) { + // Maybe prevent BFCache on initial page. + await preventBFCache( + browser.browsingContext, + initialPagePreventsBFCache + ); + + // Navigate to fullscreen page. + const url = crossOrigin + ? "https://example.org/browser/dom/base/test/fullscreen/file_fullscreen-iframe-inner.html" + : "http://mochi.test:8888/browser/dom/base/test/fullscreen/file_fullscreen-iframe-inner.html"; + const loaded = BrowserTestUtils.browserLoaded(browser, false, url); + BrowserTestUtils.loadURIString(browser, url); + await loaded; + + // Maybe prevent BFCache on fullscreen test page. + await preventBFCache( + browser.browsingContext, + fullscreenPagePreventsBFCache + ); + + // Trigger click event to enter fullscreen. + let promiseFsState = waitForFullscreenState(document, true); + SpecialPowers.spawn(browser.browsingContext, [], () => { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + }); + await promiseFsState; + + // Navigate back to the previous page should exit fullscreen. + promiseFsState = waitForFullscreenState(document, false); + await SpecialPowers.spawn(browser.browsingContext, [], () => { + content.window.history.back(); + }); + await promiseFsState; + } + ); + }); + }); + }); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-navigation-race.js b/dom/base/test/fullscreen/browser_fullscreen-navigation-race.js new file mode 100644 index 0000000000..f9d1543a1a --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-navigation-race.js @@ -0,0 +1,162 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +add_task(async function navigation() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: `data:text/html, + + `, + }, + async function (browser) { + BrowserTestUtils.synthesizeMouseAtCenter("#button", {}, browser); + + // Give some time for fullscreen transition. + await new Promise(aResolve => { + SimpleTest.executeSoon(() => { + SimpleTest.executeSoon(aResolve); + }); + }); + + // Wait fullscreen exit event if browser is still in fullscreen mode. + if ( + window.fullScreen || + document.documentElement.hasAttribute("inFullscreen") + ) { + info("The widget is still in fullscreen, wait again"); + await waitWidgetFullscreenEvent(window, false, true); + } + if (document.documentElement.hasAttribute("inDOMFullscreen")) { + info("The chrome document is still in fullscreen, wait again"); + await waitForFullScreenObserver(window, false, true); + } + + // Ensure the browser exits fullscreen state. + ok(!window.fullScreen, "The widget should not be in fullscreen"); + ok( + !document.documentElement.hasAttribute("inFullscreen"), + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); +}); + +async function startTests(setupFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = Promise.all([ + setupFun(browser), + waitForFullscreenState(document, false, true), + ]); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok( + !window.fullScreen, + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +function NavigateRemoteDocument(aBrowsingContext, aURL) { + return SpecialPowers.spawn(aBrowsingContext, [aURL], async function (url) { + content.document.addEventListener( + "fullscreenchange", + function () { + content.location.href = url; + }, + { once: true } + ); + }); +} + +startTests(async browser => { + // toplevel + await NavigateRemoteDocument(browser.browsingContext, "about:blank"); +}, "navigation_toplevel"); + +startTests(async browser => { + // middle iframe + let promise = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + ]); + await NavigateRemoteDocument( + browser.browsingContext.children[0], + "about:blank" + ); + return promise; +}, "navigation_middle_frame"); + +startTests(async browser => { + // innermost iframe + let promise = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + ]); + await NavigateRemoteDocument( + browser.browsingContext.children[0].children[0], + "about:blank" + ); + return promise; +}, "navigation_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-navigation.js b/dom/base/test/fullscreen/browser_fullscreen-navigation.js new file mode 100644 index 0000000000..02387eb437 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-navigation.js @@ -0,0 +1,142 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +add_task(async function navigation() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: `data:text/html, + + `, + }, + async function (browser) { + let promiseFsState = waitForFullscreenState(document, true); + // Trigger click event + BrowserTestUtils.synthesizeMouseAtCenter("#button", {}, browser); + await promiseFsState; + + promiseFsState = waitForFullscreenState(document, false); + await SpecialPowers.spawn(browser, [], async function () { + content.location.href = "about:blank"; + }); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok(!window.fullScreen, "The chrome window should not be in fullscreen"); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); +}); + +async function startTests(testFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = waitForFullscreenState(document, true); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // This should exit fullscreen + promiseFsState = waitForFullscreenState(document, false); + await testFun(browser); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok( + !window.fullScreen, + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +function NavigateRemoteDocument(aBrowsingContext, aURL) { + return SpecialPowers.spawn(aBrowsingContext, [aURL], async function (url) { + content.location.href = url; + }); +} + +startTests(async browser => { + // toplevel + await NavigateRemoteDocument(browser.browsingContext, "about:blank"); +}, "navigation_toplevel"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + ]); + // middle iframe + await NavigateRemoteDocument( + browser.browsingContext.children[0], + "about:blank" + ); + await promiseRemoteFsState; +}, "navigation_middle_frame"); + +startTests(async browser => { + let promiseRemoteFsState = waitRemoteFullscreenExitEvents([ + // browsingContext, name + [browser.browsingContext, "toplevel"], + [browser.browsingContext.children[0], "middle"], + ]); + // innermost iframe + await NavigateRemoteDocument( + browser.browsingContext.children[0].children[0], + "about:blank" + ); + await promiseRemoteFsState; +}, "navigation_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-newtab.js b/dom/base/test/fullscreen/browser_fullscreen-newtab.js new file mode 100644 index 0000000000..af714b1248 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-newtab.js @@ -0,0 +1,91 @@ +"use strict"; + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +const kPage = + "https://example.org/browser/" + + "dom/base/test/fullscreen/file_fullscreen-newtab.html"; + +function getSizeMode() { + return document.documentElement.getAttribute("sizemode"); +} + +async function runTest() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: kPage, + }, + async function (browser) { + let promiseFsEvents = SpecialPowers.spawn(browser, [], function () { + return new Promise(resolve => { + let countFsChange = 0; + let countFsError = 0; + function checkAndResolve() { + if (countFsChange > 0 && countFsError > 0) { + Assert.ok( + false, + "Got both fullscreenchange and fullscreenerror events" + ); + } else if (countFsChange > 2) { + Assert.ok(false, "Got too many fullscreenchange events"); + } else if (countFsError > 1) { + Assert.ok(false, "Got too many fullscreenerror events"); + } else if (countFsChange == 2 || countFsError == 1) { + resolve(); + } + } + + content.document.addEventListener("fullscreenchange", () => { + ++countFsChange; + checkAndResolve(); + }); + content.document.addEventListener("fullscreenerror", () => { + ++countFsError; + checkAndResolve(); + }); + }); + }); + let promiseNewTab = BrowserTestUtils.waitForNewTab( + gBrowser, + "about:blank" + ); + await BrowserTestUtils.synthesizeMouseAtCenter("#link", {}, browser); + let [newtab] = await Promise.all([promiseNewTab, promiseFsEvents]); + await BrowserTestUtils.removeTab(newtab); + + // Ensure the browser exits fullscreen state in reasonable time. + await Promise.race([ + BrowserTestUtils.waitForCondition(() => getSizeMode() == "normal"), + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + new Promise(resolve => setTimeout(resolve, 2000)), + ]); + + ok(!window.fullScreen, "The chrome window should not be in fullscreen"); + ok( + !document.fullscreen, + "The chrome document should not be in fullscreen" + ); + } + ); +} + +add_task(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"] + ); + await runTest(); +}); + +add_task(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "200 200"], + ["full-screen-api.transition-duration.leave", "200 200"] + ); + await runTest(); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-sizemode.js b/dom/base/test/fullscreen/browser_fullscreen-sizemode.js new file mode 100644 index 0000000000..0aa79e5694 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-sizemode.js @@ -0,0 +1,225 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const isMac = AppConstants.platform == "macosx"; +const isWin = AppConstants.platform == "win"; + +async function waitForSizeMode(aWindow, aSizeMode) { + await BrowserTestUtils.waitForEvent(aWindow, "sizemodechange", false, () => { + return aWindow.windowState === aSizeMode; + }); + const expectedHidden = + aSizeMode == aWindow.STATE_MINIMIZED || aWindow.isFullyOccluded; + if (aWindow.document.hidden != expectedHidden) { + await BrowserTestUtils.waitForEvent(aWindow, "visibilitychange"); + } + is( + aWindow.document.hidden, + expectedHidden, + "Should be inactive if minimized or occluded" + ); +} + +async function checkSizeModeAndFullscreenState( + aWindow, + aSizeMode, + aFullscreen, + aFullscreenEventShouldHaveFired, + aStepFun +) { + let promises = []; + if (aWindow.windowState != aSizeMode) { + promises.push(waitForSizeMode(aWindow, aSizeMode)); + } + if (aFullscreenEventShouldHaveFired) { + promises.push( + BrowserTestUtils.waitForEvent( + aWindow, + aFullscreen ? "willenterfullscreen" : "willexitfullscreen" + ) + ); + promises.push(BrowserTestUtils.waitForEvent(aWindow, "fullscreen")); + } + + // Add listener for unexpected event. + let unexpectedEventListener = aEvent => { + ok(false, `should not receive ${aEvent.type} event`); + }; + if (aFullscreenEventShouldHaveFired) { + aWindow.addEventListener( + aFullscreen ? "willexitfullscreen" : "willenterfullscreen", + unexpectedEventListener + ); + } else { + aWindow.addEventListener("willenterfullscreen", unexpectedEventListener); + aWindow.addEventListener("willexitfullscreen", unexpectedEventListener); + aWindow.addEventListener("fullscreen", unexpectedEventListener); + } + + let eventPromise = Promise.all(promises); + aStepFun(); + await eventPromise; + + // Check SizeMode. + is( + aWindow.windowState, + aSizeMode, + "The new sizemode should have the expected value" + ); + // Check Fullscreen state. + is( + aWindow.fullScreen, + aFullscreen, + `chrome window should ${aFullscreen ? "be" : "not be"} in fullscreen` + ); + is( + aWindow.document.documentElement.hasAttribute("inFullscreen"), + aFullscreen, + `chrome documentElement should ${ + aFullscreen ? "have" : "not have" + } inFullscreen attribute` + ); + + // Remove listener for unexpected event. + if (aFullscreenEventShouldHaveFired) { + aWindow.removeEventListener( + aFullscreen ? "willexitfullscreen" : "willenterfullscreen", + unexpectedEventListener + ); + } else { + aWindow.removeEventListener("willenterfullscreen", unexpectedEventListener); + aWindow.removeEventListener("willexitfullscreen", unexpectedEventListener); + aWindow.removeEventListener("fullscreen", unexpectedEventListener); + } +} + +async function restoreWindowToNormal(aWindow) { + while (aWindow.windowState != aWindow.STATE_NORMAL) { + info(`Try to restore window with state ${aWindow.windowState} to normal`); + let eventPromise = BrowserTestUtils.waitForEvent(aWindow, "sizemodechange"); + aWindow.restore(); + await eventPromise; + info(`Window is now in state ${aWindow.windowState}`); + } +} + +add_task(async function test_fullscreen_restore() { + let win = await BrowserTestUtils.openNewBrowserWindow(); + await restoreWindowToNormal(win); + + info("Enter fullscreen"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_FULLSCREEN, + true, + true, + () => { + win.fullScreen = true; + } + ); + + info("Restore window"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_NORMAL, + false, + true, + () => { + win.restore(); + } + ); + + await BrowserTestUtils.closeWindow(win); +}); + +// This test only enable on Windows because: +// - Test gets intermittent timeout on macOS, see bug 1828848. +// - Restoring a fullscreen window on GTK doesn't return it to the previous +// sizemode, see bug 1828837. +if (isWin) { + add_task(async function test_maximize_fullscreen_restore() { + let win = await BrowserTestUtils.openNewBrowserWindow(); + await restoreWindowToNormal(win); + + info("Maximize window"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_MAXIMIZED, + false, + false, + () => { + win.maximize(); + } + ); + + info("Enter fullscreen"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_FULLSCREEN, + true, + true, + () => { + win.fullScreen = true; + } + ); + + info("Restore window"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_MAXIMIZED, + false, + true, + () => { + win.restore(); + } + ); + + await BrowserTestUtils.closeWindow(win); + }); +} + +// Restoring a minimized window on macOS doesn't return it to the previous +// sizemode, see bug 1828706. +if (!isMac) { + add_task(async function test_fullscreen_minimize_restore() { + let win = await BrowserTestUtils.openNewBrowserWindow(); + await restoreWindowToNormal(win); + + info("Enter fullscreen"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_FULLSCREEN, + true, + true, + () => { + win.fullScreen = true; + } + ); + + info("Minimize window"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_MINIMIZED, + true, + false, + () => { + win.minimize(); + } + ); + + info("Restore window"); + await checkSizeModeAndFullscreenState( + win, + win.STATE_FULLSCREEN, + true, + false, + () => { + win.restore(); + } + ); + + await BrowserTestUtils.closeWindow(win); + }); +} diff --git a/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js new file mode 100644 index 0000000000..f1b300b93a --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js @@ -0,0 +1,101 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +async function startTests(setupFun, name) { + TEST_URLS.forEach(url => { + add_task(async () => { + info(`Test ${name}, url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = waitForFullscreenExit(document); + setupFun(browser); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + // Ensure the browser exits fullscreen state. + ok( + !window.fullScreen, + "The chrome window should not be in fullscreen" + ); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); + }); +} + +async function WaitRemoveDocumentAndCloseTab(aBrowser, aBrowsingContext) { + await SpecialPowers.spawn(aBrowsingContext, [], async function () { + return new Promise(resolve => { + content.document.addEventListener( + "fullscreenchange", + e => { + resolve(); + }, + { once: true } + ); + }); + }); + + // This should exit fullscreen + let tab = gBrowser.getTabForBrowser(aBrowser); + BrowserTestUtils.removeTab(tab); +} + +startTests(async browser => { + // toplevel + WaitRemoveDocumentAndCloseTab(browser, browser.browsingContext); +}, "tab_close_toplevel"); + +startTests(browser => { + // middle iframe + WaitRemoveDocumentAndCloseTab(browser, browser.browsingContext.children[0]); +}, "tab_close_middle_frame"); + +startTests(async browser => { + // innermost iframe + WaitRemoveDocumentAndCloseTab( + browser, + browser.browsingContext.children[0].children[0] + ); +}, "tab_close_inner_frame"); diff --git a/dom/base/test/fullscreen/browser_fullscreen-tab-close.js b/dom/base/test/fullscreen/browser_fullscreen-tab-close.js new file mode 100644 index 0000000000..7d1772cd48 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-tab-close.js @@ -0,0 +1,65 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +TEST_URLS.forEach(url => { + add_task(async () => { + info(`url: ${url}`); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + let promiseFsState = waitForFullscreenState(document, true); + // Trigger click event in inner most iframe + SpecialPowers.spawn( + browser.browsingContext.children[0].children[0], + [], + function () { + content.setTimeout(() => { + content.document.getElementById("div").click(); + }, 0); + } + ); + await promiseFsState; + + let promiseFsExit = waitForFullscreenExit(document, false); + // This should exit fullscreen + let tab = gBrowser.getTabForBrowser(browser); + BrowserTestUtils.removeTab(tab); + await promiseFsExit; + + // Ensure the browser exits fullscreen state. + ok(!window.fullScreen, "The chrome window should not be in fullscreen"); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + } + ); + }); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen-window-open-race.js b/dom/base/test/fullscreen/browser_fullscreen-window-open-race.js new file mode 100644 index 0000000000..4cf8a3d8c7 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen-window-open-race.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error, bug 1742890. +SimpleTest.ignoreAllUncaughtExceptions(true); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +add_task(async () => { + const url = + "http://mochi.test:8888/browser/dom/base/test/fullscreen/dummy_page.html"; + const name = "foo"; + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + info("open new window"); + SpecialPowers.spawn(browser, [url, name], function (u, n) { + content.document.notifyUserGestureActivation(); + content.window.open(u, n, "width=100,height=100"); + }); + let newWin = await BrowserTestUtils.waitForNewWindow({ url }); + await SimpleTest.promiseFocus(newWin); + + info("re-focusing main window"); + await SimpleTest.promiseFocus(window); + + info("open an existing window and request fullscreen"); + await SpecialPowers.spawn(browser, [url, name], function (u, n) { + content.document.notifyUserGestureActivation(); + content.window.open(u, n); + content.document.body.requestFullscreen(); + }); + + // We call window.open() first than requestFullscreen() in a row on + // content page, but given that focus sync-up takes several IPC exchanges, + // so parent process ends up processing the requests in a reverse order, + // which should reject the fullscreen request and leave fullscreen. + await waitWidgetFullscreenEvent(window, false, true); + + // Ensure the browser exits fullscreen state. + ok(!window.fullScreen, "The chrome window should not be in fullscreen"); + ok( + !document.documentElement.hasAttribute("inDOMFullscreen"), + "The chrome document should not be in fullscreen" + ); + + await BrowserTestUtils.closeWindow(newWin); + } + ); +}); diff --git a/dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js b/dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js new file mode 100644 index 0000000000..6f525da541 --- /dev/null +++ b/dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js @@ -0,0 +1,215 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +SimpleTest.requestCompleteLog(); + +requestLongerTimeout(2); + +// Import helpers +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/dom/base/test/fullscreen/fullscreen_helpers.js", + this +); + +add_setup(async function () { + await pushPrefs( + ["full-screen-api.transition-duration.enter", "0 0"], + ["full-screen-api.transition-duration.leave", "0 0"], + ["full-screen-api.allow-trusted-requests-only", false] + ); +}); + +const { HandlerServiceTestUtils } = ChromeUtils.importESModule( + "resource://testing-common/HandlerServiceTestUtils.sys.mjs" +); + +const gHandlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"].getService( + Ci.nsIHandlerService +); + +const CONTENT = `data:text/html, + + + + + + +`; + +// This test tends to trigger a race in the fullscreen time telemetry, +// where the fullscreen enter and fullscreen exit events (which use the +// same histogram ID) overlap. That causes TelemetryStopwatch to log an +// error. +SimpleTest.ignoreAllUncaughtExceptions(true); + +function setupMailHandler() { + let mailHandlerInfo = HandlerServiceTestUtils.getHandlerInfo("mailto"); + let gOldMailHandlers = []; + + // Remove extant web handlers because they have icons that + // we fetch from the web, which isn't allowed in tests. + let handlers = mailHandlerInfo.possibleApplicationHandlers; + for (let i = handlers.Count() - 1; i >= 0; i--) { + try { + let handler = handlers.queryElementAt(i, Ci.nsIWebHandlerApp); + gOldMailHandlers.push(handler); + // If we get here, this is a web handler app. Remove it: + handlers.removeElementAt(i); + } catch (ex) {} + } + + let previousHandling = mailHandlerInfo.alwaysAskBeforeHandling; + mailHandlerInfo.alwaysAskBeforeHandling = true; + + // Create a dummy web mail handler so we always know the mailto: protocol. + // Without this, the test fails on VMs without a default mailto: handler, + // because no dialog is ever shown, as we ignore subframe navigations to + // protocols that cannot be handled. + let dummy = Cc["@mozilla.org/uriloader/web-handler-app;1"].createInstance( + Ci.nsIWebHandlerApp + ); + dummy.name = "Handler 1"; + dummy.uriTemplate = "https://example.com/first/%s"; + mailHandlerInfo.possibleApplicationHandlers.appendElement(dummy); + + gHandlerSvc.store(mailHandlerInfo); + registerCleanupFunction(() => { + // Re-add the original protocol handlers: + let mailHandlers = mailHandlerInfo.possibleApplicationHandlers; + for (let i = handlers.Count() - 1; i >= 0; i--) { + try { + // See if this is a web handler. If it is, it'll throw, otherwise, + // we will remove it. + mailHandlers.queryElementAt(i, Ci.nsIWebHandlerApp); + mailHandlers.removeElementAt(i); + } catch (ex) {} + } + for (let h of gOldMailHandlers) { + mailHandlers.appendElement(h); + } + mailHandlerInfo.alwaysAskBeforeHandling = previousHandling; + gHandlerSvc.store(mailHandlerInfo); + }); +} + +add_task(setupMailHandler); + +// Fullscreen is canceled during fullscreen transition +add_task(async function OpenExternalProtocolOnPendingLaterFullscreen() { + for (const useClick of [true, false]) { + await BrowserTestUtils.withNewTab(CONTENT, async browser => { + const leavelFullscreen = waitForFullscreenState(document, false, true); + await SpecialPowers.spawn( + browser, + [useClick], + async function (shouldClick) { + const button = content.document.querySelector("button"); + + const clickDone = new Promise(r => { + button.addEventListener( + "click", + function () { + content.document.documentElement.requestFullscreen(); + // When anchor.click() is called, the fullscreen request + // is probably still pending. + content.setTimeout(() => { + if (shouldClick) { + content.document.querySelector("a").click(); + } else { + content.document.location = "mailto:test@example.com"; + } + r(); + }, 0); + }, + { once: true } + ); + }); + button.click(); + await clickDone; + } + ); + + await leavelFullscreen; + ok(true, "Fullscreen should be exited"); + }); + } +}); + +// Fullscreen is canceled immediately. +add_task(async function OpenExternalProtocolOnPendingFullscreen() { + for (const useClick of [true, false]) { + await BrowserTestUtils.withNewTab(CONTENT, async browser => { + await SpecialPowers.spawn( + browser, + [useClick], + async function (shouldClick) { + const button = content.document.querySelector("button"); + + const clickDone = new Promise(r => { + button.addEventListener( + "click", + function () { + content.document.documentElement + .requestFullscreen() + .then(() => { + ok(false, "Don't enter fullscreen"); + }) + .catch(() => { + ok(true, "Cancel entering fullscreen"); + r(); + }); + // When anchor.click() is called, the fullscreen request + // is probably still pending. + if (shouldClick) { + content.document.querySelector("a").click(); + } else { + content.document.location = "mailto:test@example.com"; + } + }, + { once: true } + ); + }); + button.click(); + await clickDone; + } + ); + + ok(true, "Fullscreen should be exited"); + }); + } +}); + +add_task(async function OpenExternalProtocolOnFullscreen() { + for (const useClick of [true, false]) { + await BrowserTestUtils.withNewTab(CONTENT, async browser => { + const leavelFullscreen = waitForFullscreenState(document, false, true); + await SpecialPowers.spawn( + browser, + [useClick], + async function (shouldClick) { + let button = content.document.querySelector("button"); + button.addEventListener("click", function () { + content.document.documentElement.requestFullscreen(); + }); + button.click(); + + await new Promise(r => { + content.document.addEventListener("fullscreenchange", r); + }); + + if (shouldClick) { + content.document.querySelector("a").click(); + } else { + content.document.location = "mailto:test@example.com"; + } + } + ); + + await leavelFullscreen; + ok(true, "Fullscreen should be exited"); + }); + } +}); diff --git a/dom/base/test/fullscreen/chrome.ini b/dom/base/test/fullscreen/chrome.ini new file mode 100644 index 0000000000..cf60c0f0b5 --- /dev/null +++ b/dom/base/test/fullscreen/chrome.ini @@ -0,0 +1,10 @@ +[DEFAULT] +tags = fullscreen + +[test_fullscreen.xhtml] +support-files = + file_MozDomFullscreen.html +[test_MozDomFullscreen_event.xhtml] +support-files = + fullscreen.xhtml + MozDomFullscreen_chrome.xhtml diff --git a/dom/base/test/fullscreen/dummy_page.html b/dom/base/test/fullscreen/dummy_page.html new file mode 100644 index 0000000000..fd238954c6 --- /dev/null +++ b/dom/base/test/fullscreen/dummy_page.html @@ -0,0 +1,10 @@ + + + +Dummy test page + + + +

            Dummy test page

            + + diff --git a/dom/base/test/fullscreen/file_MozDomFullscreen.html b/dom/base/test/fullscreen/file_MozDomFullscreen.html new file mode 100644 index 0000000000..f954892706 --- /dev/null +++ b/dom/base/test/fullscreen/file_MozDomFullscreen.html @@ -0,0 +1,8 @@ + + + + +

            Outer doc

            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-api-keys.html b/dom/base/test/fullscreen/file_fullscreen-api-keys.html new file mode 100644 index 0000000000..f526aa55ba --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-api-keys.html @@ -0,0 +1,41 @@ + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-api-race.html b/dom/base/test/fullscreen/file_fullscreen-api-race.html new file mode 100644 index 0000000000..8310bc0a60 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-api-race.html @@ -0,0 +1,8 @@ + + + + Helper file for test_fullscreen-api-race.html + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-api.html b/dom/base/test/fullscreen/file_fullscreen-api.html new file mode 100644 index 0000000000..645e6ece46 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-api.html @@ -0,0 +1,340 @@ + + + + + Test for Bug 545812 + + + + + + +
            + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-async.html b/dom/base/test/fullscreen/file_fullscreen-async.html new file mode 100644 index 0000000000..e9b4147124 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-async.html @@ -0,0 +1,50 @@ + +Test for Bug 1129227 + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-backdrop.html b/dom/base/test/fullscreen/file_fullscreen-backdrop.html new file mode 100644 index 0000000000..27be77a6d1 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-backdrop.html @@ -0,0 +1,107 @@ + + + + + Test for Bug 1064843 + + + + + + + + +
            +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html new file mode 100644 index 0000000000..61db80c228 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html @@ -0,0 +1,22 @@ + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html b/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html new file mode 100644 index 0000000000..7490f12936 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html @@ -0,0 +1,14 @@ + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-denied-inner.html b/dom/base/test/fullscreen/file_fullscreen-denied-inner.html new file mode 100644 index 0000000000..6b5916b2e2 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-denied-inner.html @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-denied.html b/dom/base/test/fullscreen/file_fullscreen-denied.html new file mode 100644 index 0000000000..db9a69e71a --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-denied.html @@ -0,0 +1,171 @@ + + + + + Test for Bug 545812 + + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html b/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html new file mode 100644 index 0000000000..d7d8a90aaf --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html @@ -0,0 +1,58 @@ + + + + + Test for Bug 700764 + + + + + + + +

            Inner frame

            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-esc-exit.html b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html new file mode 100644 index 0000000000..f65f930b3f --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html @@ -0,0 +1,63 @@ + + + + + Test for Bug 700764 + + + + + + + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-event-order.html b/dom/base/test/fullscreen/file_fullscreen-event-order.html new file mode 100644 index 0000000000..72fb2c9b47 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-event-order.html @@ -0,0 +1,50 @@ + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-featurePolicy-inner.html b/dom/base/test/fullscreen/file_fullscreen-featurePolicy-inner.html new file mode 100644 index 0000000000..844684b054 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-featurePolicy-inner.html @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-featurePolicy.html b/dom/base/test/fullscreen/file_fullscreen-featurePolicy.html new file mode 100644 index 0000000000..c8b943c612 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-featurePolicy.html @@ -0,0 +1,90 @@ + + + + Test for FeaturePolicy + fullscreen + + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-focus-inner.html b/dom/base/test/fullscreen/file_fullscreen-focus-inner.html new file mode 100644 index 0000000000..73d39a9d83 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-focus-inner.html @@ -0,0 +1,24 @@ + + + + Focus test - child window + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-focus.html b/dom/base/test/fullscreen/file_fullscreen-focus.html new file mode 100644 index 0000000000..be91025f45 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-focus.html @@ -0,0 +1,67 @@ + + + + + Test fullscreen request is blocked when window is not focused + + + + + + + + +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-hidden.html b/dom/base/test/fullscreen/file_fullscreen-hidden.html new file mode 100644 index 0000000000..bd8c8189c9 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-hidden.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 697636 + + + + + + + +Mozilla Bug 697636 +

            + +
            +
            +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-iframe-inner.html b/dom/base/test/fullscreen/file_fullscreen-iframe-inner.html new file mode 100644 index 0000000000..4a614fdecf --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-iframe-inner.html @@ -0,0 +1,5 @@ + + +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-iframe-middle.html b/dom/base/test/fullscreen/file_fullscreen-iframe-middle.html new file mode 100644 index 0000000000..b60dea43bf --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-iframe-middle.html @@ -0,0 +1,5 @@ +
            + +

            diff --git a/dom/base/test/fullscreen/file_fullscreen-iframe-top.html b/dom/base/test/fullscreen/file_fullscreen-iframe-top.html new file mode 100644 index 0000000000..dddf4930c2 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-iframe-top.html @@ -0,0 +1,5 @@ +
            + +

            diff --git a/dom/base/test/fullscreen/file_fullscreen-lenient-setters.html b/dom/base/test/fullscreen/file_fullscreen-lenient-setters.html new file mode 100644 index 0000000000..02491c177e --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-lenient-setters.html @@ -0,0 +1,61 @@ + + + + + Test for Bug 1268798 + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-multiple-inner.html b/dom/base/test/fullscreen/file_fullscreen-multiple-inner.html new file mode 100644 index 0000000000..cb5ca9b28e --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-multiple-inner.html @@ -0,0 +1,25 @@ + + + + Test for Bug 724554 + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-multiple.html b/dom/base/test/fullscreen/file_fullscreen-multiple.html new file mode 100644 index 0000000000..f9e35b5e78 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-multiple.html @@ -0,0 +1,67 @@ + + + + + Test for Bug 724554 + + + + + + + + +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-navigation.html b/dom/base/test/fullscreen/file_fullscreen-navigation.html new file mode 100644 index 0000000000..9b68fedf9a --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-navigation.html @@ -0,0 +1,52 @@ + + + + + Test for Bug 685402 + + + + + + + +Mozilla Bug 685402 +

            + +
            +
            +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-nested.html b/dom/base/test/fullscreen/file_fullscreen-nested.html new file mode 100644 index 0000000000..1629d8386c --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-nested.html @@ -0,0 +1,130 @@ + + + + Test for Bug 1187801 + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-newtab.html b/dom/base/test/fullscreen/file_fullscreen-newtab.html new file mode 100644 index 0000000000..0eaf5dd546 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-newtab.html @@ -0,0 +1,4 @@ + + +Click here diff --git a/dom/base/test/fullscreen/file_fullscreen-prefixed.html b/dom/base/test/fullscreen/file_fullscreen-prefixed.html new file mode 100644 index 0000000000..dfe1965365 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-prefixed.html @@ -0,0 +1,153 @@ + + + + + Test for Bug 743198 + + + + +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-resize.html b/dom/base/test/fullscreen/file_fullscreen-resize.html new file mode 100644 index 0000000000..3050ba0d5d --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-resize.html @@ -0,0 +1,39 @@ + + + + + Test for Bug 1742421 + + + + + +Mozilla Bug 1742421 +

            + +
            +
            +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-rollback.html b/dom/base/test/fullscreen/file_fullscreen-rollback.html new file mode 100644 index 0000000000..b1578b39cd --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-rollback.html @@ -0,0 +1,140 @@ + + + + + Test for Bug 700764 + + + + + + +
            +
            + +
            +
            + +
            + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-scrollbar.html b/dom/base/test/fullscreen/file_fullscreen-scrollbar.html new file mode 100644 index 0000000000..05ab51431a --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-scrollbar.html @@ -0,0 +1,147 @@ + + + + + Test for Bug 1201798 + + + + + + +
            +
            +
            +
            +
            +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-selector.html b/dom/base/test/fullscreen/file_fullscreen-selector.html new file mode 100644 index 0000000000..64947b6cfd --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-selector.html @@ -0,0 +1,183 @@ + + + + Test for Bug 1199522 + + + + + + + + +
            +
            +
            +
            +
            +
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-shadowdom.html b/dom/base/test/fullscreen/file_fullscreen-shadowdom.html new file mode 100644 index 0000000000..348e08ae87 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-shadowdom.html @@ -0,0 +1,52 @@ + + + + + Bug 1430305 + + + + + + + Mozilla Bug 1430305 + +
            + +
            +      
            +    
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-single.html b/dom/base/test/fullscreen/file_fullscreen-single.html new file mode 100644 index 0000000000..2ebc58bdae --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-single.html @@ -0,0 +1,78 @@ + + + + + Simple Fullscreen Enter and Exit Test + + + + + + +

            Fullscreen div

            + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-sub-iframe.html b/dom/base/test/fullscreen/file_fullscreen-sub-iframe.html new file mode 100644 index 0000000000..28b0235c87 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-sub-iframe.html @@ -0,0 +1,53 @@ + +Test for Bug 1609180 + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-svg-element.html b/dom/base/test/fullscreen/file_fullscreen-svg-element.html new file mode 100644 index 0000000000..1dfc78aa1c --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-svg-element.html @@ -0,0 +1,49 @@ + + + + + Bug 735031 + + + + + + + Mozilla Bug 735031 + + + + + +
            +      
            +    
            + + diff --git a/dom/base/test/fullscreen/file_fullscreen-table.html b/dom/base/test/fullscreen/file_fullscreen-table.html new file mode 100644 index 0000000000..39c602334a --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-table.html @@ -0,0 +1,52 @@ + + + + + Test for Bug 1223561 + + + + + + +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-top-layer.html b/dom/base/test/fullscreen/file_fullscreen-top-layer.html new file mode 100644 index 0000000000..9e95182b02 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-top-layer.html @@ -0,0 +1,160 @@ + + + + + Test for Bug 1126230 + + + + + + + +Mozilla Bug 1126230 +
            +
            +
            +
            + + + + + + + + + diff --git a/dom/base/test/fullscreen/file_fullscreen-utils.js b/dom/base/test/fullscreen/file_fullscreen-utils.js new file mode 100644 index 0000000000..b4779da4de --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-utils.js @@ -0,0 +1,87 @@ +// Keep track of how many fullscreenChange enters we've received, so that +// we can balance them with the number of exits we receive. We reset this +// to 0 when we load a test. +var fullscreenChangeEnters = 0; + +addLoadEvent(function () { + info(`Resetting fullscreen enter count.`); + fullscreenChangeEnters = 0; +}); + +// This can be used to force a certain value for fullscreenChangeEnters +// to handle unusual conditions -- such as exiting multiple levels of +// fullscreen forcibly. +function setFullscreenChangeEnters(enters) { + info(`Setting fullscreen enter count to ${enters}.`); + fullscreenChangeEnters = enters; +} + +// Returns true if the window believes it is in fullscreen. This may be true even +// before an asynchronous fullscreen transition is complete. +function inFullscreenMode(win) { + return win.document.fullscreenElement; +} + +// Adds a listener that will be called once a fullscreen transition +// is complete. When type==='enter', callback is called when we've +// received a fullscreenchange event, and the fullscreen transition is +// complete. When type==='exit', callback is called when we've +// received a fullscreenchange event and the window is out of +// fullscreen. inDoc is the document which the listeners are added on, +// if absent, the listeners are added to the current document. +// the current document. +function addFullscreenChangeContinuation(type, callback, inDoc) { + var doc = inDoc || document; + var topWin = doc.defaultView.top; + function checkCondition() { + if (type == "enter") { + fullscreenChangeEnters++; + return inFullscreenMode(topWin); + } else if (type == "exit") { + fullscreenChangeEnters--; + return fullscreenChangeEnters + ? inFullscreenMode(topWin) + : !inFullscreenMode(topWin); + } + throw new Error("'type' must be either 'enter', or 'exit'."); + } + function onFullscreenChange(event) { + doc.removeEventListener("fullscreenchange", onFullscreenChange); + ok(checkCondition(), `Should ${type} fullscreen.`); + // Delay invocation so other listeners have a chance to respond before + // we continue. + requestAnimationFrame(() => setTimeout(() => callback(event), 0), 0); + } + doc.addEventListener("fullscreenchange", onFullscreenChange); +} + +// Calls |callback| when the next fullscreenerror is dispatched to inDoc||document. +function addFullscreenErrorContinuation(callback, inDoc) { + let doc = inDoc || document; + let listener = function (event) { + doc.removeEventListener("fullscreenerror", listener); + // Delay invocation so other listeners have a chance to respond before + // we continue. + requestAnimationFrame(() => setTimeout(() => callback(event), 0), 0); + }; + doc.addEventListener("fullscreenerror", listener); +} + +// Waits until the window has both the load event and a MozAfterPaint called on +// it, and then invokes the callback +function waitForLoadAndPaint(win, callback) { + win.addEventListener( + "MozAfterPaint", + function () { + // The load event may have fired before the MozAfterPaint, in which case + // listening for it now will hang. Instead we check the readyState to see if + // it already fired, and if so, invoke the callback right away. + if (win.document.readyState == "complete") { + callback(); + } else { + win.addEventListener("load", callback, { once: true }); + } + }, + { once: true } + ); +} diff --git a/dom/base/test/fullscreen/file_fullscreen-with-full-zoom.html b/dom/base/test/fullscreen/file_fullscreen-with-full-zoom.html new file mode 100644 index 0000000000..620bc5acf9 --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-with-full-zoom.html @@ -0,0 +1,36 @@ + + + + + Test for Bug 1223561 + + + + + + +
            + + + diff --git a/dom/base/test/fullscreen/file_fullscreen_meta_viewport.html b/dom/base/test/fullscreen/file_fullscreen_meta_viewport.html new file mode 100644 index 0000000000..9938fdda6b --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen_meta_viewport.html @@ -0,0 +1,12 @@ + + + +
            +
            diff --git a/dom/base/test/fullscreen/fullscreen.xhtml b/dom/base/test/fullscreen/fullscreen.xhtml new file mode 100644 index 0000000000..2cc95642b6 --- /dev/null +++ b/dom/base/test/fullscreen/fullscreen.xhtml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/dom/base/test/green.png b/dom/base/test/green.png new file mode 100644 index 0000000000..7df25f33bd Binary files /dev/null and b/dom/base/test/green.png differ diff --git a/dom/base/test/gtest/TestContentUtils.cpp b/dom/base/test/gtest/TestContentUtils.cpp new file mode 100644 index 0000000000..d38cb1bdca --- /dev/null +++ b/dom/base/test/gtest/TestContentUtils.cpp @@ -0,0 +1,146 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" + +#include "jsapi.h" +#include "js/PropertyAndElement.h" // JS_DefineProperty +#include "nsContentUtils.h" +#include "nsNetUtil.h" +#include "mozilla/CycleCollectedJSContext.h" +#include "mozilla/dom/ScriptSettings.h" +#include "mozilla/dom/SimpleGlobalObject.h" + +using namespace mozilla::dom; + +struct IsURIInListMatch { + nsLiteralCString pattern; + bool firstMatch, secondMatch; +}; + +TEST(DOM_Base_ContentUtils, IsURIInList) +{ + nsCOMPtr uri, subURI; + nsresult rv = NS_NewURI(getter_AddRefs(uri), + "https://example.com/path/favicon.ico#"_ns); + ASSERT_TRUE(rv == NS_OK); + + rv = NS_NewURI(getter_AddRefs(subURI), + "http://sub.example.com/favicon.ico?"_ns); + ASSERT_TRUE(rv == NS_OK); + + static constexpr IsURIInListMatch patterns[] = { + {"bar.com,*.example.com,example.com,foo.com"_ns, true, true}, + {"bar.com,example.com,*.example.com,foo.com"_ns, true, true}, + {"*.example.com,example.com,foo.com"_ns, true, true}, + {"example.com,*.example.com,foo.com"_ns, true, true}, + {"*.example.com,example.com"_ns, true, true}, + {"example.com,*.example.com"_ns, true, true}, + {"*.example.com/,example.com/"_ns, true, true}, + {"example.com/,*.example.com/"_ns, true, true}, + {"*.example.com/pa,example.com/pa"_ns, false, false}, + {"example.com/pa,*.example.com/pa"_ns, false, false}, + {"*.example.com/pa/,example.com/pa/"_ns, false, false}, + {"example.com/pa/,*.example.com/pa/"_ns, false, false}, + {"*.example.com/path,example.com/path"_ns, false, false}, + {"example.com/path,*.example.com/path"_ns, false, false}, + {"*.example.com/path/,example.com/path/"_ns, true, false}, + {"example.com/path/,*.example.com/path/"_ns, true, false}, + {"*.example.com/favicon.ico"_ns, false, true}, + {"example.com/path/favicon.ico"_ns, true, false}, + {"*.example.com"_ns, false, true}, + {"example.com"_ns, true, false}, + {"foo.com"_ns, false, false}, + {"*.foo.com"_ns, false, false}, + }; + + for (auto& entry : patterns) { + bool result = nsContentUtils::IsURIInList(uri, entry.pattern); + ASSERT_EQ(result, entry.firstMatch) << "Matching " << entry.pattern; + + result = nsContentUtils::IsURIInList(subURI, entry.pattern); + ASSERT_EQ(result, entry.secondMatch) << "Matching " << entry.pattern; + } +} + +TEST(DOM_Base_ContentUtils, + StringifyJSON_EmptyValue_UndefinedIsNullStringLiteral) +{ + JS::Rooted globalObject( + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::AutoJSAPI jsAPI; + ASSERT_TRUE(jsAPI.Init(globalObject)); + JSContext* cx = jsAPI.cx(); + nsAutoString serializedValue; + + ASSERT_TRUE(nsContentUtils::StringifyJSON(cx, JS::UndefinedHandleValue, + serializedValue, + UndefinedIsNullStringLiteral)); + ASSERT_TRUE(serializedValue.EqualsLiteral("null")); +} + +TEST(DOM_Base_ContentUtils, StringifyJSON_Object_UndefinedIsNullStringLiteral) +{ + JS::Rooted globalObject( + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::AutoJSAPI jsAPI; + ASSERT_TRUE(jsAPI.Init(globalObject)); + JSContext* cx = jsAPI.cx(); + nsAutoString serializedValue; + + JS::Rooted jsObj(cx, JS_NewPlainObject(cx)); + JS::Rooted valueStr(cx, JS_NewStringCopyZ(cx, "Hello World!")); + ASSERT_TRUE(JS_DefineProperty(cx, jsObj, "key1", valueStr, JSPROP_ENUMERATE)); + JS::Rooted jsValue(cx, JS::ObjectValue(*jsObj)); + + ASSERT_TRUE(nsContentUtils::StringifyJSON(cx, jsValue, serializedValue, + UndefinedIsNullStringLiteral)); + + ASSERT_TRUE(serializedValue.EqualsLiteral("{\"key1\":\"Hello World!\"}")); +} + +TEST(DOM_Base_ContentUtils, StringifyJSON_EmptyValue_UndefinedIsVoidString) +{ + JS::Rooted globalObject( + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::AutoJSAPI jsAPI; + ASSERT_TRUE(jsAPI.Init(globalObject)); + JSContext* cx = jsAPI.cx(); + nsAutoString serializedValue; + + ASSERT_TRUE(nsContentUtils::StringifyJSON( + cx, JS::UndefinedHandleValue, serializedValue, UndefinedIsVoidString)); + + ASSERT_TRUE(serializedValue.IsVoid()); +} + +TEST(DOM_Base_ContentUtils, StringifyJSON_Object_UndefinedIsVoidString) +{ + JS::Rooted globalObject( + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::AutoJSAPI jsAPI; + ASSERT_TRUE(jsAPI.Init(globalObject)); + JSContext* cx = jsAPI.cx(); + nsAutoString serializedValue; + + JS::Rooted jsObj(cx, JS_NewPlainObject(cx)); + JS::Rooted valueStr(cx, JS_NewStringCopyZ(cx, "Hello World!")); + ASSERT_TRUE(JS_DefineProperty(cx, jsObj, "key1", valueStr, JSPROP_ENUMERATE)); + JS::Rooted jsValue(cx, JS::ObjectValue(*jsObj)); + + ASSERT_TRUE(nsContentUtils::StringifyJSON(cx, jsValue, serializedValue, + UndefinedIsVoidString)); + + ASSERT_TRUE(serializedValue.EqualsLiteral("{\"key1\":\"Hello World!\"}")); +} diff --git a/dom/base/test/gtest/TestMimeType.cpp b/dom/base/test/gtest/TestMimeType.cpp new file mode 100644 index 0000000000..64a2b8f4bd --- /dev/null +++ b/dom/base/test/gtest/TestMimeType.cpp @@ -0,0 +1,816 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" + +#include "MimeType.h" +#include "nsString.h" + +using mozilla::UniquePtr; + +TEST(MimeType, EmptyString) +{ + const auto in = u""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Empty string"; +} + +TEST(MimeType, JustWhitespace) +{ + const auto in = u" \t\r\n "_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Just whitespace"; +} + +TEST(MimeType, JustBackslash) +{ + const auto in = u"\\"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Just backslash"; +} + +TEST(MimeType, JustForwardslash) +{ + const auto in = u"/"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Just forward slash"; +} + +TEST(MimeType, MissingType1) +{ + const auto in = u"/bogus"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing type #1"; +} + +TEST(MimeType, MissingType2) +{ + const auto in = u" \r\n\t/bogus"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing type #2"; +} + +TEST(MimeType, MissingSubtype1) +{ + const auto in = u"bogus"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing subtype #1"; +} + +TEST(MimeType, MissingSubType2) +{ + const auto in = u"bogus/"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing subtype #2"; +} + +TEST(MimeType, MissingSubType3) +{ + const auto in = u"bogus;"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing subtype #3"; +} + +TEST(MimeType, MissingSubType4) +{ + const auto in = u"bogus; \r\n\t"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Missing subtype #3"; +} + +TEST(MimeType, ExtraForwardSlash) +{ + const auto in = u"bogus/bogus/;"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Extra forward slash"; +} + +TEST(MimeType, WhitespaceInType) +{ + const auto in = u"t\re\nx\tt /html"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Type with whitespace"; +} + +TEST(MimeType, WhitespaceInSubtype) +{ + const auto in = u"text/ h\rt\nm\tl"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Subtype with whitespace"; +} + +TEST(MimeType, NonAlphanumericMediaType1) +{ + const auto in = u""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #1"; +} + +TEST(MimeType, NonAlphanumericMediaType2) +{ + const auto in = u"(/)"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #2"; +} + +TEST(MimeType, NonAlphanumericMediaType3) +{ + const auto in = u"{/}"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #3"; +} + +TEST(MimeType, NonAlphanumericMediaType4) +{ + const auto in = u"\"/\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #4"; +} + +TEST(MimeType, NonAlphanumericMediaType5) +{ + const auto in = u"\0/\0"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #5"; +} + +TEST(MimeType, NonAlphanumericMediaType6) +{ + const auto in = u"text/html(;doesnot=matter"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-alphanumeric media type #6"; +} + +TEST(MimeType, NonLatin1MediaType1) +{ + const auto in = u"ÿ/ÿ"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-latin1 media type #1"; +} + +TEST(MimeType, NonLatin1MediaType2) +{ + const auto in = u"\x0100/\x0100"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_FALSE(parsed) + << "Non-latin1 media type #2"; +} + +TEST(MimeType, MultipleParameters) +{ + const auto in = u"text/html;charset=gbk;no=1;charset_=gbk_;yes=2"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(u"text/html;charset=gbk;no=1;charset_=gbk_;yes=2"_ns)) + << "Multiple parameters"; +} + +TEST(MimeType, DuplicateParameter1) +{ + const auto in = u"text/html;charset=gbk;charset=windows-1255"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(u"text/html;charset=gbk"_ns)) + << "Duplicate parameter #1"; +} + +TEST(MimeType, DuplicateParameter2) +{ + const auto in = u"text/html;charset=();charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(u"text/html;charset=\"()\""_ns)) + << "Duplicate parameter #2"; +} + +TEST(MimeType, CString) +{ + const auto in = "text/html;charset=();charset=GBK"_ns; + UniquePtr parsed = CMimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsCString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals("text/html;charset=\"()\""_ns)) + << "Duplicate parameter #2"; +} + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4819) +#endif +TEST(MimeType, NonAlphanumericParametersAreQuoted) +{ + const auto in = u"text/html;test=\x00FF\\;charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(u"text/html;test=\"\x00FF\\\\\";charset=gbk"_ns)) + << "Non-alphanumeric parameters are quoted"; +} +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace1) +{ + const auto in = u"text/html;charset= g\\\"bk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" g\\\\\\\"bk\"")) + << "Parameter is quoted if has leading whitespace #1"; +} + +TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace2) +{ + const auto in = u"text/html;charset= \"g\\bk\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" \\\"g\\\\bk\\\"\"")) + << "Parameter is quoted if has leading whitespace #2"; +} + +TEST(MimeType, ParameterQuotedIfHasInternalWhitespace) +{ + const auto in = u"text/html;charset=g \\b\"k"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"g \\\\b\\\"k\"")) + << "Parameter is quoted if has internal whitespace"; +} + +TEST(MimeType, ImproperlyQuotedParameter1) +{ + const auto in = u"x/x;test=\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x;test=\"\"")) + << "Improperly-quoted parameter is handled properly #1"; +} + +TEST(MimeType, ImproperlyQuotedParameter2) +{ + const auto in = u"x/x;test=\"\\"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x;test=\"\\\\\"")) + << "Improperly-quoted parameter is handled properly #2"; +} + +TEST(MimeType, NonLatin1ParameterIgnored) +{ + const auto in = u"x/x;test=\xFFFD;x=x"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x;x=x")) + << "Non latin-1 parameters are ignored"; +} + +TEST(MimeType, ParameterIgnoredIfWhitespaceInName1) +{ + const auto in = u"text/html;charset =gbk;charset=123"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=123")) + << "Parameter ignored if whitespace in name #1"; +} + +TEST(MimeType, ParameterIgnoredIfWhitespaceInName2) +{ + const auto in = u"text/html;cha rset =gbk;charset=123"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=123")) + << "Parameter ignored if whitespace in name #2"; +} + +TEST(MimeType, WhitespaceTrimmed) +{ + const auto in = u"\n\r\t text/plain\n\r\t ;\n\r\t charset=123\n\r\t "_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/plain;charset=123")) + << "Whitespace appropriately ignored"; +} + +TEST(MimeType, WhitespaceOnlyParameterIgnored) +{ + const auto in = u"x/x;x= \r\n\t"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x")) + << "Whitespace-only parameter is ignored"; +} + +TEST(MimeType, IncompleteParameterIgnored1) +{ + const auto in = u"x/x;test"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x")) + << "Incomplete parameter is ignored #1"; +} + +TEST(MimeType, IncompleteParameterIgnored2) +{ + const auto in = u"x/x;test="_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x")) + << "Incomplete parameter is ignored #2"; +} + +TEST(MimeType, IncompleteParameterIgnored3) +{ + const auto in = u"x/x;test= \r\n\t"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("x/x")) + << "Incomplete parameter is ignored #3"; +} + +TEST(MimeType, IncompleteParameterIgnored4) +{ + const auto in = u"text/html;test;charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Incomplete parameter is ignored #4"; +} + +TEST(MimeType, IncompleteParameterIgnored5) +{ + const auto in = u"text/html;test=;charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Incomplete parameter is ignored #5"; +} + +TEST(MimeType, EmptyParameterIgnored1) +{ + const auto in = u"text/html ; ; charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Empty parameter ignored #1"; +} + +TEST(MimeType, EmptyParameterIgnored2) +{ + const auto in = u"text/html;;;;charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Empty parameter ignored #2"; +} + +TEST(MimeType, InvalidParameterIgnored1) +{ + const auto in = u"text/html;';charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Invalid parameter ignored #1"; +} + +TEST(MimeType, InvalidParameterIgnored2) +{ + const auto in = u"text/html;\";charset=gbk;=123; =321"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Invalid parameter ignored #2"; +} + +TEST(MimeType, InvalidParameterIgnored3) +{ + const auto in = u"text/html;charset= \"\u007F;charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=GBK")) + << "Invalid parameter ignored #3"; +} + +TEST(MimeType, InvalidParameterIgnored4) +{ + const auto in = nsLiteralString( + u"text/html;charset=\"\u007F;charset=foo\";charset=GBK;charset="); + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=GBK")) + << "Invalid parameter ignored #4"; +} + +TEST(MimeType, SingleQuotes1) +{ + const auto in = u"text/html;charset='gbk'"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset='gbk'")) + << "Single quotes handled properly #1"; +} + +TEST(MimeType, SingleQuotes2) +{ + const auto in = u"text/html;charset='gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset='gbk")) + << "Single quotes handled properly #2"; +} + +TEST(MimeType, SingleQuotes3) +{ + const auto in = u"text/html;charset=gbk'"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk'")) + << "Single quotes handled properly #3"; +} + +TEST(MimeType, SingleQuotes4) +{ + const auto in = u"text/html;charset=';charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset='")) + << "Single quotes handled properly #4"; +} + +TEST(MimeType, SingleQuotes5) +{ + const auto in = u"text/html;charset=''';charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset='''")) + << "Single quotes handled properly #5"; +} + +TEST(MimeType, DoubleQuotes1) +{ + const auto in = u"text/html;charset=\"gbk\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Double quotes handled properly #1"; +} + +TEST(MimeType, DoubleQuotes2) +{ + const auto in = u"text/html;charset=\"gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Double quotes handled properly #2"; +} + +TEST(MimeType, DoubleQuotes3) +{ + const auto in = u"text/html;charset=gbk\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk\\\"\"")) + << "Double quotes handled properly #3"; +} + +TEST(MimeType, DoubleQuotes4) +{ + const auto in = u"text/html;charset=\" gbk\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" gbk\"")) + << "Double quotes handled properly #4"; +} + +TEST(MimeType, DoubleQuotes5) +{ + const auto in = u"text/html;charset=\"gbk \""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk \"")) + << "Double quotes handled properly #5"; +} + +TEST(MimeType, DoubleQuotes6) +{ + const auto in = u"text/html;charset=\"\\ gbk\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" gbk\"")) + << "Double quotes handled properly #6"; +} + +TEST(MimeType, DoubleQuotes7) +{ + const auto in = u"text/html;charset=\"\\g\\b\\k\""_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Double quotes handled properly #7"; +} + +TEST(MimeType, DoubleQuotes8) +{ + const auto in = u"text/html;charset=\"gbk\"x"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk")) + << "Double quotes handled properly #8"; +} + +TEST(MimeType, DoubleQuotes9) +{ + const auto in = u"text/html;charset=\"\";charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"\"")) + << "Double quotes handled properly #9"; +} + +TEST(MimeType, DoubleQuotes10) +{ + const auto in = u"text/html;charset=\";charset=GBK"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\";charset=GBK\"")) + << "Double quotes handled properly #10"; +} + +TEST(MimeType, UnexpectedCodePoints) +{ + const auto in = u"text/html;charset={gbk}"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"{gbk}\"")) + << "Unexpected code points handled properly"; +} + +TEST(MimeType, LongTypesSubtypesAccepted) +{ + const auto in = nsLiteralString( + u"01234567890123456789012345678901234567890123456789012345678901234567890" + u"1" + "2345678901234567890123456789012345678901234567890123456789/" + "012345678901234567890123456789012345678901234567890123456789012345678901" + "2345678901234567890123456789012345678901234567890123456789"); + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(in)) + << "Long type/subtype accepted"; +} + +TEST(MimeType, LongParametersAccepted) +{ + const auto in = nsLiteralString( + u"text/" + "html;" + "012345678901234567890123456789012345678901234567890123456789012345678901" + "2345678901234567890123456789012345678901234567890123456789=x;charset=" + "gbk"); + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(in)) + << "Long parameters accepted"; +} + +TEST(MimeType, AllValidCharactersAccepted1) +{ + const auto in = nsLiteralString( + u"x/x;x=\"\t " + u"!\\\"#$%&'()*+,-./" + u"0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`" + u"abcdefghijklmnopqrstuvwxyz{|}~" + u"\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A" + u"\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095" + u"\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0" + u"\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB" + u"\u00AC\u00AD\u00AE\u00AF\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6" + u"\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1" + u"\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC" + u"\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7" + u"\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2" + u"\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED" + u"\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8" + u"\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF\""); + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.Equals(in)) + << "All valid characters accepted #1"; +} + +TEST(MimeType, CaseNormalization1) +{ + const auto in = u"TEXT/PLAIN;CHARSET=TEST"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/plain;charset=TEST")) + << "Case normalized properly #1"; +} + +TEST(MimeType, CaseNormalization2) +{ + const auto in = nsLiteralString( + u"!#$%&'*+-.^_`|~" + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/" + "!#$%&'*+-.^_`|~" + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$%&'*+-" + ".^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$" + "%&'*+-.^_`|~" + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral( + "!#$%&'*+-.^_`|~" + "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/" + "!#$%&'*+-.^_`|~" + "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz;!#$%&'*+-" + ".^_`|~0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz=!#$" + "%&'*+-.^_`|~" + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) + << "Case normalized properly #2"; +} + +TEST(MimeType, LegacyCommentSyntax1) +{ + const auto in = u"text/html;charset=gbk("_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk(\"")) + << "Legacy comment syntax #1"; +} + +TEST(MimeType, LegacyCommentSyntax2) +{ + const auto in = u"text/html;x=(;charset=gbk"_ns; + UniquePtr parsed = MimeType::Parse(in); + ASSERT_TRUE(parsed) + << "Parsing succeeded"; + nsAutoString out; + parsed->Serialize(out); + ASSERT_TRUE(out.EqualsLiteral("text/html;x=\"(\";charset=gbk")) + << "Legacy comment syntax #2"; +} diff --git a/dom/base/test/gtest/TestParser.cpp b/dom/base/test/gtest/TestParser.cpp new file mode 100644 index 0000000000..d9240cced7 --- /dev/null +++ b/dom/base/test/gtest/TestParser.cpp @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "nsCOMPtr.h" +#include "nsString.h" +#include "mozilla/dom/DOMParser.h" +#include "mozilla/dom/Document.h" +#include "nsIDocumentEncoder.h" +#include "mozilla/ErrorResult.h" + +// This is a test for mozilla::dom::DOMParser::CreateWithoutGlobal() which was +// implemented for use in Thunderbird's MailNews module. + +// int main(int argc, char** argv) +TEST(TestParser, TestParserMain) +{ + bool allTestsPassed = false; + constexpr auto htmlInput = + u"" + "" + "Hello Thunderbird!"_ns; + + do { + // Parse the HTML source. + mozilla::IgnoredErrorResult rv2; + RefPtr parser = + mozilla::dom::DOMParser::CreateWithoutGlobal(rv2); + if (rv2.Failed()) break; + nsCOMPtr document = parser->ParseFromString( + htmlInput, mozilla::dom::SupportedType::Text_html, rv2); + if (rv2.Failed()) break; + + // Serialize it back to HTML source again. + nsCOMPtr encoder = + do_createDocumentEncoder("text/html"); + if (!encoder) break; + nsresult rv = + encoder->Init(document, u"text/html"_ns, nsIDocumentEncoder::OutputRaw); + if (NS_FAILED(rv)) break; + nsString parsed; + rv = encoder->EncodeToString(parsed); + if (NS_FAILED(rv)) break; + + EXPECT_TRUE(parsed.Equals(htmlInput)); + allTestsPassed = true; + } while (false); + + EXPECT_TRUE(allTestsPassed); +} diff --git a/dom/base/test/gtest/TestPlainTextSerializer.cpp b/dom/base/test/gtest/TestPlainTextSerializer.cpp new file mode 100644 index 0000000000..10a69fd318 --- /dev/null +++ b/dom/base/test/gtest/TestPlainTextSerializer.cpp @@ -0,0 +1,309 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" + +#include "nsServiceManagerUtils.h" +#include "nsString.h" +#include "nsIDocumentEncoder.h" +#include "nsCRT.h" +#include "nsIParserUtils.h" + +const uint32_t kDefaultWrapColumn = 72; + +void ConvertBufToPlainText(nsString& aConBuf, int aFlag, uint32_t aWrapColumn) { + nsCOMPtr utils = do_GetService(NS_PARSERUTILS_CONTRACTID); + utils->ConvertToPlainText(aConBuf, aFlag, aWrapColumn, aConBuf); +} + +// Test for ASCII with format=flowed; delsp=yes +TEST(PlainTextSerializer, ASCIIWithFlowedDelSp) +{ + nsString test; + nsString result; + + test.AssignLiteral( + "" + "Firefox Firefox Firefox Firefox " + "Firefox Firefox Firefox Firefox " + "Firefox Firefox Firefox Firefox" + ""); + + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak | + nsIDocumentEncoder::OutputFormatFlowed | + nsIDocumentEncoder::OutputFormatDelSp, + kDefaultWrapColumn); + + // create result case + result.AssignLiteral( + "Firefox Firefox Firefox Firefox " + "Firefox Firefox Firefox Firefox " + "Firefox \r\nFirefox Firefox Firefox\r\n"); + + ASSERT_TRUE(test.Equals(result)) + << "Wrong HTML to ASCII text serialization with format=flowed; delsp=yes"; +} + +// Test for CJK with format=flowed; delsp=yes +TEST(PlainTextSerializer, CJKWithFlowedDelSp) +{ + nsString test; + nsString result; + + test.AssignLiteral(""); + for (uint32_t i = 0; i < 40; i++) { + // Insert Kanji (U+5341) + test.Append(0x5341); + } + test.AppendLiteral(""); + + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak | + nsIDocumentEncoder::OutputFormatFlowed | + nsIDocumentEncoder::OutputFormatDelSp, + kDefaultWrapColumn); + + // create result case + for (uint32_t i = 0; i < 36; i++) { + result.Append(0x5341); + } + result.AppendLiteral(" \r\n"); + for (uint32_t i = 0; i < 4; i++) { + result.Append(0x5341); + } + result.AppendLiteral("\r\n"); + + ASSERT_TRUE(test.Equals(result)) + << "Wrong HTML to CJK text serialization with format=flowed; delsp=yes"; +} + +// Test for CJK with DisallowLineBreaking +TEST(PlainTextSerializer, CJKWithDisallowLineBreaking) +{ + nsString test; + nsString result; + + test.AssignLiteral(""); + for (uint32_t i = 0; i < 400; i++) { + // Insert Kanji (U+5341) + test.Append(0x5341); + } + test.AppendLiteral(""); + + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak | + nsIDocumentEncoder::OutputFormatFlowed | + nsIDocumentEncoder::OutputDisallowLineBreaking, + kDefaultWrapColumn); + + // create result case + for (uint32_t i = 0; i < 400; i++) { + result.Append(0x5341); + } + result.AppendLiteral("\r\n"); + + ASSERT_TRUE(test.Equals(result)) + << "Wrong HTML to CJK text serialization with OutputDisallowLineBreaking"; +} + +// Test for Latin with DisallowLineBreaking +TEST(PlainTextSerializer, LatinWithDisallowLineBreaking) +{ + nsString test; + test.AssignLiteral(""); + for (uint32_t i = 0; i < 400; i++) { + // Insert á (Latin Small Letter a with Acute) (U+00E1) + test.Append(0x00E1); + } + test.AppendLiteral("\r\n"); + + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak | + nsIDocumentEncoder::OutputFormatFlowed | + nsIDocumentEncoder::OutputDisallowLineBreaking, + kDefaultWrapColumn); + + // Create expect case. + nsString expect; + for (uint32_t i = 0; i < 400; i++) { + expect.Append(0x00E1); + } + expect.AppendLiteral(" \r\n\r\n"); + + ASSERT_TRUE(test.Equals(expect)) + << "Wrong HTML to Latin text serialization with OutputDisallowLineBreaking"; +} + +// Test for ASCII with format=flowed; and quoted lines in preformatted span. +TEST(PlainTextSerializer, PreformatFlowedQuotes) +{ + nsString test; + nsString result; + + test.AssignLiteral( + "" + "" + "> Firefox Firefox Firefox Firefox
            " + "> Firefox Firefox Firefox Firefox
            " + ">
            " + ">> Firefox Firefox Firefox Firefox
            " + ">> Firefox Firefox Firefox Firefox
            " + "
            "); + + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak | + nsIDocumentEncoder::OutputFormatFlowed, + kDefaultWrapColumn); + + // create result case + result.AssignLiteral( + "> Firefox Firefox Firefox Firefox \r\n" + "> Firefox Firefox Firefox Firefox\r\n" + ">\r\n" + ">> Firefox Firefox Firefox Firefox \r\n" + ">> Firefox Firefox Firefox Firefox\r\n"); + + ASSERT_TRUE(test.Equals(result)) + << "Wrong HTML to ASCII text serialization " + "with format=flowed; and quoted " + "lines"; +} + +TEST(PlainTextSerializer, PrettyPrintedHtml) +{ + nsString test; + test.AppendLiteral("" NS_LINEBREAK "" NS_LINEBREAK + " first
            " NS_LINEBREAK " second
            " NS_LINEBREAK + "" NS_LINEBREAK ""); + + ConvertBufToPlainText(test, 0, kDefaultWrapColumn); + ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) + << "Wrong prettyprinted html to text serialization"; +} + +TEST(PlainTextSerializer, PreElement) +{ + nsString test; + test.AppendLiteral("" NS_LINEBREAK "" NS_LINEBREAK + "
            " NS_LINEBREAK "  first" NS_LINEBREAK
            +                     "  second" NS_LINEBREAK "
            " NS_LINEBREAK + "" NS_LINEBREAK ""); + + ConvertBufToPlainText(test, 0, kDefaultWrapColumn); + ASSERT_TRUE(test.EqualsLiteral(" first" NS_LINEBREAK + " second" NS_LINEBREAK NS_LINEBREAK)) + << "Wrong prettyprinted html to text serialization"; +} + +TEST(PlainTextSerializer, BlockElement) +{ + nsString test; + test.AppendLiteral("" NS_LINEBREAK "" NS_LINEBREAK + "
            " NS_LINEBREAK " first" NS_LINEBREAK + "
            " NS_LINEBREAK "
            " NS_LINEBREAK + " second" NS_LINEBREAK "
            " NS_LINEBREAK + "" NS_LINEBREAK ""); + + ConvertBufToPlainText(test, 0, kDefaultWrapColumn); + ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) + << "Wrong prettyprinted html to text serialization"; +} + +TEST(PlainTextSerializer, PreWrapElementForThunderbird) +{ + // This test examines the magic pre-wrap setup that Thunderbird relies on. + nsString test; + test.AppendLiteral("" NS_LINEBREAK + "" NS_LINEBREAK + "
            " NS_LINEBREAK
            +                     "  first line is too long" NS_LINEBREAK
            +                     "  second line is even loooonger  " NS_LINEBREAK
            +                     "
            " NS_LINEBREAK "" NS_LINEBREAK ""); + + const uint32_t wrapColumn = 10; + ConvertBufToPlainText(test, nsIDocumentEncoder::OutputWrap, wrapColumn); + // "\n\n first\nline is\ntoo long\n second\nline is\neven\nloooonger\n\n\n" + ASSERT_TRUE(test.EqualsLiteral( + NS_LINEBREAK NS_LINEBREAK + " first" NS_LINEBREAK "line is" NS_LINEBREAK "too long" NS_LINEBREAK + " second" NS_LINEBREAK "line is" NS_LINEBREAK "even" NS_LINEBREAK + "loooonger" NS_LINEBREAK NS_LINEBREAK NS_LINEBREAK)) + << "Wrong prettyprinted html to text serialization"; +} + +TEST(PlainTextSerializer, Simple) +{ + nsString test; + test.AppendLiteral( + "basespan" + "body"); + ConvertBufToPlainText(test, 0, kDefaultWrapColumn); + ASSERT_TRUE(test.EqualsLiteral("basespanbody")) + << "Wrong html to text serialization"; +} + +TEST(PlainTextSerializer, OneHundredAndOneOL) +{ + nsAutoString test; + test.AppendLiteral( + "" + "" + "
                                            <" + "ol>
                                                                              <" + "ol>
                                                                                                                <" + "ol>
                                                                                                                                                  <" + "ol>
                                                                                                                                                                                    <" + "ol>
                    1. X
                    " + "" + ""); + + ConvertBufToPlainText(test, nsIDocumentEncoder::OutputFormatted, + kDefaultWrapColumn); + + nsAutoString expected; + expected.AppendLiteral(" 1. X" NS_LINEBREAK); + ASSERT_EQ(test, expected); +} + +TEST(PlainTextSerializer, BlockQuoteCite) +{ + nsAutoString test; + test.AppendLiteral(u"
                    hello world
                    "); + + const uint32_t wrapColumn = 10; + ConvertBufToPlainText(test, + nsIDocumentEncoder::OutputFormatted | + nsIDocumentEncoder::OutputFormatFlowed | + nsIDocumentEncoder::OutputCRLineBreak | + nsIDocumentEncoder::OutputLFLineBreak, + wrapColumn); + + constexpr auto expect = NS_LITERAL_STRING_FROM_CSTRING( + "> hello \r\n" + "> world\r\n"); + + ASSERT_TRUE(test.Equals(expect)) + << "Wrong blockquote cite to text serialization"; +} diff --git a/dom/base/test/gtest/TestScheduler.cpp b/dom/base/test/gtest/TestScheduler.cpp new file mode 100644 index 0000000000..00c578e556 --- /dev/null +++ b/dom/base/test/gtest/TestScheduler.cpp @@ -0,0 +1,348 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "mozilla/dom/CCGCScheduler.h" +#include "mozilla/TimeStamp.h" + +// This is a test for mozilla::CCGCScheduler. + +using namespace mozilla; + +static TimeDuration kOneSecond = TimeDuration::FromSeconds(1); +static TimeDuration kTenthSecond = TimeDuration::FromSeconds(0.1); +static TimeDuration kFrameDuration = TimeDuration::FromSeconds(1.0 / 60.0); + +static mozilla::TimeStamp sNow = TimeStamp::Now(); + +static mozilla::TimeStamp AdvanceTime(TimeDuration aDuration) { + sNow += aDuration; + return sNow; +} + +static TimeStamp Now() { return sNow; } + +static uint32_t sSuspected = 0; + +static uint32_t SuspectedCCObjects() { return sSuspected; } +static void SetNumSuspected(uint32_t n) { sSuspected = n; } +static void SuspectMore(uint32_t n) { sSuspected += n; } + +using CCRunnerState = mozilla::CCGCScheduler::CCRunnerState; + +class TestGC { + protected: + CCGCScheduler& mScheduler; + + public: + explicit TestGC(CCGCScheduler& aScheduler) : mScheduler(aScheduler) {} + void Run(int aNumSlices); +}; + +void TestGC::Run(int aNumSlices) { + // Make the purple buffer nearly empty so it is itself not an adequate reason + // for wanting a CC. + static_assert(3 < mozilla::kCCPurpleLimit); + SetNumSuspected(3); + + // Running the GC should not influence whether a CC is currently seen as + // needed. But the first time we run GC, it will be false; later, we will + // have run a GC and set it to true. + CCReason neededCCAtStartOfGC = + mScheduler.IsCCNeeded(Now(), SuspectedCCObjects()); + + mScheduler.NoteGCBegin(JS::GCReason::API); + + for (int slice = 0; slice < aNumSlices; slice++) { + EXPECT_TRUE(mScheduler.InIncrementalGC()); + TimeStamp idleDeadline = Now() + kTenthSecond; + js::SliceBudget budget = + mScheduler.ComputeInterSliceGCBudget(idleDeadline, Now()); + TimeDuration budgetDuration = + TimeDuration::FromMilliseconds(budget.timeBudget()); + EXPECT_NEAR(budgetDuration.ToSeconds(), 0.1, 1.e-6); + // Pretend the GC took exactly the budget. + AdvanceTime(budgetDuration); + + EXPECT_EQ(mScheduler.IsCCNeeded(Now(), SuspectedCCObjects()), + neededCCAtStartOfGC); + + // Mutator runs for 1 second. + AdvanceTime(kOneSecond); + } + + mScheduler.NoteGCEnd(); + mScheduler.SetNeedsFullGC(false); +} + +class TestCC { + protected: + CCGCScheduler& mScheduler; + + public: + explicit TestCC(CCGCScheduler& aScheduler) : mScheduler(aScheduler) {} + + void Run(int aNumSlices) { + Prepare(); + MaybePokeCC(); + TimerFires(aNumSlices); + EndCycleCollectionCallback(); + KillCCRunner(); + } + + virtual void Prepare() = 0; + virtual void MaybePokeCC(); + virtual void TimerFires(int aNumSlices); + virtual void RunSlices(int aNumSlices); + virtual void RunSlice(TimeStamp aCCStartTime, TimeStamp aPrevSliceEnd, + int aSliceNum, int aNumSlices) = 0; + virtual void ForgetSkippable(); + virtual void EndCycleCollectionCallback(); + virtual void KillCCRunner(); +}; + +void TestCC::MaybePokeCC() { + // nsJSContext::MaybePokeCC + + // In all tests so far, we will be running this just after a GC. + CCReason reason = mScheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()); + EXPECT_EQ(reason, CCReason::GC_FINISHED); + + mScheduler.InitCCRunnerStateMachine(CCRunnerState::ReducePurple, reason); + EXPECT_TRUE(mScheduler.IsEarlyForgetSkippable()); +} + +void TestCC::TimerFires(int aNumSlices) { + // Series of CCRunner timer fires. + CCRunnerStep step; + + while (true) { + SuspectMore(1000); + TimeStamp idleDeadline = Now() + kOneSecond; + step = + mScheduler.AdvanceCCRunner(idleDeadline, Now(), SuspectedCCObjects()); + // Should first see a series of ForgetSkippable actions. + if (step.mAction != CCRunnerAction::ForgetSkippable || + step.mParam.mRemoveChildless != KeepChildless) { + break; + } + EXPECT_EQ(step.mYield, Yield); + ForgetSkippable(); + } + + while (step.mYield == Continue) { + TimeStamp idleDeadline = Now() + kOneSecond; + step = + mScheduler.AdvanceCCRunner(idleDeadline, Now(), SuspectedCCObjects()); + } + EXPECT_EQ(step.mAction, CCRunnerAction::ForgetSkippable); + EXPECT_EQ(step.mParam.mRemoveChildless, RemoveChildless); + ForgetSkippable(); + + TimeStamp idleDeadline = Now() + kOneSecond; + step = mScheduler.AdvanceCCRunner(idleDeadline, Now(), SuspectedCCObjects()); + EXPECT_EQ(step.mAction, CCRunnerAction::CleanupContentUnbinder); + step = mScheduler.AdvanceCCRunner(idleDeadline, Now(), SuspectedCCObjects()); + EXPECT_EQ(step.mAction, CCRunnerAction::CleanupDeferred); + + mScheduler.NoteCCBegin(CCReason::API, Now(), 0, sSuspected, 0); + RunSlices(aNumSlices); +} + +void TestCC::ForgetSkippable() { + uint32_t suspectedBefore = sSuspected; + // ...ForgetSkippable would happen here... + js::SliceBudget budget = + mScheduler.ComputeForgetSkippableBudget(Now(), Now() + kTenthSecond); + EXPECT_NEAR(budget.timeBudget(), kTenthSecond.ToMilliseconds(), 1); + AdvanceTime(kTenthSecond); + mScheduler.NoteForgetSkippableComplete(Now(), suspectedBefore, + SuspectedCCObjects()); +} + +void TestCC::RunSlices(int aNumSlices) { + TimeStamp ccStartTime = Now(); + TimeStamp prevSliceEnd = ccStartTime; + for (int ccslice = 0; ccslice < aNumSlices; ccslice++) { + RunSlice(ccStartTime, prevSliceEnd, ccslice, aNumSlices); + prevSliceEnd = Now(); + } + + SetNumSuspected(0); +} + +void TestCC::EndCycleCollectionCallback() { + // nsJSContext::EndCycleCollectionCallback + CycleCollectorResults results; + results.mFreedGCed = 10; + results.mFreedJSZones = 2; + mScheduler.NoteCCEnd(results, Now(), TimeDuration()); + + // Because > 0 zones were freed. + EXPECT_TRUE(mScheduler.NeedsGCAfterCC()); +} + +void TestCC::KillCCRunner() { + // nsJSContext::KillCCRunner + mScheduler.KillCCRunner(); +} + +class TestIdleCC : public TestCC { + public: + explicit TestIdleCC(CCGCScheduler& aScheduler) : TestCC(aScheduler) {} + + void Prepare() override; + void RunSlice(TimeStamp aCCStartTime, TimeStamp aPrevSliceEnd, int aSliceNum, + int aNumSlices) override; +}; + +void TestIdleCC::Prepare() { EXPECT_TRUE(!mScheduler.InIncrementalGC()); } + +void TestIdleCC::RunSlice(TimeStamp aCCStartTime, TimeStamp aPrevSliceEnd, + int aSliceNum, int aNumSlices) { + CCRunnerStep step; + TimeStamp idleDeadline = Now() + kTenthSecond; + + // The scheduler should request a CycleCollect slice. + step = mScheduler.AdvanceCCRunner(idleDeadline, Now(), SuspectedCCObjects()); + EXPECT_EQ(step.mAction, CCRunnerAction::CycleCollect); + + // nsJSContext::RunCycleCollectorSlice + + EXPECT_FALSE(mScheduler.InIncrementalGC()); + bool preferShorter; + js::SliceBudget budget = mScheduler.ComputeCCSliceBudget( + idleDeadline, aCCStartTime, aPrevSliceEnd, Now(), &preferShorter); + // The scheduler will set the budget to our deadline (0.1sec in the future). + EXPECT_NEAR(budget.timeBudget(), kTenthSecond.ToMilliseconds(), 1); + EXPECT_FALSE(preferShorter); + + AdvanceTime(kTenthSecond); +} + +class TestNonIdleCC : public TestCC { + public: + explicit TestNonIdleCC(CCGCScheduler& aScheduler) : TestCC(aScheduler) {} + + void Prepare() override; + void RunSlice(TimeStamp aCCStartTime, TimeStamp aPrevSliceEnd, int aSliceNum, + int aNumSlices) override; +}; + +void TestNonIdleCC::Prepare() { + EXPECT_TRUE(!mScheduler.InIncrementalGC()); + + // Advance time by an hour to give time for a user event in the past. + AdvanceTime(TimeDuration::FromSeconds(3600)); +} + +void TestNonIdleCC::RunSlice(TimeStamp aCCStartTime, TimeStamp aPrevSliceEnd, + int aSliceNum, int aNumSlices) { + CCRunnerStep step; + TimeStamp nullDeadline; + + // The scheduler should tell us to run a slice of cycle collection. + step = mScheduler.AdvanceCCRunner(nullDeadline, Now(), SuspectedCCObjects()); + EXPECT_EQ(step.mAction, CCRunnerAction::CycleCollect); + + // nsJSContext::RunCycleCollectorSlice + + EXPECT_FALSE(mScheduler.InIncrementalGC()); + + bool preferShorter; + js::SliceBudget budget = mScheduler.ComputeCCSliceBudget( + nullDeadline, aCCStartTime, aPrevSliceEnd, Now(), &preferShorter); + if (aSliceNum == 0) { + // First slice of the CC, so always use the baseBudget which is + // kICCSliceBudget (3ms) for a non-idle slice. + EXPECT_NEAR(budget.timeBudget(), kICCSliceBudget.ToMilliseconds(), 0.1); + } else if (aSliceNum == 1) { + // Second slice still uses the baseBudget, since not much time has passed + // so none of the lengthening mechanisms have kicked in yet. + EXPECT_NEAR(budget.timeBudget(), kICCSliceBudget.ToMilliseconds(), 0.1); + } else if (aSliceNum == 2) { + // We're not overrunning kMaxICCDuration, so we don't go unlimited. + EXPECT_FALSE(budget.isUnlimited()); + // This slice is delayed by twice the allowed amount. Slice time should be + // doubled. + EXPECT_NEAR(budget.timeBudget(), kICCSliceBudget.ToMilliseconds() * 2, 0.1); + } else { + // We're not overrunning kMaxICCDuration, so we don't go unlimited. + EXPECT_FALSE(budget.isUnlimited()); + + // These slices are not delayed, but enough time has passed that the + // dominating factor is now the linear ramp up to max slice time at the + // halfway point to kMaxICCDuration. + EXPECT_TRUE(budget.timeBudget() > kICCSliceBudget.ToMilliseconds()); + EXPECT_TRUE(budget.timeBudget() <= + MainThreadIdlePeriod::GetLongIdlePeriod()); + } + EXPECT_TRUE(preferShorter); // Non-idle prefers shorter slices + + AdvanceTime(TimeDuration::FromMilliseconds(budget.timeBudget())); + if (aSliceNum == 1) { + // Delay the third slice (only). + AdvanceTime(kICCIntersliceDelay * 2); + } +} + +// Do a GC then CC then GC. +static bool BasicScenario(CCGCScheduler& aScheduler, TestGC* aTestGC, + TestCC* aTestCC) { + // Run a 10-slice incremental GC. + aTestGC->Run(10); + + // After a GC, the scheduler should decide to do a full CC regardless of the + // number of purple buffer entries. + SetNumSuspected(3); + EXPECT_EQ(aScheduler.IsCCNeeded(Now(), SuspectedCCObjects()), + CCReason::GC_FINISHED); + + // Now we should want to CC. + EXPECT_EQ(aScheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()), + CCReason::GC_FINISHED); + + // Do a 5-slice CC. + aTestCC->Run(5); + + // Not enough suspected objects to deserve a CC. + EXPECT_EQ(aScheduler.IsCCNeeded(Now(), SuspectedCCObjects()), + CCReason::NO_REASON); + EXPECT_EQ(aScheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()), + CCReason::NO_REASON); + SetNumSuspected(10000); + + // We shouldn't want to CC again yet, it's too soon. + EXPECT_EQ(aScheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()), + CCReason::NO_REASON); + AdvanceTime(mozilla::kCCDelay); + + // *Now* it's time for another CC. + EXPECT_EQ(aScheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()), + CCReason::MANY_SUSPECTED); + + // Run a 3-slice incremental GC. + EXPECT_TRUE(!aScheduler.InIncrementalGC()); + aTestGC->Run(3); + + return true; +} + +static CCGCScheduler scheduler; +static TestGC gc(scheduler); +static TestIdleCC ccIdle(scheduler); +static TestNonIdleCC ccNonIdle(scheduler); + +TEST(TestScheduler, Idle) +{ + // Cannot CC until we GC once. + EXPECT_EQ(scheduler.ShouldScheduleCC(Now(), SuspectedCCObjects()), + CCReason::NO_REASON); + + EXPECT_TRUE(BasicScenario(scheduler, &gc, &ccIdle)); +} + +TEST(TestScheduler, NonIdle) +{ EXPECT_TRUE(BasicScenario(scheduler, &gc, &ccNonIdle)); } diff --git a/dom/base/test/gtest/TestXMLSerializerNoBreakLink.cpp b/dom/base/test/gtest/TestXMLSerializerNoBreakLink.cpp new file mode 100644 index 0000000000..a63410303e --- /dev/null +++ b/dom/base/test/gtest/TestXMLSerializerNoBreakLink.cpp @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "nsCOMPtr.h" +#include "nsIDocumentEncoder.h" +#include "nsString.h" +#include "mozilla/ErrorResult.h" +#include "mozilla/dom/Document.h" +#include "mozilla/dom/DOMParser.h" + +using namespace mozilla; +using namespace mozilla::dom; + +// Test that serialising some DOM doesn't destroy links by word-wrapping long +// href values containing spaces. +TEST(TestXMLSerializerNoBreakLink, TestXMLSerializerNoBreakLinkMain) +{ + // Build up a stupidly-long URL with spaces. Default is to wrap at column + // 72, so we want to exceed that. + nsString longURL = u"http://www.example.com/link with spaces"_ns; + for (int i = 1; i < 125; ++i) { + longURL.Append(u' '); + longURL.Append(IntToTString(i)); + } + nsString htmlInput = + u"" + "" + "Hello Thunderbird! Link"_ns; + + // Parse HTML into a Document. + nsCOMPtr document; + { + IgnoredErrorResult rv; + RefPtr parser = DOMParser::CreateWithoutGlobal(rv); + ASSERT_FALSE(rv.Failed()); + document = parser->ParseFromString(htmlInput, SupportedType::Text_html, rv); + ASSERT_FALSE(rv.Failed()); + } + + // Serialize back in a variety of flavours and check the URL survives the + // round trip intact. + nsCString contentTypes[] = {"text/xml"_ns, "application/xml"_ns, + "application/xhtml+xml"_ns, "image/svg+xml"_ns, + "text/html"_ns}; + for (auto const& contentType : contentTypes) { + uint32_t flagsToTest[] = { + nsIDocumentEncoder::OutputFormatted, nsIDocumentEncoder::OutputWrap, + nsIDocumentEncoder::OutputFormatted | nsIDocumentEncoder::OutputWrap}; + for (uint32_t flags : flagsToTest) { + // Serialize doc back to HTML source again. + nsCOMPtr encoder = + do_createDocumentEncoder(contentType.get()); + ASSERT_TRUE(encoder); + nsresult rv = + encoder->Init(document, NS_ConvertASCIItoUTF16(contentType), flags); + ASSERT_TRUE(NS_SUCCEEDED(rv)); + nsString parsed; + rv = encoder->EncodeToString(parsed); + ASSERT_TRUE(NS_SUCCEEDED(rv)); + + // URL is intact? + EXPECT_TRUE(parsed.Find(longURL) != kNotFound); + } + } +} diff --git a/dom/base/test/gtest/TestXPathGenerator.cpp b/dom/base/test/gtest/TestXPathGenerator.cpp new file mode 100644 index 0000000000..c9f4993179 --- /dev/null +++ b/dom/base/test/gtest/TestXPathGenerator.cpp @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "XPathGenerator.h" +#include "nsString.h" + +TEST(TestXPathGenerator, TestQuoteArgumentWithoutQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"testing"); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"\'testing\'"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, TestQuoteArgumentWithSingleQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"\'testing\'"); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"\"\'testing\'\""); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"\"testing\""); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"\'\"testing\"\'"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, TestQuoteArgumentWithSingleAndDoubleQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"\'testing\""); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"concat(\'\',\"\'\",\'testing\"\')"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), + NS_ConvertUTF16toUTF8(expectedResult).get()); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, + TestQuoteArgumentWithDoubleQuoteAndASequenceOfSingleQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"\'\'\'\'testing\""); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"concat(\'\',\"\'\'\'\'\",\'testing\"\')"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), + NS_ConvertUTF16toUTF8(expectedResult).get()); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, + TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuote) +{ + nsAutoString arg; + arg.AssignLiteral(u"\'\'\'\'testing\'\'\'\'\'\'\""); + + nsAutoString expectedResult; + expectedResult.AssignLiteral( + u"concat(\'\',\"\'\'\'\'\",\'testing\',\"\'\'\'\'\'\'\",\'\"\')"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), + NS_ConvertUTF16toUTF8(expectedResult).get()); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, + TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuoteInMiddle) +{ + nsAutoString arg; + arg.AssignLiteral(u"t\'\'\'\'estin\'\'\'\'\'\'\"g"); + + nsAutoString expectedResult; + expectedResult.AssignLiteral( + u"concat(\'t\',\"\'\'\'\'\",\'estin\',\"\'\'\'\'\'\'\",\'\"g\')"); + + nsAutoString result; + XPathGenerator::QuoteArgument(arg, result); + printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), + NS_ConvertUTF16toUTF8(expectedResult).get()); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, TestEscapeNameWithNormalCharacters) +{ + nsAutoString arg; + arg.AssignLiteral(u"testing"); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"testing"); + + nsAutoString result; + XPathGenerator::EscapeName(arg, result); + + ASSERT_TRUE(expectedResult.Equals(result)); +} + +TEST(TestXPathGenerator, TestEscapeNameWithSpecialCharacters) +{ + nsAutoString arg; + arg.AssignLiteral(u"^testing!"); + + nsAutoString expectedResult; + expectedResult.AssignLiteral(u"*[local-name()=\'^testing!\']"); + + nsAutoString result; + XPathGenerator::EscapeName(arg, result); + printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), + NS_ConvertUTF16toUTF8(expectedResult).get()); + + ASSERT_TRUE(expectedResult.Equals(result)); +} diff --git a/dom/base/test/gtest/moz.build b/dom/base/test/gtest/moz.build new file mode 100644 index 0000000000..9a767eb2ff --- /dev/null +++ b/dom/base/test/gtest/moz.build @@ -0,0 +1,21 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. + +UNIFIED_SOURCES += [ + "TestContentUtils.cpp", + "TestMimeType.cpp", + "TestParser.cpp", + "TestPlainTextSerializer.cpp", + "TestScheduler.cpp", + "TestXMLSerializerNoBreakLink.cpp", + "TestXPathGenerator.cpp", +] + +LOCAL_INCLUDES += ["/dom/base"] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul-gtest" diff --git a/dom/base/test/head.js b/dom/base/test/head.js new file mode 100644 index 0000000000..2b39f7a7b1 --- /dev/null +++ b/dom/base/test/head.js @@ -0,0 +1,15 @@ +async function newFocusedWindow(trigger) { + let winPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); + let delayedStartupPromise = BrowserTestUtils.waitForNewWindow(); + + await trigger(); + + let win = await winPromise; + // New windows get focused after the first paint, see bug 1262946 + await BrowserTestUtils.waitForContentEvent( + win.gBrowser.selectedBrowser, + "MozAfterPaint" + ); + await delayedStartupPromise; + return win; +} diff --git a/dom/base/test/iframe1_bug1640766.html b/dom/base/test/iframe1_bug1640766.html new file mode 100644 index 0000000000..51da4f22f0 --- /dev/null +++ b/dom/base/test/iframe1_bug1640766.html @@ -0,0 +1,20 @@ + + + +Iframe 1 for Bug 1640766 + + +
                    Iframe 1
                    + + + diff --git a/dom/base/test/iframe1_bug426646.html b/dom/base/test/iframe1_bug426646.html new file mode 100644 index 0000000000..533e77ad4c --- /dev/null +++ b/dom/base/test/iframe1_bug426646.html @@ -0,0 +1 @@ +1st page diff --git a/dom/base/test/iframe1_bug431701.html b/dom/base/test/iframe1_bug431701.html new file mode 100644 index 0000000000..18ecdcb795 --- /dev/null +++ b/dom/base/test/iframe1_bug431701.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe2_bug1640766.html b/dom/base/test/iframe2_bug1640766.html new file mode 100644 index 0000000000..6a5ca30796 --- /dev/null +++ b/dom/base/test/iframe2_bug1640766.html @@ -0,0 +1,10 @@ + + + +Iframe 2 for Bug 1640766 + + +
                    Iframe 2
                    + + + diff --git a/dom/base/test/iframe2_bug426646.html b/dom/base/test/iframe2_bug426646.html new file mode 100644 index 0000000000..45e85c0f13 --- /dev/null +++ b/dom/base/test/iframe2_bug426646.html @@ -0,0 +1 @@ +2nd page diff --git a/dom/base/test/iframe2_bug431701.html b/dom/base/test/iframe2_bug431701.html new file mode 100644 index 0000000000..6c963c5455 --- /dev/null +++ b/dom/base/test/iframe2_bug431701.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe3_bug431701.html b/dom/base/test/iframe3_bug431701.html new file mode 100644 index 0000000000..c0aac38766 --- /dev/null +++ b/dom/base/test/iframe3_bug431701.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe4_bug431701.xml b/dom/base/test/iframe4_bug431701.xml new file mode 100644 index 0000000000..18ecdcb795 --- /dev/null +++ b/dom/base/test/iframe4_bug431701.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe5_bug431701.xml b/dom/base/test/iframe5_bug431701.xml new file mode 100644 index 0000000000..d761751ee1 --- /dev/null +++ b/dom/base/test/iframe5_bug431701.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe6_bug431701.xml b/dom/base/test/iframe6_bug431701.xml new file mode 100644 index 0000000000..17704b893a --- /dev/null +++ b/dom/base/test/iframe6_bug431701.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe7_bug431701.xml b/dom/base/test/iframe7_bug431701.xml new file mode 100644 index 0000000000..73757924a7 --- /dev/null +++ b/dom/base/test/iframe7_bug431701.xml @@ -0,0 +1 @@ + diff --git a/dom/base/test/iframe_bug962251.html b/dom/base/test/iframe_bug962251.html new file mode 100644 index 0000000000..2fa3a50dcf --- /dev/null +++ b/dom/base/test/iframe_bug962251.html @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dom/base/test/iframe_bug976673.html b/dom/base/test/iframe_bug976673.html new file mode 100644 index 0000000000..92c5bf76d0 --- /dev/null +++ b/dom/base/test/iframe_bug976673.html @@ -0,0 +1,26 @@ + + + + + Test for Bug 976673 + + + + + + diff --git a/dom/base/test/iframe_main_bug1022229.html b/dom/base/test/iframe_main_bug1022229.html new file mode 100644 index 0000000000..c89a8c9a9d --- /dev/null +++ b/dom/base/test/iframe_main_bug1022229.html @@ -0,0 +1,33 @@ + + + + + + + + + diff --git a/dom/base/test/iframe_meta_refresh.sjs b/dom/base/test/iframe_meta_refresh.sjs new file mode 100644 index 0000000000..0d881be72b --- /dev/null +++ b/dom/base/test/iframe_meta_refresh.sjs @@ -0,0 +1,92 @@ +/* + * Test server for iframe refresh from meta http-equiv + */ + +const SHARED_KEY = "iframe_meta_refresh"; +const DEFAULT_STATE = { count: 0, referrers: [] }; +const REFRESH_PAGE = + "http://example.com/tests/dom/base/test/iframe_meta_refresh.sjs?action=test"; + +function createContent(refresh) { + let metaRefresh = ""; + let scriptMessage = ""; + + if (refresh) { + metaRefresh = ``; + } else { + scriptMessage = ` + `; + } + + return ` + + + + ${metaRefresh} + Test referrer of meta http-equiv refresh + + + ${scriptMessage} + + `; +} + +function handleRequest(request, response) { + Components.utils.importGlobalProperties(["URLSearchParams"]); + let query = new URLSearchParams(request.queryString); + + let action = query.get("action"); + + var referrerLevel = "none"; + if (request.hasHeader("Referer")) { + let referrer = request.getHeader("Referer"); + if (referrer.indexOf("test_meta_refresh_referrer") > 0) { + referrerLevel = "full"; + } else if (referrer == "http://mochi.test:8888/") { + referrerLevel = "origin"; + } + } + + var state = getSharedState(SHARED_KEY); + if (state === "") { + state = DEFAULT_STATE; + } else { + state = JSON.parse(state); + } + + response.setStatusLine(request.httpVersion, 200, "OK"); + + //avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + + if (action === "results") { + response.setHeader("Content-Type", "text/plain", false); + response.write(JSON.stringify(state)); + return; + } + + if (action === "reset") { + //reset server state + setSharedState(SHARED_KEY, JSON.stringify(DEFAULT_STATE)); + response.write(""); + return; + } + + if (action === "test") { + let load = query.get("load"); + state.count++; + if (state.referrers.indexOf(referrerLevel) < 0) { + state.referrers.push(referrerLevel); + } + + // Write frame content + response.write(createContent(load)); + } + + setSharedState(SHARED_KEY, JSON.stringify(state)); + return; +} diff --git a/dom/base/test/iframe_postMessage_solidus.html b/dom/base/test/iframe_postMessage_solidus.html new file mode 100644 index 0000000000..86f12367ec --- /dev/null +++ b/dom/base/test/iframe_postMessage_solidus.html @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/dom/base/test/iframe_postMessages.html b/dom/base/test/iframe_postMessages.html new file mode 100644 index 0000000000..0b07456eb8 --- /dev/null +++ b/dom/base/test/iframe_postMessages.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/dom/base/test/iframe_sandbox_bug1022229.html b/dom/base/test/iframe_sandbox_bug1022229.html new file mode 100644 index 0000000000..3d70e9d7af --- /dev/null +++ b/dom/base/test/iframe_sandbox_bug1022229.html @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/dom/base/test/iframe_shared_compartment2a.html b/dom/base/test/iframe_shared_compartment2a.html new file mode 100644 index 0000000000..e2451367bb --- /dev/null +++ b/dom/base/test/iframe_shared_compartment2a.html @@ -0,0 +1,2 @@ + diff --git a/dom/base/test/iframe_shared_compartment2b.html b/dom/base/test/iframe_shared_compartment2b.html new file mode 100644 index 0000000000..64d57320f8 --- /dev/null +++ b/dom/base/test/iframe_shared_compartment2b.html @@ -0,0 +1,3 @@ + diff --git a/dom/base/test/intersectionobserver_cross_domain_iframe.html b/dom/base/test/intersectionobserver_cross_domain_iframe.html new file mode 100644 index 0000000000..750ccaf6f2 --- /dev/null +++ b/dom/base/test/intersectionobserver_cross_domain_iframe.html @@ -0,0 +1,24 @@ + + + + + +
                    + + + diff --git a/dom/base/test/intersectionobserver_iframe.html b/dom/base/test/intersectionobserver_iframe.html new file mode 100644 index 0000000000..dae0da82c9 --- /dev/null +++ b/dom/base/test/intersectionobserver_iframe.html @@ -0,0 +1,17 @@ + + + + + +
                    + + diff --git a/dom/base/test/intersectionobserver_window.html b/dom/base/test/intersectionobserver_window.html new file mode 100644 index 0000000000..826b5064eb --- /dev/null +++ b/dom/base/test/intersectionobserver_window.html @@ -0,0 +1,46 @@ + + + + + +
                    + + + diff --git a/dom/base/test/invalid_accesscontrol.resource b/dom/base/test/invalid_accesscontrol.resource new file mode 100644 index 0000000000..aca66f6f8d --- /dev/null +++ b/dom/base/test/invalid_accesscontrol.resource @@ -0,0 +1,7 @@ +:this file must be enconded in utf8 +:and its Content-Type must be equal to text/event-stream + +event: message +data: 1 + + diff --git a/dom/base/test/invalid_accesscontrol.resource^headers^ b/dom/base/test/invalid_accesscontrol.resource^headers^ new file mode 100644 index 0000000000..d5bed552cb --- /dev/null +++ b/dom/base/test/invalid_accesscontrol.resource^headers^ @@ -0,0 +1,4 @@ +Access-Control-Allow-Origin: http://an.accesscrontrol.domain:80 +Content-Type: text/event-stream +Cache-Control: no-cache, must-revalidate + diff --git a/dom/base/test/jsmodules/.eslintrc.js b/dom/base/test/jsmodules/.eslintrc.js new file mode 100644 index 0000000000..f811aa790b --- /dev/null +++ b/dom/base/test/jsmodules/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + parserOptions: { + sourceType: "module", + }, +}; diff --git a/dom/base/test/jsmodules/chrome.ini b/dom/base/test/jsmodules/chrome.ini new file mode 100644 index 0000000000..2b75dab150 --- /dev/null +++ b/dom/base/test/jsmodules/chrome.ini @@ -0,0 +1,53 @@ +[DEFAULT] +support-files = + module_setRan.js + module_testSyntax.js + module_badSyntax.js + module_simpleImport.js + module_simpleExport.js + module_badImport.js + module_simple1.js + module_simple2.js + module_simple3.js + module_cyclic1.js + module_cyclic2.js + module_cyclic3.js + module_multiImports.js + module_multiLargeImports.js + script_simple2.js + module_large1.js + module_large2.js + module_large3.js + module_extractIntroType.js + iframe_extractIntroType.html + module_missingImport.js + +[test_moduleScriptsRun.html] +[test_moduleParsedAsModule.html] +[test_scriptNotParsedAsModule.html] +[test_typeAttrCaseInsensitive.html] +[test_moduleNotFound.html] +[test_import_meta_resolve.html] +[test_importNotFound.html] +[test_syntaxError.html] +[test_syntaxErrorAsync.html] +[test_syntaxErrorInline.html] +[test_syntaxErrorInlineAsync.html] +[test_simpleImport.html] +[test_cyclicImport.html] +[test_importResolveFailed.html] +[test_multiTopLevelImports.html] +[test_multiModuleImports.html] +[test_multiAsyncImports.html] +[test_scriptModuleOrder.html] +[test_toplevelModuleMemoization.html] +[test_importedModuleMemoization.html] +[test_multiTopLevelLargeImports.html] +[test_multiModuleLargeImports.html] +[test_asyncInlineModules.html] +[test_scriptInsertedModule.html] +[test_linkErrorInCommon1.html] +[test_linkErrorInCommon2.html] +[test_topLevelIntroType.html] +[test_importIntroType.html] +[test_dynamicImportErrorMessage.html] diff --git a/dom/base/test/jsmodules/iframe_extractIntroType.html b/dom/base/test/jsmodules/iframe_extractIntroType.html new file mode 100644 index 0000000000..26c58aea6d --- /dev/null +++ b/dom/base/test/jsmodules/iframe_extractIntroType.html @@ -0,0 +1,14 @@ + + + + diff --git a/dom/base/test/jsmodules/importmaps/chrome.ini b/dom/base/test/jsmodules/importmaps/chrome.ini new file mode 100644 index 0000000000..4fca7e97fa --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/chrome.ini @@ -0,0 +1,29 @@ +[DEFAULT] +support-files = + external_importMap.js + insert_a_base_element.js + module_simpleImportMap.js + module_simpleImportMap_dir.js + module_simpleImportMap_remap.js + module_simpleImportMap_remap_https.js + module_simpleExport.js + module_sortedImportMap.js + scope1/module_simpleExport.js + scope1/module_simpleImportMap.js + scope1/scope2/module_simpleExport.js + scope1/scope2/module_simpleImportMap.js +prefs = + dom.importMaps.enabled=true + +[test_dynamic_import_reject_importMap.html] +[test_externalImportMap.html] +[test_import_meta_resolve_importMap.html] +[test_inline_module_reject_importMap.html] +[test_load_importMap_with_base.html] +[test_load_importMap_with_base2.html] +[test_module_script_reject_importMap.html] +[test_parse_importMap_failed.html] +[test_reject_multiple_importMaps.html] +[test_simpleImportMap.html] +[test_sortedImportMap.html] + diff --git a/dom/base/test/jsmodules/importmaps/external_importMap.js b/dom/base/test/jsmodules/importmaps/external_importMap.js new file mode 100644 index 0000000000..e89d9f618f --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/external_importMap.js @@ -0,0 +1,5 @@ +let imap = { + imports: { + foo: "./foo.js", + }, +}; diff --git a/dom/base/test/jsmodules/importmaps/insert_a_base_element.js b/dom/base/test/jsmodules/importmaps/insert_a_base_element.js new file mode 100644 index 0000000000..435af97d1e --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/insert_a_base_element.js @@ -0,0 +1,4 @@ +const el = document.createElement("base"); +el.href = + "chrome://mochitests/content/chrome/dom/base/test/jsmodules/importmaps/scope1/"; +document.currentScript.after(el); diff --git a/dom/base/test/jsmodules/importmaps/module_simpleExport.js b/dom/base/test/jsmodules/importmaps/module_simpleExport.js new file mode 100644 index 0000000000..9714d6d0ab --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_simpleExport.js @@ -0,0 +1 @@ +export let x = 42; diff --git a/dom/base/test/jsmodules/importmaps/module_simpleImportMap.js b/dom/base/test/jsmodules/importmaps/module_simpleImportMap.js new file mode 100644 index 0000000000..153b84e6de --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_simpleImportMap.js @@ -0,0 +1,2 @@ +import { x } from "simple"; +result = x; diff --git a/dom/base/test/jsmodules/importmaps/module_simpleImportMap_dir.js b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_dir.js new file mode 100644 index 0000000000..554cc6a7bd --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_dir.js @@ -0,0 +1,2 @@ +import { x } from "dir/module_simpleExport.js"; +result_dir = x + 1; diff --git a/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap.js b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap.js new file mode 100644 index 0000000000..5ebaa30188 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap.js @@ -0,0 +1,2 @@ +import { x } from "./module.js"; +result_remap = x + 2; diff --git a/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap_https.js b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap_https.js new file mode 100644 index 0000000000..c047fd28c3 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_simpleImportMap_remap_https.js @@ -0,0 +1,2 @@ +import { x } from "https://example.com/module.js"; +result_remap_https = x + 3; diff --git a/dom/base/test/jsmodules/importmaps/module_sortedImportMap.js b/dom/base/test/jsmodules/importmaps/module_sortedImportMap.js new file mode 100644 index 0000000000..41b2903097 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/module_sortedImportMap.js @@ -0,0 +1,4 @@ +import { x } from "scope1/scope2/module_simpleExport.js"; +import { x as y } from "scope1/scope2/scope3/scope4/module_simpleExport.js"; +sorted_result = x; +sorted_result2 = y; diff --git a/dom/base/test/jsmodules/importmaps/moz.build b/dom/base/test/jsmodules/importmaps/moz.build new file mode 100644 index 0000000000..1a7d5281ea --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/moz.build @@ -0,0 +1,7 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +MOCHITEST_CHROME_MANIFESTS += ["chrome.ini"] diff --git a/dom/base/test/jsmodules/importmaps/scope1/module_simpleExport.js b/dom/base/test/jsmodules/importmaps/scope1/module_simpleExport.js new file mode 100644 index 0000000000..e6b0ed1c0c --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/scope1/module_simpleExport.js @@ -0,0 +1 @@ +export let x = 84; diff --git a/dom/base/test/jsmodules/importmaps/scope1/module_simpleImportMap.js b/dom/base/test/jsmodules/importmaps/scope1/module_simpleImportMap.js new file mode 100644 index 0000000000..b1682e1900 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/scope1/module_simpleImportMap.js @@ -0,0 +1,2 @@ +import { x } from "simple"; +result_scope1 = x; diff --git a/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleExport.js b/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleExport.js new file mode 100644 index 0000000000..ba2bbae16b --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleExport.js @@ -0,0 +1 @@ +export let x = 126; diff --git a/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleImportMap.js b/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleImportMap.js new file mode 100644 index 0000000000..ecb38b7b21 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/scope1/scope2/module_simpleImportMap.js @@ -0,0 +1,2 @@ +import { x } from "simple"; +result_scope2 = x; diff --git a/dom/base/test/jsmodules/importmaps/test_dynamic_import_reject_importMap.html b/dom/base/test/jsmodules/importmaps/test_dynamic_import_reject_importMap.html new file mode 100644 index 0000000000..75471064f9 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_dynamic_import_reject_importMap.html @@ -0,0 +1,46 @@ + + + + Test import map should be rejected. + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_externalImportMap.html b/dom/base/test/jsmodules/importmaps/test_externalImportMap.html new file mode 100644 index 0000000000..1345f61947 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_externalImportMap.html @@ -0,0 +1,43 @@ + + +Test an external import map + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_import_meta_resolve_importMap.html b/dom/base/test/jsmodules/importmaps/test_import_meta_resolve_importMap.html new file mode 100644 index 0000000000..df1bed2e56 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_import_meta_resolve_importMap.html @@ -0,0 +1,49 @@ + + + + Test import.meta.resolve with import maps + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_inline_module_reject_importMap.html b/dom/base/test/jsmodules/importmaps/test_inline_module_reject_importMap.html new file mode 100644 index 0000000000..2001cbcfb9 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_inline_module_reject_importMap.html @@ -0,0 +1,61 @@ + + + + Test import map should be rejected. + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base.html b/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base.html new file mode 100644 index 0000000000..3139a60d37 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base.html @@ -0,0 +1,51 @@ + + + + Test a simple import map with a base element + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base2.html b/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base2.html new file mode 100644 index 0000000000..ed000512fd --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_load_importMap_with_base2.html @@ -0,0 +1,51 @@ + + + + Test a simple import map with a script creates a base element + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_module_script_reject_importMap.html b/dom/base/test/jsmodules/importmaps/test_module_script_reject_importMap.html new file mode 100644 index 0000000000..bc73a60fc9 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_module_script_reject_importMap.html @@ -0,0 +1,45 @@ + + + + Test import map should be rejected. + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_parse_importMap_failed.html b/dom/base/test/jsmodules/importmaps/test_parse_importMap_failed.html new file mode 100644 index 0000000000..b304acd943 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_parse_importMap_failed.html @@ -0,0 +1,40 @@ + + + + Test the error message when parsing import maps failed + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_reject_multiple_importMaps.html b/dom/base/test/jsmodules/importmaps/test_reject_multiple_importMaps.html new file mode 100644 index 0000000000..cc41163101 --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_reject_multiple_importMaps.html @@ -0,0 +1,64 @@ + + + + Test the 2nd import map should be rejected. + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_simpleImportMap.html b/dom/base/test/jsmodules/importmaps/test_simpleImportMap.html new file mode 100644 index 0000000000..6a46ff770e --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_simpleImportMap.html @@ -0,0 +1,62 @@ + + +Test a simple import map + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/importmaps/test_sortedImportMap.html b/dom/base/test/jsmodules/importmaps/test_sortedImportMap.html new file mode 100644 index 0000000000..17e4049d1a --- /dev/null +++ b/dom/base/test/jsmodules/importmaps/test_sortedImportMap.html @@ -0,0 +1,62 @@ + + +Test a sorted import map + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/module_badImport.js b/dom/base/test/jsmodules/module_badImport.js new file mode 100644 index 0000000000..ab18249156 --- /dev/null +++ b/dom/base/test/jsmodules/module_badImport.js @@ -0,0 +1 @@ +import "invalid specifier"; diff --git a/dom/base/test/jsmodules/module_badSyntax.js b/dom/base/test/jsmodules/module_badSyntax.js new file mode 100644 index 0000000000..744158108c --- /dev/null +++ b/dom/base/test/jsmodules/module_badSyntax.js @@ -0,0 +1,3 @@ +// Module with a syntax error. +some invalid js syntax; +wasRun = true; diff --git a/dom/base/test/jsmodules/module_cyclic1.js b/dom/base/test/jsmodules/module_cyclic1.js new file mode 100644 index 0000000000..480efee0ae --- /dev/null +++ b/dom/base/test/jsmodules/module_cyclic1.js @@ -0,0 +1,8 @@ +import { func2 } from "./module_cyclic2.js"; + +export function func1(x, y) { + if (x <= 0) { + return y; + } + return func2(x - 1, y + "1"); +} diff --git a/dom/base/test/jsmodules/module_cyclic2.js b/dom/base/test/jsmodules/module_cyclic2.js new file mode 100644 index 0000000000..5f17afbd0a --- /dev/null +++ b/dom/base/test/jsmodules/module_cyclic2.js @@ -0,0 +1,8 @@ +import { func3 } from "./module_cyclic3.js"; + +export function func2(x, y) { + if (x <= 0) { + return y; + } + return func3(x - 1, y + "2"); +} diff --git a/dom/base/test/jsmodules/module_cyclic3.js b/dom/base/test/jsmodules/module_cyclic3.js new file mode 100644 index 0000000000..4b4c1e4ff6 --- /dev/null +++ b/dom/base/test/jsmodules/module_cyclic3.js @@ -0,0 +1,8 @@ +import { func1 } from "./module_cyclic1.js"; + +export function func3(x, y) { + if (x <= 0) { + return y; + } + return func1(x - 1, y + "3"); +} diff --git a/dom/base/test/jsmodules/module_extractIntroType.js b/dom/base/test/jsmodules/module_extractIntroType.js new file mode 100644 index 0000000000..b2e1f1c6cf --- /dev/null +++ b/dom/base/test/jsmodules/module_extractIntroType.js @@ -0,0 +1,5 @@ +// Extract the introductionType for this module in conjunction with +// iframe_extractIntroType.html. +extractIntroType = function () { + debugger; +}; diff --git a/dom/base/test/jsmodules/module_large1.js b/dom/base/test/jsmodules/module_large1.js new file mode 100644 index 0000000000..d6933d298d --- /dev/null +++ b/dom/base/test/jsmodules/module_large1.js @@ -0,0 +1,78 @@ +/* + * Scripts larger than 5KB may be compiled off main thread. This is such a + * script. + * + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + */ + +results.push(1); diff --git a/dom/base/test/jsmodules/module_large2.js b/dom/base/test/jsmodules/module_large2.js new file mode 100644 index 0000000000..e1b6da4c91 --- /dev/null +++ b/dom/base/test/jsmodules/module_large2.js @@ -0,0 +1,78 @@ +/* + * Scripts larger than 5KB may be compiled off main thread. This is such a + * script. + * + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + */ + +results.push(2); diff --git a/dom/base/test/jsmodules/module_large3.js b/dom/base/test/jsmodules/module_large3.js new file mode 100644 index 0000000000..c966a8eb20 --- /dev/null +++ b/dom/base/test/jsmodules/module_large3.js @@ -0,0 +1,78 @@ +/* + * Scripts larger than 5KB may be compiled off main thread. This is such a + * script. + * + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + * large large large large large large large large large large large large + */ + +results.push(3); diff --git a/dom/base/test/jsmodules/module_missingImport.js b/dom/base/test/jsmodules/module_missingImport.js new file mode 100644 index 0000000000..28cf608de8 --- /dev/null +++ b/dom/base/test/jsmodules/module_missingImport.js @@ -0,0 +1 @@ +import { missing } from "./module_simple1.js"; diff --git a/dom/base/test/jsmodules/module_multiImports.js b/dom/base/test/jsmodules/module_multiImports.js new file mode 100644 index 0000000000..0587ac5ca0 --- /dev/null +++ b/dom/base/test/jsmodules/module_multiImports.js @@ -0,0 +1,4 @@ +import "./module_simple1.js"; +import "./module_simple2.js"; +import "./module_simple3.js"; +results.push(4); diff --git a/dom/base/test/jsmodules/module_multiLargeImports.js b/dom/base/test/jsmodules/module_multiLargeImports.js new file mode 100644 index 0000000000..ddc5792d0d --- /dev/null +++ b/dom/base/test/jsmodules/module_multiLargeImports.js @@ -0,0 +1,4 @@ +import "./module_large1.js"; +import "./module_large2.js"; +import "./module_large3.js"; +results.push(4); diff --git a/dom/base/test/jsmodules/module_setRan.js b/dom/base/test/jsmodules/module_setRan.js new file mode 100644 index 0000000000..4804382fdd --- /dev/null +++ b/dom/base/test/jsmodules/module_setRan.js @@ -0,0 +1,2 @@ +// Set a global flag to indicate that this module was executed. +moduleRan = true; diff --git a/dom/base/test/jsmodules/module_simple1.js b/dom/base/test/jsmodules/module_simple1.js new file mode 100644 index 0000000000..7594ac699e --- /dev/null +++ b/dom/base/test/jsmodules/module_simple1.js @@ -0,0 +1 @@ +results.push(1); diff --git a/dom/base/test/jsmodules/module_simple2.js b/dom/base/test/jsmodules/module_simple2.js new file mode 100644 index 0000000000..f92a1c9d6e --- /dev/null +++ b/dom/base/test/jsmodules/module_simple2.js @@ -0,0 +1 @@ +results.push(2); diff --git a/dom/base/test/jsmodules/module_simple3.js b/dom/base/test/jsmodules/module_simple3.js new file mode 100644 index 0000000000..71979926e6 --- /dev/null +++ b/dom/base/test/jsmodules/module_simple3.js @@ -0,0 +1 @@ +results.push(3); diff --git a/dom/base/test/jsmodules/module_simpleExport.js b/dom/base/test/jsmodules/module_simpleExport.js new file mode 100644 index 0000000000..9714d6d0ab --- /dev/null +++ b/dom/base/test/jsmodules/module_simpleExport.js @@ -0,0 +1 @@ +export let x = 42; diff --git a/dom/base/test/jsmodules/module_simpleImport.js b/dom/base/test/jsmodules/module_simpleImport.js new file mode 100644 index 0000000000..9e459fef7a --- /dev/null +++ b/dom/base/test/jsmodules/module_simpleImport.js @@ -0,0 +1,2 @@ +import { x } from "./module_simpleExport.js"; +result = x; diff --git a/dom/base/test/jsmodules/module_testSyntax.js b/dom/base/test/jsmodules/module_testSyntax.js new file mode 100644 index 0000000000..3d647ae0b4 --- /dev/null +++ b/dom/base/test/jsmodules/module_testSyntax.js @@ -0,0 +1,3 @@ +// Module that throws a syntax error if parsed as a script. +export default 1; +wasRun = true; diff --git a/dom/base/test/jsmodules/moz.build b/dom/base/test/jsmodules/moz.build new file mode 100644 index 0000000000..1a7d5281ea --- /dev/null +++ b/dom/base/test/jsmodules/moz.build @@ -0,0 +1,7 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +MOCHITEST_CHROME_MANIFESTS += ["chrome.ini"] diff --git a/dom/base/test/jsmodules/script_simple2.js b/dom/base/test/jsmodules/script_simple2.js new file mode 100644 index 0000000000..f92a1c9d6e --- /dev/null +++ b/dom/base/test/jsmodules/script_simple2.js @@ -0,0 +1 @@ +results.push(2); diff --git a/dom/base/test/jsmodules/test_asyncInlineModules.html b/dom/base/test/jsmodules/test_asyncInlineModules.html new file mode 100644 index 0000000000..188146e69c --- /dev/null +++ b/dom/base/test/jsmodules/test_asyncInlineModules.html @@ -0,0 +1,36 @@ + + +Test async inline modules + + + + + + diff --git a/dom/base/test/jsmodules/test_cyclicImport.html b/dom/base/test/jsmodules/test_cyclicImport.html new file mode 100644 index 0000000000..d316a140d4 --- /dev/null +++ b/dom/base/test/jsmodules/test_cyclicImport.html @@ -0,0 +1,18 @@ + + +Test cyclic module imports + + + + diff --git a/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html b/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html new file mode 100644 index 0000000000..f5552d5a6b --- /dev/null +++ b/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html @@ -0,0 +1,16 @@ + + +Test the error message from import() + + + diff --git a/dom/base/test/jsmodules/test_importIntroType.html b/dom/base/test/jsmodules/test_importIntroType.html new file mode 100644 index 0000000000..67c08bb5d7 --- /dev/null +++ b/dom/base/test/jsmodules/test_importIntroType.html @@ -0,0 +1,22 @@ + + +Test introduction type of an imported module + + + + + diff --git a/dom/base/test/jsmodules/test_importNotFound.html b/dom/base/test/jsmodules/test_importNotFound.html new file mode 100644 index 0000000000..fc624b6b68 --- /dev/null +++ b/dom/base/test/jsmodules/test_importNotFound.html @@ -0,0 +1,27 @@ + + +Test what happens when a module import is not found + + + + diff --git a/dom/base/test/jsmodules/test_importResolveFailed.html b/dom/base/test/jsmodules/test_importResolveFailed.html new file mode 100644 index 0000000000..559de77dcd --- /dev/null +++ b/dom/base/test/jsmodules/test_importResolveFailed.html @@ -0,0 +1,21 @@ + + +Test error thrown when an import cannot be resolved + + + + diff --git a/dom/base/test/jsmodules/test_import_meta_resolve.html b/dom/base/test/jsmodules/test_import_meta_resolve.html new file mode 100644 index 0000000000..66eedc95bc --- /dev/null +++ b/dom/base/test/jsmodules/test_import_meta_resolve.html @@ -0,0 +1,65 @@ + + + + Test import.meta.resolve + + + + + + + + + + + + + + + + + + diff --git a/dom/base/test/jsmodules/test_importedModuleMemoization.html b/dom/base/test/jsmodules/test_importedModuleMemoization.html new file mode 100644 index 0000000000..37cb26752d --- /dev/null +++ b/dom/base/test/jsmodules/test_importedModuleMemoization.html @@ -0,0 +1,30 @@ + + +Test imported modules are momoized and only loaded once + + + + + + diff --git a/dom/base/test/jsmodules/test_linkErrorInCommon1.html b/dom/base/test/jsmodules/test_linkErrorInCommon1.html new file mode 100644 index 0000000000..436493c75e --- /dev/null +++ b/dom/base/test/jsmodules/test_linkErrorInCommon1.html @@ -0,0 +1,32 @@ + + +Test handling of a link error in a common module + + + + + diff --git a/dom/base/test/jsmodules/test_linkErrorInCommon2.html b/dom/base/test/jsmodules/test_linkErrorInCommon2.html new file mode 100644 index 0000000000..a882ec0992 --- /dev/null +++ b/dom/base/test/jsmodules/test_linkErrorInCommon2.html @@ -0,0 +1,32 @@ + + +Test handling of a link error in a common module + + + + + diff --git a/dom/base/test/jsmodules/test_moduleNotFound.html b/dom/base/test/jsmodules/test_moduleNotFound.html new file mode 100644 index 0000000000..f5e7c37364 --- /dev/null +++ b/dom/base/test/jsmodules/test_moduleNotFound.html @@ -0,0 +1,24 @@ + + +Test what happens when a top-level module is not found + + + + diff --git a/dom/base/test/jsmodules/test_moduleParsedAsModule.html b/dom/base/test/jsmodules/test_moduleParsedAsModule.html new file mode 100644 index 0000000000..2cd4abbd57 --- /dev/null +++ b/dom/base/test/jsmodules/test_moduleParsedAsModule.html @@ -0,0 +1,23 @@ + + +Test module script parsed as module + + + + diff --git a/dom/base/test/jsmodules/test_moduleScriptsRun.html b/dom/base/test/jsmodules/test_moduleScriptsRun.html new file mode 100644 index 0000000000..908f7ff46a --- /dev/null +++ b/dom/base/test/jsmodules/test_moduleScriptsRun.html @@ -0,0 +1,19 @@ + + +Test script elements with type="module" are run for chrome HTML + + + + + diff --git a/dom/base/test/jsmodules/test_multiAsyncImports.html b/dom/base/test/jsmodules/test_multiAsyncImports.html new file mode 100644 index 0000000000..dc318851c8 --- /dev/null +++ b/dom/base/test/jsmodules/test_multiAsyncImports.html @@ -0,0 +1,30 @@ + + +Test a loading multiple modules with the async attribute from top level + + + + + + diff --git a/dom/base/test/jsmodules/test_multiModuleImports.html b/dom/base/test/jsmodules/test_multiModuleImports.html new file mode 100644 index 0000000000..003f7e6754 --- /dev/null +++ b/dom/base/test/jsmodules/test_multiModuleImports.html @@ -0,0 +1,28 @@ + + +Test a importing multiple modules from a module + + + + diff --git a/dom/base/test/jsmodules/test_multiModuleLargeImports.html b/dom/base/test/jsmodules/test_multiModuleLargeImports.html new file mode 100644 index 0000000000..f590bae449 --- /dev/null +++ b/dom/base/test/jsmodules/test_multiModuleLargeImports.html @@ -0,0 +1,28 @@ + + +Test importing multiple large modules which may be compiled off main thread from a module + + + + diff --git a/dom/base/test/jsmodules/test_multiTopLevelImports.html b/dom/base/test/jsmodules/test_multiTopLevelImports.html new file mode 100644 index 0000000000..7cfe600959 --- /dev/null +++ b/dom/base/test/jsmodules/test_multiTopLevelImports.html @@ -0,0 +1,30 @@ + + +Test importing multiple modules from top level + + + + + + diff --git a/dom/base/test/jsmodules/test_multiTopLevelLargeImports.html b/dom/base/test/jsmodules/test_multiTopLevelLargeImports.html new file mode 100644 index 0000000000..8deee5479e --- /dev/null +++ b/dom/base/test/jsmodules/test_multiTopLevelLargeImports.html @@ -0,0 +1,30 @@ + + +Test a importing large modules which may be compiled off main thread + + + + + + diff --git a/dom/base/test/jsmodules/test_scriptInsertedModule.html b/dom/base/test/jsmodules/test_scriptInsertedModule.html new file mode 100644 index 0000000000..3f00ab9684 --- /dev/null +++ b/dom/base/test/jsmodules/test_scriptInsertedModule.html @@ -0,0 +1,20 @@ + + +Test a script-inserted module + + + diff --git a/dom/base/test/jsmodules/test_scriptModuleOrder.html b/dom/base/test/jsmodules/test_scriptModuleOrder.html new file mode 100644 index 0000000000..bd8a4dcebe --- /dev/null +++ b/dom/base/test/jsmodules/test_scriptModuleOrder.html @@ -0,0 +1,30 @@ + + +Test execution order of deferred scripts and modules + + + + + + diff --git a/dom/base/test/jsmodules/test_scriptNotParsedAsModule.html b/dom/base/test/jsmodules/test_scriptNotParsedAsModule.html new file mode 100644 index 0000000000..ba09503503 --- /dev/null +++ b/dom/base/test/jsmodules/test_scriptNotParsedAsModule.html @@ -0,0 +1,23 @@ + + +Test classic script not parsed as module + + + + diff --git a/dom/base/test/jsmodules/test_simpleImport.html b/dom/base/test/jsmodules/test_simpleImport.html new file mode 100644 index 0000000000..3c1af3f5b6 --- /dev/null +++ b/dom/base/test/jsmodules/test_simpleImport.html @@ -0,0 +1,16 @@ + + +Test a simple module import + + + + diff --git a/dom/base/test/jsmodules/test_syntaxError.html b/dom/base/test/jsmodules/test_syntaxError.html new file mode 100644 index 0000000000..180c5aa445 --- /dev/null +++ b/dom/base/test/jsmodules/test_syntaxError.html @@ -0,0 +1,30 @@ + + +Test syntax errors parsing a module are reported + + + + diff --git a/dom/base/test/jsmodules/test_syntaxErrorAsync.html b/dom/base/test/jsmodules/test_syntaxErrorAsync.html new file mode 100644 index 0000000000..64d8e6a21c --- /dev/null +++ b/dom/base/test/jsmodules/test_syntaxErrorAsync.html @@ -0,0 +1,30 @@ + + +Test syntax errors parsing an async module are reported + + + + diff --git a/dom/base/test/jsmodules/test_syntaxErrorInline.html b/dom/base/test/jsmodules/test_syntaxErrorInline.html new file mode 100644 index 0000000000..4960f5358a --- /dev/null +++ b/dom/base/test/jsmodules/test_syntaxErrorInline.html @@ -0,0 +1,34 @@ + + +Test syntax errors parsing an inline module are reported + + + + diff --git a/dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html b/dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html new file mode 100644 index 0000000000..39b8a7354d --- /dev/null +++ b/dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html @@ -0,0 +1,34 @@ + + +Test syntax errors parsing an inline async module are reported + + + + diff --git a/dom/base/test/jsmodules/test_topLevelIntroType.html b/dom/base/test/jsmodules/test_topLevelIntroType.html new file mode 100644 index 0000000000..2c9c91b5bd --- /dev/null +++ b/dom/base/test/jsmodules/test_topLevelIntroType.html @@ -0,0 +1,21 @@ + + +Test introduction type of a top-level module + + + + + diff --git a/dom/base/test/jsmodules/test_toplevelModuleMemoization.html b/dom/base/test/jsmodules/test_toplevelModuleMemoization.html new file mode 100644 index 0000000000..ed4dee6f8b --- /dev/null +++ b/dom/base/test/jsmodules/test_toplevelModuleMemoization.html @@ -0,0 +1,30 @@ + + +Test toplevel modules are momoized and only loaded once + + + + + + diff --git a/dom/base/test/jsmodules/test_typeAttrCaseInsensitive.html b/dom/base/test/jsmodules/test_typeAttrCaseInsensitive.html new file mode 100644 index 0000000000..47ebc90dd6 --- /dev/null +++ b/dom/base/test/jsmodules/test_typeAttrCaseInsensitive.html @@ -0,0 +1,19 @@ + + +Test script element's type attribute comparision is case-insensitive + + + + + diff --git a/dom/base/test/meta_viewport/mochitest.ini b/dom/base/test/meta_viewport/mochitest.ini new file mode 100644 index 0000000000..cfe63cc999 --- /dev/null +++ b/dom/base/test/meta_viewport/mochitest.ini @@ -0,0 +1,54 @@ +[DEFAULT] +support-files = + viewport_helpers.js + +[test_meta_viewport0.html] +[test_meta_viewport1.html] +[test_meta_viewport2.html] +[test_meta_viewport3.html] +[test_meta_viewport4.html] +[test_meta_viewport5.html] +[test_meta_viewport6.html] +[test_meta_viewport7.html] +[test_meta_viewport8.html] +[test_meta_viewport_auto_size_by_device_height.html] +[test_meta_viewport_auto_size_by_device_width.html] +[test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html] +[test_meta_viewport_auto_size_by_fixed_width_and_device_height.html] +[test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html] +[test_meta_viewport_auto_size_by_initial_scale_0_5.html] +[test_meta_viewport_auto_size_by_initial_scale_1.html] +[test_meta_viewport_auto_size_by_invalid_width.html] +[test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html] +[test_meta_viewport_change_content_among_multiple.html] +[test_meta_viewport_change_name.html] +[test_meta_viewport_change_name_among_multiple.html] +[test_meta_viewport_device_width.html] +[test_meta_viewport_device_width_with_initial_scale_0_5.html] +[test_meta_viewport_device_width_with_initial_scale_2.html] +[test_meta_viewport_fit.html] +[test_meta_viewport_fit_multiple.html] +[test_meta_viewport_fixed_width_and_zero_display_width.html] +[test_meta_viewport_initial_scale_0_5.html] +[test_meta_viewport_initial_scale_2.html] +[test_meta_viewport_insert_before_existing_tag.html] +[test_meta_viewport_maximum_scale_0.html] +[test_meta_viewport_maximum_scale_0_5.html] +[test_meta_viewport_maximum_scale_2.html] +[test_meta_viewport_multiple_tags.html] +[test_meta_viewport_negative_width_and_negative_height.html] +[test_meta_viewport_negative_width_and_no_height.html] +[test_meta_viewport_negative_width_and_valid_height.html] +[test_meta_viewport_valid_width_and_negative_height.html] +[test_meta_viewport_valid_width_and_no_height.html] +[test_meta_viewport_no_width_and_negative_height.html] +[test_meta_viewport_no_width_and_valid_height.html] +[test_meta_viewport_remove_node.html] +[test_meta_viewport_remove_node_from_multiple.html] +[test_meta_viewport_replace_content.html] +[test_meta_viewport_tiny_display_size.html] +[test_meta_viewport_initial_scale_with_trailing_characters.html] +[test_meta_viewport_width_with_trailing_characters.html] +[test_meta_viewport_empty_content_and_valid_content_tags.html] +[test_meta_viewport_no_content_and_valid_content_tags.html] +[test_meta_viewport_removing_content_attribute.html] diff --git a/dom/base/test/meta_viewport/moz.build b/dom/base/test/meta_viewport/moz.build new file mode 100644 index 0000000000..60b508c774 --- /dev/null +++ b/dom/base/test/meta_viewport/moz.build @@ -0,0 +1,9 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +MOCHITEST_MANIFESTS += [ + "mochitest.ini", +] diff --git a/dom/base/test/meta_viewport/test_meta_viewport0.html b/dom/base/test/meta_viewport/test_meta_viewport0.html new file mode 100644 index 0000000000..8fef72c578 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport0.html @@ -0,0 +1,41 @@ + + + + + meta viewport test + + + + + +

                    No <meta name="viewport"> tag

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport1.html b/dom/base/test/meta_viewport/test_meta_viewport1.html new file mode 100644 index 0000000000..66dd02461e --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport1.html @@ -0,0 +1,41 @@ + + + + + meta viewport test + + + + + + +

                    width=device-width, initial-scale=1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport2.html b/dom/base/test/meta_viewport/test_meta_viewport2.html new file mode 100644 index 0000000000..e0f45813be --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport2.html @@ -0,0 +1,41 @@ + + + + + meta viewport test + + + + + + +

                    width=device-width

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport3.html b/dom/base/test/meta_viewport/test_meta_viewport3.html new file mode 100644 index 0000000000..32464bd126 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport3.html @@ -0,0 +1,43 @@ + + + + + meta viewport test + + + + + + +

                    width=320

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport4.html b/dom/base/test/meta_viewport/test_meta_viewport4.html new file mode 100644 index 0000000000..bc7f7ada55 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport4.html @@ -0,0 +1,42 @@ + + + + + meta viewport test + + + + + + +

                    initial-scale=1.0, user-scalable=no

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport5.html b/dom/base/test/meta_viewport/test_meta_viewport5.html new file mode 100644 index 0000000000..938cc052ee --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport5.html @@ -0,0 +1,24 @@ + + + + + meta viewport test + + + + + + +

                    user-scalable=NO

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport6.html b/dom/base/test/meta_viewport/test_meta_viewport6.html new file mode 100644 index 0000000000..e3ca1b72aa --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport6.html @@ -0,0 +1,47 @@ + + + + + meta viewport test + + + + + + +

                    width=2000, minimum-scale=0.75

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport7.html b/dom/base/test/meta_viewport/test_meta_viewport7.html new file mode 100644 index 0000000000..1f40c27109 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport7.html @@ -0,0 +1,71 @@ + + + + + meta viewport test + + + + + + +

                    Dynamic viewport updates

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport8.html b/dom/base/test/meta_viewport/test_meta_viewport8.html new file mode 100644 index 0000000000..4c711c9cc6 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport8.html @@ -0,0 +1,27 @@ + + + + + meta viewport test + + + + + + +

                    minimum-scale=0.01

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_height.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_height.html new file mode 100644 index 0000000000..1b6c35a602 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_height.html @@ -0,0 +1,24 @@ + + + + + device-height enables autoSize + + + + + + +

                    height=device-height

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_width.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_width.html new file mode 100644 index 0000000000..fb91f2e50c --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_device_width.html @@ -0,0 +1,24 @@ + + + + + device-width enables autoSize + + + + + + +

                    width=device-width

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html new file mode 100644 index 0000000000..83346f4924 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html @@ -0,0 +1,25 @@ + + + + + initial-scale=1 with fixed height enable autoSize + + + + + + +

                    height=400, initial-scale=1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_device_height.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_device_height.html new file mode 100644 index 0000000000..e570f80644 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_device_height.html @@ -0,0 +1,25 @@ + + + + + Fixed width and device-height disables autoSize + + + + + + +

                    width=400, height=device-height

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html new file mode 100644 index 0000000000..4453b4c959 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html @@ -0,0 +1,25 @@ + + + + + initial-scale=1 with fixed width disables autoSize + + + + + + +

                    width=400, initial-scale=1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_0_5.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_0_5.html new file mode 100644 index 0000000000..ff12b22454 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_0_5.html @@ -0,0 +1,25 @@ + + + + + initial-scale!=1 without width disables autoSize + + + + + + +

                    initial-scale!=1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_1.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_1.html new file mode 100644 index 0000000000..e86742b8f2 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_initial_scale_1.html @@ -0,0 +1,25 @@ + + + + + initial-scale=1 without width enables autoSize + + + + + + +

                    initial-scale=1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width.html new file mode 100644 index 0000000000..6c950185bc --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width.html @@ -0,0 +1,24 @@ + + + + + invalid width enables autoSize + + + + + + +

                    width=-1

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html new file mode 100644 index 0000000000..db68ecb6ec --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html @@ -0,0 +1,25 @@ + + + + + invalid width but with fixed height disables autoSize + + + + + + +

                    width=-1,height=200

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_change_content_among_multiple.html b/dom/base/test/meta_viewport/test_meta_viewport_change_content_among_multiple.html new file mode 100644 index 0000000000..8ec88b8920 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_change_content_among_multiple.html @@ -0,0 +1,52 @@ + + + + + content attribute changes among multiple meta viewport tags + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_change_name.html b/dom/base/test/meta_viewport/test_meta_viewport_change_name.html new file mode 100644 index 0000000000..84b9c321df --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_change_name.html @@ -0,0 +1,47 @@ + + + + + name attribute changes + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_change_name_among_multiple.html b/dom/base/test/meta_viewport/test_meta_viewport_change_name_among_multiple.html new file mode 100644 index 0000000000..ca41577bbe --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_change_name_among_multiple.html @@ -0,0 +1,44 @@ + + + + + name attribute changes among multiple meta viewport tags + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_device_width.html b/dom/base/test/meta_viewport/test_meta_viewport_device_width.html new file mode 100644 index 0000000000..0e1f2f1dac --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_device_width.html @@ -0,0 +1,25 @@ + + + + + device-width in meta viewport + + + + + + +

                    width=device-width

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_0_5.html b/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_0_5.html new file mode 100644 index 0000000000..fc3192c854 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_0_5.html @@ -0,0 +1,26 @@ + + + + + device-width with initial-scale=0.5 in meta viewport + + + + + + +

                    width=device-width, initial-scale=0.5

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_2.html b/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_2.html new file mode 100644 index 0000000000..e701266e60 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_device_width_with_initial_scale_2.html @@ -0,0 +1,31 @@ + + + + + device-width with initial-scale=2 in meta viewport + + + + + + +

                    width=device-width, initial-scale=2

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_empty_content_and_valid_content_tags.html b/dom/base/test/meta_viewport/test_meta_viewport_empty_content_and_valid_content_tags.html new file mode 100644 index 0000000000..6de2e08c40 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_empty_content_and_valid_content_tags.html @@ -0,0 +1,26 @@ + + + + + a valid meta viewport tag and empty content attribute viewport tag + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_fit.html b/dom/base/test/meta_viewport/test_meta_viewport_fit.html new file mode 100644 index 0000000000..e86ad817d6 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_fit.html @@ -0,0 +1,34 @@ + + + + + meta viewport viewport-fit test + + + + + + +

                    viewport-fit=cover

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_fit_multiple.html b/dom/base/test/meta_viewport/test_meta_viewport_fit_multiple.html new file mode 100644 index 0000000000..e204bb70f6 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_fit_multiple.html @@ -0,0 +1,25 @@ + + + + + multiple meta viewport viewport-fit test + + + + + + + +

                    viewport-fit=cover

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_fixed_width_and_zero_display_width.html b/dom/base/test/meta_viewport/test_meta_viewport_fixed_width_and_zero_display_width.html new file mode 100644 index 0000000000..e649ad9fcd --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_fixed_width_and_zero_display_width.html @@ -0,0 +1,29 @@ + + + + + Fixed meta viewport width, zero display width + + + + + + +

                    Fixed meta viewport width, zero display width

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_0_5.html b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_0_5.html new file mode 100644 index 0000000000..99fb5c1d36 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_0_5.html @@ -0,0 +1,33 @@ + + + + + initial-scale=0.5 in meta viewport + + + + + + +

                    initial-scale=0.5

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_2.html b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_2.html new file mode 100644 index 0000000000..22f0adc061 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_2.html @@ -0,0 +1,26 @@ + + + + + initial-scale=2 in meta viewport + + + + + + +

                    initial-scale=2

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_with_trailing_characters.html b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_with_trailing_characters.html new file mode 100644 index 0000000000..5939691cb5 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_initial_scale_with_trailing_characters.html @@ -0,0 +1,26 @@ + + + + + initial-scale with trailing characters in meta viewport + + + + + + +

                    initial-scale=1.0/

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_insert_before_existing_tag.html b/dom/base/test/meta_viewport/test_meta_viewport_insert_before_existing_tag.html new file mode 100644 index 0000000000..e2162c81f8 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_insert_before_existing_tag.html @@ -0,0 +1,32 @@ + + + + + interting a meta viewport tag before existing one + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0.html b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0.html new file mode 100644 index 0000000000..893f3128d9 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0.html @@ -0,0 +1,28 @@ + + + + + meta viewport test + + + + + + +

                    width=device-width, minimum-scale=1, maximum-scale=0

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0_5.html b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0_5.html new file mode 100644 index 0000000000..7f17ef146e --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_0_5.html @@ -0,0 +1,29 @@ + + + + + maximum-scale=0.5 in meta viewport + + + + + + +

                    maximum-scale=0.5

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_2.html b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_2.html new file mode 100644 index 0000000000..2fe3baf27d --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_maximum_scale_2.html @@ -0,0 +1,26 @@ + + + + + maximum-scale=2 in meta viewport + + + + + + +

                    maximum-scale=2

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_multiple_tags.html b/dom/base/test/meta_viewport/test_meta_viewport_multiple_tags.html new file mode 100644 index 0000000000..816dd62061 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_multiple_tags.html @@ -0,0 +1,28 @@ + + + + + multilple meta viewport tags + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_negative_height.html b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_negative_height.html new file mode 100644 index 0000000000..e458cbc8dd --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_negative_height.html @@ -0,0 +1,27 @@ + + + + + negative width and height in meta viewport + + + + + + +

                    width=-400, height=-240

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_no_height.html b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_no_height.html new file mode 100644 index 0000000000..2369f3b4f3 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_no_height.html @@ -0,0 +1,25 @@ + + + + + negative width in meta viewport + + + + + + +

                    width=-400

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_valid_height.html b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_valid_height.html new file mode 100644 index 0000000000..579712504d --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_negative_width_and_valid_height.html @@ -0,0 +1,25 @@ + + + + + negative width and valid height in meta viewport + + + + + + +

                    width=-400, height=240

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_no_content_and_valid_content_tags.html b/dom/base/test/meta_viewport/test_meta_viewport_no_content_and_valid_content_tags.html new file mode 100644 index 0000000000..f5a78d9eec --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_no_content_and_valid_content_tags.html @@ -0,0 +1,25 @@ + + + + + a valid meta viewport tag and no content attribute viewport tag + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_negative_height.html b/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_negative_height.html new file mode 100644 index 0000000000..0e0d37812b --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_negative_height.html @@ -0,0 +1,26 @@ + + + + + negative height in meta viewport + + + + + + +

                    height=-200

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_valid_height.html b/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_valid_height.html new file mode 100644 index 0000000000..a7be88ec40 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_no_width_and_valid_height.html @@ -0,0 +1,25 @@ + + + + + valid height in meta viewport + + + + + + +

                    height=240

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_remove_node.html b/dom/base/test/meta_viewport/test_meta_viewport_remove_node.html new file mode 100644 index 0000000000..12104cdf50 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_remove_node.html @@ -0,0 +1,34 @@ + + + + + remove meta viewport node + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_remove_node_from_multiple.html b/dom/base/test/meta_viewport/test_meta_viewport_remove_node_from_multiple.html new file mode 100644 index 0000000000..b967967cc1 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_remove_node_from_multiple.html @@ -0,0 +1,44 @@ + + + + + remove a meta viewport node from multiple ones + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_removing_content_attribute.html b/dom/base/test/meta_viewport/test_meta_viewport_removing_content_attribute.html new file mode 100644 index 0000000000..784a503e9f --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_removing_content_attribute.html @@ -0,0 +1,33 @@ + + + + + removing content attribute + + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_replace_content.html b/dom/base/test/meta_viewport/test_meta_viewport_replace_content.html new file mode 100644 index 0000000000..202c62362b --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_replace_content.html @@ -0,0 +1,39 @@ + + + + + replace meta viewport content + + + + + + + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_tiny_display_size.html b/dom/base/test/meta_viewport/test_meta_viewport_tiny_display_size.html new file mode 100644 index 0000000000..8e47fc677a --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_tiny_display_size.html @@ -0,0 +1,28 @@ + + + + + meta viewport test + + + + + + +

                    width=device-width

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_negative_height.html b/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_negative_height.html new file mode 100644 index 0000000000..10bce57d87 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_negative_height.html @@ -0,0 +1,26 @@ + + + + + valid width and negative height in meta viewport + + + + + + +

                    width=400, height=-200

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_no_height.html b/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_no_height.html new file mode 100644 index 0000000000..b24ce680a7 --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_valid_width_and_no_height.html @@ -0,0 +1,26 @@ + + + + + valid width in meta viewport + + + + + + +

                    width=400

                    + + + diff --git a/dom/base/test/meta_viewport/test_meta_viewport_width_with_trailing_characters.html b/dom/base/test/meta_viewport/test_meta_viewport_width_with_trailing_characters.html new file mode 100644 index 0000000000..f3545d057b --- /dev/null +++ b/dom/base/test/meta_viewport/test_meta_viewport_width_with_trailing_characters.html @@ -0,0 +1,26 @@ + + + + + width with trailing characters in meta viewport + + + + + + +

                    width=400/

                    + + + diff --git a/dom/base/test/meta_viewport/viewport_helpers.js b/dom/base/test/meta_viewport/viewport_helpers.js new file mode 100644 index 0000000000..d4d346b5d0 --- /dev/null +++ b/dom/base/test/meta_viewport/viewport_helpers.js @@ -0,0 +1,44 @@ +function scaleRatio(scale) { + return { + set: [ + ["layout.css.devPixelsPerPx", "" + scale], + ["dom.meta-viewport.enabled", true], + ], + }; +} + +function getViewportInfo(aDisplayWidth, aDisplayHeight) { + let defaultZoom = {}, + allowZoom = {}, + minZoom = {}, + maxZoom = {}, + width = {}, + height = {}, + autoSize = {}; + + let cwu = SpecialPowers.getDOMWindowUtils(window); + cwu.getViewportInfo( + aDisplayWidth, + aDisplayHeight, + defaultZoom, + allowZoom, + minZoom, + maxZoom, + width, + height, + autoSize + ); + return { + defaultZoom: defaultZoom.value, + minZoom: minZoom.value, + maxZoom: maxZoom.value, + width: width.value, + height: height.value, + autoSize: autoSize.value, + allowZoom: allowZoom.value, + }; +} + +function fuzzeq(a, b, msg) { + ok(Math.abs(a - b) < 1e-6, msg); +} diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini new file mode 100644 index 0000000000..c04ccc7ac6 --- /dev/null +++ b/dom/base/test/mochitest.ini @@ -0,0 +1,1111 @@ +[DEFAULT] +tags = condprof +prefs = + formhelper.autozoom.force-disable.test-only=true +support-files = + audio.ogg + iframe_bug962251.html + iframe_bug976673.html + iframe_main_bug1022229.html + iframe_sandbox_bug1022229.html + file_empty.html + iframe_postMessage_solidus.html + file_setname.html + 345339_iframe.html + Ahem.ttf + accesscontrol.resource + accesscontrol.resource^headers^ + badContentType.eventsource + badContentType.eventsource^headers^ + badHTTPResponseCode.eventsource + badHTTPResponseCode.eventsource^headers^ + badMessageEvent.eventsource + badMessageEvent.eventsource^headers^ + badMessageEvent2.eventsource + badMessageEvent2.eventsource^headers^ + bug282547.sjs + bug298064-subframe.html + bug313646.txt + bug382113_object.html + bug403852_fileOpener.js + bug419132.html + bug426308-redirect.sjs + bug435425.sjs + bug435425_redirect.sjs + bug444322.js + bug444322.txt + bug455629-helper.svg + bug457746.sjs + bug461735-post-redirect.js + bug461735-redirect1.sjs + bug461735-redirect2.sjs + bug466080.sjs + bug466409-empty.css + bug466409-page.html + bug475156.sjs + bug482935.sjs + bug540854.sjs + bug578096LoadChromeScript.js + bug638112-response.txt + bug638112.sjs + bug696301-script-1.js + bug696301-script-1.js^headers^ + bug696301-script-2.js + bug704320.sjs + bug704320_counter.sjs + bug819051.sjs + bug1576154.sjs + chrome/bug418986-1.js + copypaste.js + delayedServerEvents.sjs + eventsource_message.sjs + eventsource_reconnect.sjs + eventsource.resource + eventsource.resource^headers^ + eventsource_redirect.resource + eventsource_redirect.resource^headers^ + eventsource_redirect_to.resource + eventsource_redirect_to.resource^headers^ + eventsource_worker.js + file_bug1091883_frame.html + file_bug1091883_subframe.html + file_bug1091883_target.html + file_bug28293.sjs + file_bug326337.xml + file_bug326337_inner.html + file_bug326337_outer.html + file_bug416317.xhtml + file_bug426646-1.html + file_bug426646-2.html + file_bug428847-1.xhtml + file_bug428847-2.xhtml + file_bug498897.css + file_bug498897.html + file_bug498897.html^headers^ + file_bug503481.sjs + file_bug503481b_inner.html + file_bug541937.html + file_bug541937.xhtml + file_bug557892.html + file_bug562137.txt + file_bug590812-ref.xhtml + file_bug590812.xml + file_bug590870.html + file_bug601803a.html + file_bug601803b.html + file_bug604660-1.xml + file_bug604660-2.xsl + file_bug604660-3.js + file_bug604660-4.js + file_bug604660-5.xml + file_bug604660-6.xsl + file_bug622088.sjs + file_bug622088_inner.html + file_bug675121.sjs + file_bug687859-16.js + file_bug687859-16.js^headers^ + file_bug687859-bom.js + file_bug687859-bom.js^headers^ + file_bug687859-charset.js + file_bug687859-http.js + file_bug687859-http.js^headers^ + file_bug687859-inherit.js + file_bug692434.xml + file_bug704320_preload_attr.html + file_bug704320_preload_common.js + file_bug704320_preload_reuse.html + file_bug704320_redirect.html + file_bug707142_baseline.json + file_bug707142_bom.json + file_bug707142_utf-16.json + file_bug708620-2.html + file_bug708620.html + file_bug753278.html + file_bug769117.html + file_bug782342.txt + file_bug787778.sjs + file_bug869432.eventsource + file_bug869432.eventsource^headers^ + file_bug907892.html + file_bug945152.jar + file_bug1274806.html + file_current_inner_window.html + file_domwindowutils_animation.html + file_domwindowutils_dynamic_toolbar.html + file_focus_shadow_dom.html + file_general_document.html + file_history_document_open.html + file_htmlserializer_1.html + file_htmlserializer_1_bodyonly.html + file_htmlserializer_1_format.html + file_htmlserializer_1_linebreak.html + file_htmlserializer_1_links.html + file_htmlserializer_1_nested_body.html + file_htmlserializer_1_no_body.html + file_htmlserializer_1_noflag.html + file_htmlserializer_1_noformatpre.html + file_htmlserializer_1_raw.html + file_htmlserializer_1_sibling_body.html + file_htmlserializer_1_sibling_body_only_body.html + file_htmlserializer_1_wrap.html + file_htmlserializer_2.html + file_htmlserializer_2_basic.html + file_htmlserializer_ipv6.html + file_htmlserializer_ipv6_out.html + file_lock_orientation_with_pending_fullscreen.html + file_mozfiledataurl_img.jpg + file_restrictedEventSource.sjs + file_settimeout_inner.html + file_timer_flood.html + file_viewport_scroll_quirks.html + file_viewport_scroll_xml.xml + file_window_close.html + file_window_close_2.html + file_x-frame-options_main.html + file_x-frame-options_page.sjs + file_xhtmlserializer_1.xhtml + file_xhtmlserializer_1_bodyonly.xhtml + file_xhtmlserializer_1_format.xhtml + file_xhtmlserializer_1_linebreak.xhtml + file_xhtmlserializer_1_links.xhtml + file_xhtmlserializer_1_nested_body.xhtml + file_xhtmlserializer_1_no_body.xhtml + file_xhtmlserializer_1_noflag.xhtml + file_xhtmlserializer_1_noformatpre.xhtml + file_xhtmlserializer_1_raw.xhtml + file_xhtmlserializer_1_sibling_body.xhtml + file_xhtmlserializer_1_sibling_body_only_body.xhtml + file_xhtmlserializer_1_wrap.xhtml + file_xhtmlserializer_2.xhtml + file_xhtmlserializer_2_basic.xhtml + file_xhtmlserializer_2_enthtml.xhtml + file_xhtmlserializer_2_entw3c.xhtml + file_xhtmlserializer_2_latin1.xhtml + file_youtube_flash_embed.html + forRemoval.resource + forRemoval.resource^headers^ + formReset.html + invalid_accesscontrol.resource + invalid_accesscontrol.resource^headers^ + script-1_bug597345.sjs + script-2_bug597345.js + script_bug602838.sjs + send_gzip_content.sjs + somedatas.resource + somedatas.resource^headers^ + variable_style_sheet.sjs + w3element_traversal.svg + wholeTexty-helper.xml + referrerHelper.js + file_audioLoop.html + file_webaudio_startstop.html + referrer_helper.js + referrer_testserver.sjs + script_postmessages_fileList.js + common_postMessages.js + iframe_postMessages.html + worker_postMessages.js + test_anonymousContent_style_csp.html^headers^ + file_explicit_user_agent.sjs + referrer_change_server.sjs + file_change_policy_redirect.html + file_bug1198095.js + file_bug1250148.sjs + file_bug1268962.sjs + iframe_meta_refresh.sjs + !/dom/security/test/cors/file_CrossSiteXHR_server.sjs + !/image/test/mochitest/blue.png + script_bug1238440.js + intersectionobserver_iframe.html + intersectionobserver_cross_domain_iframe.html + intersectionobserver_window.html + object_bug353334.html + embed_bug455472.html + object_bug455472.html + iframe1_bug431701.html + iframe2_bug431701.html + iframe3_bug431701.html + iframe4_bug431701.xml + iframe5_bug431701.xml + iframe6_bug431701.xml + iframe7_bug431701.xml + iframe1_bug426646.html + iframe2_bug426646.html + iframe_shared_compartment2a.html + iframe_shared_compartment2b.html + file1_setting_opener.html + file2_setting_opener.html + file3_setting_opener.html + file4_setting_opener.html + PASS.html + FAIL.html + !/dom/animation/test/testcommon.js + !/dom/events/test/event_leak_utils.js + ../../../toolkit/components/pdfjs/test/file_pdfjs_test.pdf + green.png + slow.sjs + +[test_anchor_area_referrer.html] +skip-if = + http3 +[test_anchor_area_referrer_changing.html] +skip-if = + http3 +[test_anchor_area_referrer_invalid.html] +skip-if = + http3 +[test_anchor_area_referrer_rel.html] +skip-if = + http3 +[test_anonymousContent_api.html] +[test_anonymousContent_append_after_reflow.html] +[test_anonymousContent_canvas.html] +skip-if = headless # Bug 1405867 +[test_anonymousContent_insert.html] +[test_anonymousContent_manipulate_content.html] +[test_anonymousContent_set_style.html] +[test_anonymousContent_style_csp.html] +[test_appname_override.html] +[test_async_setTimeout_stack.html] +[test_async_setTimeout_stack_across_globals.html] +[test_base.xhtml] +skip-if = + http3 +[test_bug1433073.html] +skip-if = (os == "android" || headless) # See +[test_bug1730284.html] +# https://bugzilla.mozilla.org/show_bug.cgi?id=1632196 and +# https://bugzilla.mozilla.org/show_bug.cgi?id=1632438. +[test_bug1739957.html] +support-files = + bug1739957.sjs +[test_bug1784187.html] +[test_bug1799354.html] +[test_bug5141.html] +[test_bug28293.html] +[test_bug28293.xhtml] +[test_bug51034.html] +[test_bug116083.html] +skip-if = headless # fails in clipboard mode +[test_bug166235.html] +skip-if = headless # headless != clipboard +[test_bug1639328.html] +support-files = file_bug1639328.html +[test_bug199959.html] +[test_bug218236.html] +[test_bug218277.html] +[test_bug238409.html] +[test_bug254337.html] +[test_bug270145.xhtml] +[test_bug276037-1.html] +[test_bug276037-2.xhtml] +[test_bug282547.html] +[test_bug298064.html] +[test_bug300992.html] +[test_bug311681.xml] +[test_bug313646.html] +[test_bug320799.html] +[test_bug322317.html] +[test_bug326337.html] +skip-if = + http3 +[test_bug331959.html] +[test_bug333064.html] +skip-if = headless # Headless: Bug 1405868 +[test_bug333198.html] +[test_bug333673.html] +[test_bug337631.html] +[test_bug338541.xhtml] +[test_bug338583.html] +skip-if = + http3 +[test_bug338679.html] +[test_bug339494.html] +[test_bug339494.xhtml] +[test_bug343596.html] +[test_bug345339.html] +skip-if = + http3 +[test_bug346485.html] +[test_bug352728.html] +[test_bug352728.xhtml] +[test_bug353334.html] +[test_bug355026.html] +[test_bug357450.html] +support-files = file_bug357450.js +[test_bug357450.xhtml] +[test_bug357450_svg.xhtml] +[test_bug357509.html] +[test_bug358660.html] +[test_bug362391.xhtml] +[test_bug364092.xhtml] +[test_bug364413.xhtml] +[test_bug366944.html] +[test_bug366946.html] +[test_bug367164.html] +[test_bug368972.html] +[test_bug371576-2.html] +[test_bug371576-3.html] +[test_bug371576-4.html] +[test_bug371576-5.html] +[test_bug372086.html] +[test_bug372964-2.html] +[test_bug372964.html] +[test_bug373181.xhtml] +[test_bug375314.html] +[test_bug375314-2.html] +skip-if = + xorigin # Hangs, [Exception... "Component returned failure code: 0xc1f30100 (NS_ERROR_FACTORY_EXISTS) [nsIComponentRegistrar.registerFactory]" nsresult: "0xc1f30100 (NS_ERROR_FACTORY_EXISTS)" location: "JS frame :: createChromeScript :: createChromeScript :: line 40" data: no] + http3 +[test_bug378969.html] +[test_bug380418.html] +support-files = test_bug380418.html^headers^ +[test_bug382113.html] +[test_bug382871.html] +[test_bug384003.xhtml] +[test_bug390219.html] +[test_bug390735.html] +[test_bug392318.html] +[test_bug392511.html] +[test_bug393968.html] +[test_bug395915.html] +[test_bug397234.html] +[test_bug398243.html] +skip-if = + http3 +[test_bug401662.html] +[test_bug402150.html] +support-files = test_bug402150.html^headers^ +[test_bug403841.html] +[test_bug403852.html] +[test_bug403868.xml] +[test_bug405182.html] +[test_bug409380.html] +[test_bug410229.html] +[test_bug413974.html] +[test_bug414190.html] +[test_bug415860.html] +[test_bug416317-1.html] +[test_bug416317-2.html] +[test_bug416383.html] +[test_bug417255.html] +[test_bug417384.html] +[test_bug418214.html] +[test_bug418986-1.html] +[test_bug419132.html] +[test_bug420609.xhtml] +[test_bug420700.html] +[test_bug421602.html] +[test_bug422403-1.html] +skip-if = + http3 +[test_bug422403-2.xhtml] +[test_bug422537.html] +skip-if = + http3 +[test_bug424212.html] +[test_bug424359-1.html] +skip-if = + http3 +[test_bug424359-2.html] +[test_bug426308.html] +skip-if = + http3 +[test_bug426646.html] +skip-if = + http3 +[test_bug428847.html] +skip-if = + http3 +[test_bug431082.html] +[test_bug431701.html] +[test_bug431833.html] +[test_bug433533.html] +[test_bug433662.html] +[test_bug435425.html] +skip-if = + http3 +[test_bug444322.html] +[test_bug444546.html] +disabled = Disabled for now. Mochitest is not reliable enough for these. +support-files = bug444546.sjs +[test_bug444722.html] +[test_bug448993.html] +[test_bug450160.html] +[test_bug451376.html] +[test_bug453521.html] +[test_bug453736.html] +[test_bug454325.html] +[test_bug454326.html] +[test_bug455472.html] +[test_bug455629.html] +skip-if = + http3 +[test_bug456262.html] +[test_bug457746.html] +[test_bug459424.html] +[test_bug461555.html] +[test_bug461735.html] +skip-if = + http3 +[test_bug465767.html] +[test_bug466080.html] +skip-if = + http3 +[test_bug466409.html] +[test_bug466751.xhtml] +[test_bug469020.html] +[test_bug469304.html] +[test_bug473162-1.html] +[test_bug473162-2.html] +[test_bug475156.html] +skip-if = + http3 +[test_bug482935.html] +[test_bug484396.html] +[test_bug493881.html] +support-files = test_bug493881.js +[test_bug498240.html] +[test_bug498433.html] +[test_bug498897.html] +[test_bug499656.html] +[test_bug499656.xhtml] +[test_bug500937.html] +[test_bug503473.html] +disabled = Disabled due to making the harness time out +support-files = file_bug503473-frame.sjs +[test_bug503481.html] +[test_bug503481b.html] +[test_bug513194.html] +[test_bug514487.html] +[test_bug515401.html] +skip-if = + http3 +[test_bug518104.html] +support-files = file_bug518104.js +[test_bug527896.html] +[test_bug540854.html] +[test_bug541937.html] +[test_bug544642.html] +[test_bug545644.html] +[test_bug545644.xhtml] +[test_bug548463.html] +[test_bug553896.xhtml] +[test_bug557892.html] +[test_bug558726.html] +[test_bug559526.html] +[test_bug560780.html] +[test_bug562137.html] +[test_bug562169-1.html] +[test_bug562169-2.html] +[test_bug562652.html] +[test_bug564047.html] +[test_bug564863.xhtml] +[test_bug567350.html] +[test_bug574596.html] +skip-if = toolkit == 'android' +[test_bug578096.html] +skip-if = (verify && (os == 'win')) +[test_bug585978.html] +[test_bug587931.html] +[test_bug588990.html] +[test_bug590812.html] +skip-if = + (verify && !debug && (os == 'linux')) #bug 687032 + http3 +[test_bug590870.html] +skip-if = + http3 +[test_bug592366.html] +[test_bug592829.html] +[test_bug597345.html] +[test_bug599295.html] +skip-if = + http3 +[test_bug599588.html] +[test_bug601803.html] +skip-if = + http3 +[test_bug602838.html] +[test_bug604592.html] +[test_bug604660.html] +[test_bug605982.html] +[test_bug606729.html] +[test_bug614058.html] +[test_bug622088.html] +[test_bug622117.html] +support-files = !/gfx/layers/apz/test/mochitest/apz_test_utils.js +[test_bug622246.html] +support-files = !/gfx/layers/apz/test/mochitest/apz_test_utils.js +[test_bug625722.html] +[test_bug626262.html] +[test_bug628938.html] +[test_bug631615.html] +[test_bug638112.html] +skip-if = + http3 +[test_bug647518.html] +[test_bug650001.html] +[test_bug650776.html] +[test_bug650784.html] +[test_bug656283.html] +[test_bug664916.html] +[test_bug666604.html] +[test_bug675121.html] +[test_bug675166.html] +[test_bug682463.html] +[test_bug682554.html] +[test_bug682592.html] +[test_bug684671.html] +[test_bug685798.html] +[test_bug686449.xhtml] +[test_bug687859.html] +[test_bug690056.html] +[test_bug692434.html] +[test_bug693615.html] +[test_bug693875.html] +[test_bug694754.xhtml] +[test_bug696301-1.html] +skip-if = + http3 +[test_bug696301-2.html] +skip-if = + http3 +[test_bug698381.html] +[test_bug698384.html] +[test_bug704063.html] +[test_bug704320-1.html] +skip-if = + http3 +[test_bug704320-2.html] +skip-if = + http3 +[test_bug704320_policyset.html] +skip-if = + http3 +[test_bug704320_policyset2.html] +[test_bug704320_preload.html] +skip-if = + http3 +[test_bug707142.html] +[test_bug708620.html] +[test_bug711047.html] +[test_bug711180.html] +[test_bug719533.html] +[test_bug726364.html] +[test_bug737087.html] +[test_bug737565.html] +[test_bug737612.html] +[test_bug738108.html] +[test_bug744830.html] +[test_bug749367.html] +[test_bug750096.html] +[test_bug753278.html] +[test_bug761120.html] +[test_bug769117.html] +skip-if = + fission && os == "android" # Bug 1827725 +[test_bug782342.html] +[test_bug787778.html] +[test_bug789315.html] +[test_bug789856.html] +[test_bug809003.html] +[test_bug810494.html] +[test_bug811701.html] +[test_bug811701.xhtml] +[test_bug813919.html] +[test_bug814576.html] +[test_bug819051.html] +skip-if = + http3 +[test_bug820909.html] +[test_bug864595.html] +[test_bug868999.html] +[test_bug869000.html] +[test_bug869002.html] +[test_bug869006.html] +[test_bug876282.html] +[test_bug891952.html] +[test_bug894874.html] +[test_bug895974.html] +[test_bug907892.html] +skip-if = + http3 +[test_bug913761.html] +[test_bug922681.html] +[test_bug927196.html] +[test_bug962251.html] +[test_bug976673.html] +skip-if = + http3 +[test_bug982153.html] +[test_bug999456.html] +[test_bug1022229.html] +skip-if = + http3 +[test_bug1025933.html] +[test_bug1037687.html] +support-files = test_bug1037687_subframe.html +[test_bug1043106.html] +[test_bug1057176.html] +[test_bug1060938.html] +[test_bug1064481.html] +[test_bug1070015.html] +[test_bug1075702.html] +[test_bug1091883.html] +skip-if = + http3 +[test_bug1100912.html] +support-files = file_bug1100912.html +[test_bug1101364.html] +[test_bug1118689.html] +[test_bug1126851.html] +[test_bug1163743.html] +skip-if = + http3 +[test_bug1165501.html] +skip-if = + http3 +[test_bug1187157.html] +[test_bug1198095.html] +[test_bug1238440.html] +[test_bug1250148.html] +[test_bug1259588.html] +[test_bug1268962.html] +skip-if = + http3 +[test_bug1222633.html] +skip-if = + http3 +[test_bug1667316.html] +[test_bug1222633_link_update.html] +skip-if = + http3 +[test_bug1274806.html] +[test_bug1281963.html] +[test_bug1295852.html] +[test_bug1307730.html] +[test_bug1308069.html] +[test_bug1314032.html] +[test_bug1318303.html] +[test_bug1375050.html] +[test_bug1381710.html] +[test_bug1399605.html] +[test_bug1404385.html] +[test_bug1406102.html] +[test_bug1421568.html] +[test_bug1472427.html] +[test_bug1499169.html] +skip-if = toolkit == 'android' # Timeouts on android due to page closing issues with embedded pdf +[test_bug1576154.html] +[test_bug1632975.html] +[test_bug1640766.html] +support-files = + iframe1_bug1640766.html + iframe2_bug1640766.html +skip-if = + http3 +[test_bug1648887.html] +[test_caretPositionFromPoint.html] +[test_change_policy.html] +skip-if = + http3 +[test_clearTimeoutIntervalNoArg.html] +[test_clipboard_nbsp.html] +[test_constructor-assignment.html] +[test_constructor.html] +[test_content_iterator_post_order.html] +[test_content_iterator_pre_order.html] +[test_content_iterator_subtree.html] +[test_copyimage.html] +skip-if = toolkit == 'android' + headless #bug 904183 +[test_copypaste.html] +skip-if = toolkit == 'android' + headless #bug 904183 +[test_copypaste.xhtml] +skip-if = headless #bug 904183 +[test_copypaste_disabled.html] +support-files = !/gfx/layers/apz/test/mochitest/apz_test_utils.js +[test_createHTMLDocument.html] +[test_data_uri.html] +[test_document.all_iteration.html] +[test_document.all_unqualified.html] +[test_document_constructor.html] +[test_document_importNode_document.html] +[test_custom_element.html] +[test_custom_element_reflector.html] +[test_current_inner_window.html] +skip-if = + http3 +[test_document_wireframe.html] +skip-if = + !sessionHistoryInParent + http3 +[test_domparser_null_char.html] +[test_domparsing.html] +[test_domrequest.html] +[test_domwindowutils.html] +skip-if = toolkit == 'android' # Bug 1525959 +[test_element.matches.html] +[test_element_closest.html] +[test_elementTraversal.html] +[test_embed_xorigin_document.html] +skip-if = + http3 +[test_encodeToStringWithMaxLength.html] +[test_encodeToStringWithRequiresReinitAfterOutput.html] +[test_EventSource_redirects.html] +skip-if = + http3 +[test_eventsource_event_listener_leaks.html] +[test_eventsourceservice_basic.html] +skip-if = + http3 +[test_eventsourceservice_reconnect_error.html] +skip-if = + http3 +[test_eventsourceservice_status_error.html] +[test_eventsourceservice_worker.html] +skip-if = + http3 +[test_explicit_user_agent.html] +[test_find.html] +[test_find_nac.html] +[test_find_bug1601118.html] +[test_find_bug1654683.html] +[test_focus_keyboard_event.html] +skip-if = + http3 +[test_focus_shadow_dom_root.html] +[test_focus_shadow_dom.html] +[test_focus_scrollable_input.html] +[test_focus_scrollable_fieldset.html] +[test_focus_scroll_padding_tab.html] +[test_focus_design_mode.html] +support-files = + file_focus_design_mode_inner.html +[test_focus_display_none_xorigin_iframe.html] +support-files = + file_focus_display_none_xorigin_iframe_inner.html +skip-if = + http3 +[test_getAttribute_after_createAttribute.html] +[test_getElementById.html] +[test_getTranslationNodes.html] +[test_getTranslationNodes_limit.html] +[test_gsp-qualified.html] +[test_gsp-quirks.html] +[test_gsp-standards.html] +[test_history_document_open.html] +[test_history_state_null.html] +[test_html_colors_quirks.html] +[test_html_colors_standards.html] +[test_htmlcopyencoder.html] +[test_htmlcopyencoder.xhtml] +[test_iframe_event_listener_leaks.html] +skip-if = (processor == 'aarch64' && os == 'win') # aarch64 due to 1530895 +[test_iframe_referrer.html] +skip-if = + http3 +[test_iframe_referrer_changing.html] +skip-if = + http3 +[test_iframe_referrer_invalid.html] +skip-if = + http3 +[test_Image_constructor.html] +[test_innersize_scrollport.html] +[test_input_vsync_alignment_lower_than_normal.html] +[test_input_vsync_alignment_input_while_vsync.html] +[test_input_vsync_alignment_inner_event_loop.html] +[test_integer_attr_with_leading_zero.html] +[test_intersectionobservers.html] +skip-if = + http3 +[test_link_prefetch.html] +skip-if = + http3 +[test_link_preload.html] +skip-if = + http3 +[test_link_stylesheet.html] +skip-if = + http3 +[test_location_href_unknown_protocol.html] +support-files = file_location_href_unknown_protocol.html +[test_lock_orientation_after_fullscreen.html] +skip-if = toolkit != 'android' # Only run on Android. +[test_lock_orientation_with_pending_fullscreen.html] +skip-if = os == 'mac' || os == 'linux' || headless +[test_meta_refresh_referrer.html] +skip-if = + http3 +[test_mozMatchesSelector.html] +[test_mutationobservers.html] +[test_named_frames.html] +[test_navigator_cookieEnabled.html] +[test_navigator_hardwareConcurrency.html] +[test_navigator_language.html] +[test_navigatorPrefOverride.html] +[test_NodeIterator_basics_filters.xhtml] +skip-if = xorigin # JavaScript error: http://mochi.test:8888/tests/SimpleTest/SimpleTest.js, line 76: DataCloneError: The object could not be cloned. +[test_NodeIterator_mutations_1.xhtml] +[test_NodeIterator_mutations_2.html] +[test_NodeIterator_mutations_3.html] +[test_nested_event_loop_spin_and_idle_tasks.html] +[test_nodelist_holes.html] +[test_open_null_features.html] +[test_openDialogChromeOnly.html] +tags = openwindow +[test_pasting_svg_image.html] +skip-if = headless # Bug 1669923. +[test_pdf_print.html] +skip-if = toolkit == 'android' # We don't ship pdf.js on Android +[test_plugin_freezing.html] +skip-if = (os == 'win' && processor == 'aarch64') +reason = Plugins are not supported on Windows/AArch64 +[test_postMessage_solidus.html] +skip-if = + http3 +[test_postMessages_window.html] +skip-if = + http3 +[test_postMessages_workers.html] +[test_postMessages_broadcastChannel.html] +[test_postMessages_messagePort.html] +[test_postMessage_originAttributes.html] +support-files = file_receiveMessage.html +skip-if = true # Uses mismatched OriginAttributes for iframe (bug 1616353) +[test_processing_instruction_update_stylesheet.xhtml] +[test_progress_events_for_gzip_data.html] +skip-if = tsan # Bug 1621323 +[test_pushState_structuredclone.html] +scheme = https +[test_range_bounds.html] +[test_reentrant_flush.html] +[test_root_iframe.html] +[test_sandbox_and_document_uri.html] +support-files = file_sandbox_and_document_uri.html +[test_screen_orientation.html] +[test_script_loader_crossorigin_data_url.html] +[test_script_loader_js_cache.html] +skip-if = verify +support-files = + file_js_cache.html + file_js_cache_with_sri.html + file_js_cache_module.html + file_js_cache.js + file_module_js_cache.html + file_module_js_cache_with_sri.html + file_module_js_cache_no_module.html + file_module_js_cache.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 +[test_script_loader_js_cache_module.html] +skip-if = verify +support-files = + file_script_module_single.html + file_script_module_single.js + file_script_module_import.html + file_script_module_import.js + file_script_module_import_imported.js + file_script_module_import_multi.html + file_script_module_import_multi.js + file_script_module_import_multi_imported_once.js + file_script_module_import_multi_imported_twice.js + file_script_module_import_multi_elems.html + file_script_module_import_multi_elems_1.js + file_script_module_import_multi_elems_2.js + file_script_module_import_multi_elems_imported_once_1.js + file_script_module_import_multi_elems_imported_once_2.js + file_script_module_import_multi_elems_imported_once_3.js + file_script_module_import_multi_elems_imported_twice.js + file_script_module_import_and_element.html + file_script_module_import_and_element.js + file_script_module_import_and_element_imported_1.js + file_script_module_import_and_element_imported_2.js + file_script_module_import_and_element_imported_3.js + file_script_module_element_and_import.html + file_script_module_element_and_import.js + file_script_module_element_and_import_imported_1.js + file_script_module_element_and_import_imported_2.js + file_script_module_element_and_import_imported_3.js + file_script_module_dynamic_import.html + file_script_module_dynamic_import.js + file_script_module_dynamic_import_imported.js + file_script_module_dynamic_and_element.html + file_script_module_dynamic_and_element.js + file_script_module_dynamic_and_element_imported_1.js + file_script_module_dynamic_and_element_imported_2.js + file_script_module_dynamic_and_element_imported_3.js + file_script_module_element_and_dynamic.html + file_script_module_element_and_dynamic.js + file_script_module_element_and_dynamic_imported_1.js + file_script_module_element_and_dynamic_imported_2.js + file_script_module_element_and_dynamic_imported_3.js + file_script_module_dynamic_and_static.html + file_script_module_dynamic_and_static.js + file_script_module_dynamic_and_static_imported_1.js + file_script_module_dynamic_and_static_imported_2.js + file_script_module_dynamic_and_static_imported_3.js + file_script_module_static_and_dynamic.html + file_script_module_static_and_dynamic.js + file_script_module_static_and_dynamic_imported_1.js + file_script_module_static_and_dynamic_imported_2.js + file_script_module_static_and_dynamic_imported_3.js +[test_script_loader_js_cache_module_sri.html] +skip-if = verify +support-files = + file_script_module_sri_basic.html + file_script_module_sri_basic_prep.html + file_script_module_sri_basic.js + file_script_module_sri_fallback.html + file_script_module_sri_fallback_prep.html + file_script_module_sri_fallback.js + file_script_module_sri_fallback_failure.html + file_script_module_sri_fallback_failure_prep.html + file_script_module_sri_fallback_failure.js + file_script_module_sri_elem_elem_1.html + file_script_module_sri_elem_elem_1_prep.html + file_script_module_sri_elem_elem_1.js + file_script_module_sri_elem_elem_2.html + file_script_module_sri_elem_elem_2_prep.html + file_script_module_sri_elem_elem_2.js + file_script_module_sri_elem_import.html + file_script_module_sri_elem_import_prep.html + file_script_module_sri_elem_import.js + file_script_module_sri_elem_import_imported.js + file_script_module_sri_import_elem.html + file_script_module_sri_import_elem_prep.html + file_script_module_sri_import_elem.js + file_script_module_sri_import_elem_imported.js + file_script_module_sri_import_elem_nopreload.html + file_script_module_sri_import_elem_nopreload_prep.html + file_script_module_sri_import_elem_nopreload.js + file_script_module_sri_import_elem_nopreload_imported.js + file_script_module_sri_elem_dynamic.html + file_script_module_sri_elem_dynamic_prep.html + file_script_module_sri_elem_dynamic.js + file_script_module_sri_elem_dynamic_imported.js + file_script_module_sri_dynamic_elem.html + file_script_module_sri_dynamic_elem_prep.html + file_script_module_sri_dynamic_elem.js + file_script_module_sri_dynamic_elem_imported.js + file_script_module_sri_dynamic_elem_nopreload.html + file_script_module_sri_dynamic_elem_nopreload_prep.html + file_script_module_sri_dynamic_elem_nopreload.js + file_script_module_sri_dynamic_elem_nopreload_imported.js +[test_script_loader_js_cache_frames.html] +skip-if = verify +support-files = + file_script_module_frames_relay.js + file_script_module_frames_element.html + file_script_module_frames_element_save.html + file_script_module_frames_element_load.html + file_script_module_frames_element_shared.js + file_script_module_frames_import.html + file_script_module_frames_import_save.html + file_script_module_frames_import_save.js + file_script_module_frames_import_load.html + file_script_module_frames_import_load.js + file_script_module_frames_import_shared.js + file_script_module_frames_dynamic.html + file_script_module_frames_dynamic_save.html + file_script_module_frames_dynamic_save.js + file_script_module_frames_dynamic_load.html + file_script_module_frames_dynamic_load.js + file_script_module_frames_dynamic_shared.js +[test_delazification_strategy.html] +skip-if = (verify || ccov) +support-files = + file_delazification_strategy.html + file_delazification_strategy.js +[test_setInterval_from_start.html] +[test_setInterval_uncatchable_exception.html] +skip-if = debug == false +[test_settimeout_extra_arguments.html] +[test_settimeout_inner.html] +[test_setTimeoutWith0.html] +[test_setting_opener.html] +[test_shared_compartment1.html] +skip-if = + http3 +[test_shared_compartment2.html] +skip-if = + http3 +[test_structuredclone_backref.html] +[test_structuredclone_error.html] +[test_style_cssText.html] +[test_suppressed_events_and_scrolling.html] +support-files = + file_suppressed_events_and_scrolling.html +[test_suppressed_events_nested_iframe.html] +skip-if = + os == "android" + http3 +support-files = + file_suppressed_events_top_xhr.html + file_suppressed_events_top_modalstate.html + file_suppressed_events_top.html + file_suppressed_events_middle.html + file_suppressed_events_inner.html + !/gfx/layers/apz/test/mochitest/apz_test_utils.js +[test_suppressed_microtasks.html] +skip-if = + debug || asan || verify || toolkit == 'android' # The test needs to run reasonably fast. +[test_text_wholeText.html] +[test_textnode_normalize_in_selection.html] +[test_textnode_split_in_selection.html] +[test_timeout_clamp.html] +[test_timer_flood.html] +[test_title.html] +support-files = file_title.xhtml +[test_toScreenRect.html] +support-files = file_toScreenRect.html +[test_treewalker_nextsibling.xml] +[test_user_select.html] +skip-if = os == "android" # Bug 1791049 +[test_viewport_metrics_on_landscape_content.html] +support-files = + file_viewport_metrics_on_landscape_content.html +[test_viewport_scroll.html] +[test_viewsource_forbidden_in_object.html] +[test_w3element_traversal.html] +[test_w3element_traversal.xhtml] +[test_w3element_traversal_svg.html] +[test_warning_for_blocked_cross_site_request.html] +skip-if = + http3 +[test_window_close.html] +[test_window_constructor.html] +[test_window_content.html] +[test_window_cross_origin_props.html] +skip-if = + http3 +[test_window_define_nonconfigurable.html] +[test_window_define_symbol.html] +[test_window_element_enumeration.html] +[test_window_enumeration.html] +[test_window_extensible.html] +[test_window_focus_by_close_and_open.html] +support-files = file_window_focus_by_close_and_open.html +[test_window_indexing.html] +[test_window_keys.html] +[test_window_named_frame_enumeration.html] +skip-if = + http3 +[test_window_own_props.html] +[test_window_proto.html] +[test_writable-replaceable.html] +[test_x-frame-options.html] +skip-if = + toolkit == 'android' && debug + xorigin # JavaScript error: http://mochi.test:8888/tests/dom/base/test/test_x-frame-options.html, line 48: TypeError: can't access property "textContent", this.content.document.getElementById(...) is null, JavaScript error: resource://gre/modules/ProcessSelector.jsm, line 56: TypeError: can't access property "tabCount", process is null + http3 +[test_youtube_flash_embed.html] +skip-if = + http3 +# Please keep alphabetical order. diff --git a/dom/base/test/moz.build b/dom/base/test/moz.build new file mode 100644 index 0000000000..37cc3ab239 --- /dev/null +++ b/dom/base/test/moz.build @@ -0,0 +1,44 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPCSHELL_TESTS_MANIFESTS += [ + "unit/xpcshell.ini", + "unit_ipc/xpcshell.ini", +] + +MOCHITEST_MANIFESTS += [ + "mochitest.ini", +] + +MOCHITEST_CHROME_MANIFESTS += [ + "chrome.ini", + "chrome/chrome.ini", +] + +BROWSER_CHROME_MANIFESTS += [ + "browser.ini", + "fmm/browser.ini", +] + +TEST_DIRS += [ + "fullscreen", + "gtest", + "jsmodules", + "jsmodules/importmaps", + "useractivation", + "meta_viewport", +] + +TEST_HARNESS_FILES.testing.mochitest.tests.dom.base.test.chrome += [ + "chrome/bug421622-referer.sjs", + "chrome/bug884693.sjs", + "chrome/nochrome_bug1346936.html", + "chrome/nochrome_bug1346936.js", + "chrome/nochrome_bug1346936.js^headers^", + "chrome/nochrome_bug765993.html", + "chrome/nochrome_bug765993.js", + "chrome/nochrome_bug765993.js^headers^", +] diff --git a/dom/base/test/object_bug353334.html b/dom/base/test/object_bug353334.html new file mode 100644 index 0000000000..8e73c916c6 --- /dev/null +++ b/dom/base/test/object_bug353334.html @@ -0,0 +1 @@ +test diff --git a/dom/base/test/object_bug455472.html b/dom/base/test/object_bug455472.html new file mode 100644 index 0000000000..b2f3ae4f44 --- /dev/null +++ b/dom/base/test/object_bug455472.html @@ -0,0 +1 @@ + diff --git a/dom/base/test/red.png b/dom/base/test/red.png new file mode 100644 index 0000000000..a6e195d59c Binary files /dev/null and b/dom/base/test/red.png differ diff --git a/dom/base/test/referrerHelper.js b/dom/base/test/referrerHelper.js new file mode 100644 index 0000000000..da3097b849 --- /dev/null +++ b/dom/base/test/referrerHelper.js @@ -0,0 +1,343 @@ +/** + * Listen for notifications from the child. + * These are sent in case of error, or when the loads we await have completed. + */ +window.addEventListener("message", function (event) { + if (event.data == "childLoadComplete") { + // all loads happen, continue the test. + advance(); + } else if (event.data == "childOverload") { + // too many loads happened in a test frame, abort. + ok(false, "Too many load handlers called in test."); + SimpleTest.finish(); + } else if (event.data.indexOf("fail-") == 0) { + // something else failed in the test frame, abort. + ok(false, "Child failed the test with error " + event.data.substr(5)); + SimpleTest.finish(); + } +}); + +/** + * helper to perform an XHR. + */ +function doXHR(url, onSuccess, onFail) { + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + if (xhr.status == 200) { + onSuccess(xhr); + } else { + onFail(xhr); + } + }; + xhr.open("GET", url, true); + xhr.send(null); +} + +/** + * This triggers state-resetting on the counter server. + */ +function resetCounter() { + doXHR( + "/tests/dom/base/test/bug704320_counter.sjs?reset", + advance, + function (xhr) { + ok(false, "Need to be able to reset the request counter"); + SimpleTest.finish(); + } + ); +} + +/** + * Grabs the results via XHR and passes to checker. + */ +function checkIndividualResults(testname, expected) { + doXHR( + "/tests/dom/base/test/bug704320_counter.sjs?results", + function (xhr) { + var results = JSON.parse(xhr.responseText); + info(xhr.responseText); + + ok( + "img" in results, + testname + " test: some image loads required in results object." + ); + is( + results.img.count, + 2, + testname + " Test: Expected 2 loads for image requests." + ); + + expected.forEach(function (ref) { + ok( + results.img.referrers.includes(ref), + testname + + " Test: Expected " + + ref + + " referrer policy in test, results were " + + JSON.stringify(results.img.referrers) + + "." + ); + }); + advance(); + }, + function (xhr) { + ok(false, "Can't get results from the counter server."); + SimpleTest.finish(); + } + ); +} + +/** + * Grabs the results via XHR and checks them + */ +function checkExpectedGlobalResults(testName) { + var url = "bug704320.sjs?action=get-test-results"; + doXHR( + url, + function (xhr) { + var response = JSON.parse(xhr.response); + + for (type in response) { + for (scheme in response[type]) { + for (policy in response[type][scheme]) { + var expectedResult = + EXPECTED_RESULTS[type] === undefined + ? EXPECTED_RESULTS.default[scheme][policy] + : EXPECTED_RESULTS[type][scheme][policy]; + is( + response[type][scheme][policy], + expectedResult, + type + " " + scheme + " " + policy + ); + } + } + } + advance(testName); + }, + function (xhr) { + ok(false, "Can't get results from the counter server."); + SimpleTest.finish(); + } + ); +} + +var EXPECTED_RESULTS = { + // From docshell/base/nsDocShell.cpp: + // "If the document containing the hyperlink being audited was not retrieved + // over an encrypted connection and its address does not have the same + // origin as "ping URL", send a referrer." + "link-ping": { + // Same-origin + "http-to-http": { + "no-referrer": "", + "unsafe-url": "", + origin: "", + "origin-when-cross-origin": "", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + "http-to-https": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url", + origin: "http://example.com/", + "origin-when-cross-origin": "http://example.com/", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade", + "same-origin": "", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": "http://example.com/", + }, + // Encrypted and not same-origin + "https-to-http": { + "no-referrer": "", + "unsafe-url": "", + origin: "", + "origin-when-cross-origin": "", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + // Encrypted + "https-to-https": { + "no-referrer": "", + "unsafe-url": "", + origin: "", + "origin-when-cross-origin": "", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + }, + // form is tested in a 2nd level iframe. + form: { + "http-to-http": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=form", + origin: "http://example.com/", + "origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=form", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=form", + "same-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=same-origin&type=form", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=strict-origin-when-cross-origin&type=form", + }, + "http-to-https": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=form", + origin: "http://example.com/", + "origin-when-cross-origin": "http://example.com/", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=form", + "same-origin": "", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": "http://example.com/", + }, + "https-to-http": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=form", + origin: "https://example.com/", + "origin-when-cross-origin": "https://example.com/", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + "https-to-https": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=form", + origin: "https://example.com/", + "origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=form", + "no-referrer-when-downgrade": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=form", + "same-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=same-origin&type=form", + "strict-origin": "https://example.com/", + "strict-origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=strict-origin-when-cross-origin&type=form", + }, + }, + // window.location is tested in a 2nd level iframe. + "window.location": { + "http-to-http": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=window.location", + origin: "http://example.com/", + "origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=window.location", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=window.location", + "same-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=same-origin&type=window.location", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=strict-origin-when-cross-origin&type=window.location", + }, + "http-to-https": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=window.location", + origin: "http://example.com/", + "origin-when-cross-origin": "http://example.com/", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location", + "same-origin": "", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": "http://example.com/", + }, + "https-to-http": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=window.location", + origin: "https://example.com/", + "origin-when-cross-origin": "https://example.com/", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + "https-to-https": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=window.location", + origin: "https://example.com/", + "origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=window.location", + "no-referrer-when-downgrade": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location", + "same-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=same-origin&type=window.location", + "strict-origin": "https://example.com/", + "strict-origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=strict-origin-when-cross-origin&type=window.location", + }, + }, + default: { + "http-to-http": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url", + origin: "http://example.com/", + "origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade", + "same-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=same-origin", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=strict-origin-when-cross-origin", + }, + "http-to-https": { + "no-referrer": "", + "unsafe-url": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url", + origin: "http://example.com/", + "origin-when-cross-origin": "http://example.com/", + "no-referrer-when-downgrade": + "http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade", + "same-origin": "", + "strict-origin": "http://example.com/", + "strict-origin-when-cross-origin": "http://example.com/", + }, + "https-to-http": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url", + origin: "https://example.com/", + "origin-when-cross-origin": "https://example.com/", + "no-referrer-when-downgrade": "", + "same-origin": "", + "strict-origin": "", + "strict-origin-when-cross-origin": "", + }, + "https-to-https": { + "no-referrer": "", + "unsafe-url": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url", + origin: "https://example.com/", + "origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin", + "no-referrer-when-downgrade": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade", + "same-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=same-origin", + "strict-origin": "https://example.com/", + "strict-origin-when-cross-origin": + "https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=strict-origin-when-cross-origin", + }, + }, +}; diff --git a/dom/base/test/referrer_change_server.sjs b/dom/base/test/referrer_change_server.sjs new file mode 100644 index 0000000000..d37cfb1e5f --- /dev/null +++ b/dom/base/test/referrer_change_server.sjs @@ -0,0 +1,166 @@ +var BASE_URL = "example.com/tests/dom/base/test/referrer_change_server.sjs"; + +function createTestUrl(aPolicy, aAction, aName) { + return ( + "http://" + + BASE_URL + + "?" + + "action=" + + aAction + + "&" + + "policy=" + + aPolicy + + "&" + + "name=" + + aName + + "&" + + "type=link" + ); +} + +function createTest(aMetaPolicy, aReferrerPolicy, aName) { + return ( + "\n\ + " + + '' + + "" + + '' + + aReferrerPolicy + + "" + + "\n\ + \n\ + " + ); +} + +function createTest2(aMetaPolicy, aReferrerPolicy, aName) { + return ( + "\n\ + " + + '' + + "" + + '' + + aReferrerPolicy + + "" + + "\n\ + \n\ + " + ); +} + +function handleRequest(request, response) { + var sharedKey = "referrer_change_server.sjs"; + var params = request.queryString.split("&"); + var action = params[0].split("=")[1]; + + if (action === "resetState") { + var state = getSharedState(sharedKey); + state = {}; + setSharedState(sharedKey, JSON.stringify(state)); + response.write(""); + return; + } else if (action === "test") { + // ?action=test&policy=origin&name=name + var policy = params[1].split("=")[1]; + var name = params[2].split("=")[1]; + var type = params[3].split("=")[1]; + var result = getSharedState(sharedKey); + + if (result === "") { + result = {}; + } else { + result = JSON.parse(result); + } + + if (!result.tests) { + result.tests = {}; + } + + var referrerLevel = "none"; + var test = {}; + if (request.hasHeader("Referer")) { + let referrer = request.getHeader("Referer"); + if (referrer.indexOf("referrer_change_server") > 0) { + referrerLevel = "full"; + } else if (referrer == "http://mochi.test:8888") { + referrerLevel = "origin"; + } + test.referrer = request.getHeader("Referer"); + } else { + test.referrer = ""; + } + test.policy = referrerLevel; + test.expected = policy; + + result.tests[name] = test; + + setSharedState(sharedKey, JSON.stringify(result)); + + // forward link click to redirect URL to finish test + if (type === "link") { + var loc = + "https://example.com/tests/dom/base/test/file_change_policy_redirect.html"; + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", loc, false); + } + + return; + } else if (action === "get-test-results") { + // ?action=get-result + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.write(getSharedState(sharedKey)); + return; + } else if (action === "generate-policy-test") { + // ?action=generate-policy-test&referrerPolicy=b64-encoded-string&name=name&newPolicy=b64-encoded-string + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + var referrerPolicy = unescape(params[1].split("=")[1]); + var name = unescape(params[2].split("=")[1]); + var newPolicy = params[3].split("=")[1]; + + response.write(createTest(referrerPolicy, newPolicy, name)); + return; + } else if (action === "generate-policy-test2") { + // ?action=generate-policy-test2&referrerPolicy=b64-encoded-string&name=name&newPolicy=b64-encoded-string + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + var referrerPolicy = unescape(params[1].split("=")[1]); + var name = unescape(params[2].split("=")[1]); + var newPolicy = params[3].split("=")[1]; + + response.write(createTest2(referrerPolicy, newPolicy, name)); + return; + } else { + response.write("I don't know action " + action); + return; + } +} diff --git a/dom/base/test/referrer_header.sjs b/dom/base/test/referrer_header.sjs new file mode 100644 index 0000000000..29c324b8f6 --- /dev/null +++ b/dom/base/test/referrer_header.sjs @@ -0,0 +1,6 @@ +function handleRequest(request, response) { + response.setHeader("Referrer-Policy", "same-origin"); + response.write( + 'Loaded' + ); +} diff --git a/dom/base/test/referrer_helper.js b/dom/base/test/referrer_helper.js new file mode 100644 index 0000000000..e2e3e32835 --- /dev/null +++ b/dom/base/test/referrer_helper.js @@ -0,0 +1,133 @@ +// This helper expects these globals to be defined. +/* global PARAMS, SJS, testCases */ + +/* + * common functionality for iframe, anchor, and area referrer attribute tests + */ +const GET_RESULT = SJS + "ACTION=get-test-results"; +const RESET_STATE = SJS + "ACTION=resetState"; + +SimpleTest.waitForExplicitFinish(); +var advance = function () { + tests.next(); +}; + +/** + * Listen for notifications from the child. + * These are sent in case of error, or when the loads we await have completed. + */ +window.addEventListener("message", function (event) { + if (event.data == "childLoadComplete") { + // all loads happen, continue the test. + advance(); + } +}); + +/** + * helper to perform an XHR + * to do checkIndividualResults and resetState + */ +function doXHR(aUrl, onSuccess, onFail) { + // The server is at http[s]://example.com so we need cross-origin XHR. + var xhr = new XMLHttpRequest({ mozSystem: true }); + xhr.responseType = "json"; + xhr.onload = function () { + onSuccess(xhr); + }; + xhr.onerror = function () { + onFail(xhr); + }; + xhr.open("GET", "http" + aUrl, true); + xhr.send(null); +} + +/** + * Grabs the results via XHR and passes to checker. + */ +function checkIndividualResults(aTestname, aExpectedReferrer, aName) { + var onload = xhr => { + var results = xhr.response; + info(JSON.stringify(xhr.response)); + ok(aName in results, aName + " tests have to be performed."); + is( + results[aName].policy, + aExpectedReferrer, + aTestname + + " --- " + + results[aName].policy + + " (" + + results[aName].referrer + + ")" + ); + advance(); + }; + var onerror = xhr => { + ok(false, "Can't get results from the counter server."); + SimpleTest.finish(); + }; + doXHR(GET_RESULT, onload, onerror); +} + +function resetState() { + doXHR(RESET_STATE, advance, function (xhr) { + ok(false, "error in reset state"); + SimpleTest.finish(); + }); +} + +/** + * testing if referrer header is sent correctly + */ +var tests = (function* () { + yield SpecialPowers.pushPrefEnv( + { set: [["network.preload", true]] }, + advance + ); + yield SpecialPowers.pushPrefEnv( + { set: [["security.mixed_content.block_active_content", false]] }, + advance + ); + yield SpecialPowers.pushPrefEnv( + { set: [["network.http.referer.disallowRelaxingDefault", false]] }, + advance + ); + yield SpecialPowers.pushPermissions( + [{ type: "systemXHR", allow: true, context: document }], + advance + ); + + var iframe = document.getElementById("testframe"); + + for (var j = 0; j < testCases.length; j++) { + if (testCases[j].PREFS) { + yield SpecialPowers.pushPrefEnv({ set: testCases[j].PREFS }, advance); + } + + var actions = testCases[j].ACTION; + var subTests = testCases[j].TESTS; + for (var k = 0; k < actions.length; k++) { + var actionString = actions[k]; + for (var i = 0; i < subTests.length; i++) { + yield resetState(); + var searchParams = new URLSearchParams(); + searchParams.append("ACTION", actionString); + searchParams.append("NAME", subTests[i].NAME); + for (var l of PARAMS) { + if (subTests[i][l]) { + searchParams.append(l, subTests[i][l]); + } + } + var schemeFrom = subTests[i].SCHEME_FROM || "http"; + yield (iframe.src = schemeFrom + SJS + searchParams.toString()); + yield checkIndividualResults( + subTests[i].DESC, + subTests[i].RESULT, + subTests[i].NAME + ); + } + } + } + + // complete. + SimpleTest.finish(); +})(); diff --git a/dom/base/test/referrer_testserver.sjs b/dom/base/test/referrer_testserver.sjs new file mode 100644 index 0000000000..bb7acbc3b2 --- /dev/null +++ b/dom/base/test/referrer_testserver.sjs @@ -0,0 +1,693 @@ +/* + * Test server for iframe, anchor, and area referrer attributes. + * https://bugzilla.mozilla.org/show_bug.cgi?id=1175736 + * Also server for further referrer tests such as redirecting tests + * bug 1174913, bug 1175736, bug 1184781 + */ + +Components.utils.importGlobalProperties(["URLSearchParams"]); +const SJS = "referrer_testserver.sjs?"; +const SJS_PATH = "/tests/dom/base/test/"; +const BASE_ORIGIN = "example.com"; +const BASE_URL = BASE_ORIGIN + SJS_PATH + SJS; +const SHARED_KEY = SJS; +const SAME_ORIGIN = "mochi.test:8888" + SJS_PATH + SJS; +const CROSS_ORIGIN_URL = "test1.example.com" + SJS_PATH + SJS; + +const IMG_BYTES = atob( + "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12" + + "P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" +); + +function createTestUrl( + aPolicy, + aAction, + aName, + aType, + aSchemeFrom, + aSchemeTo, + crossOrigin, + referrerPolicyHeader +) { + var schemeTo = aSchemeTo || "http"; + var schemeFrom = aSchemeFrom || "http"; + var rpHeader = referrerPolicyHeader || ""; + var url = schemeTo + "://"; + url += crossOrigin ? CROSS_ORIGIN_URL : BASE_URL; + url += + "ACTION=" + + aAction + + "&" + + "policy=" + + aPolicy + + "&" + + "NAME=" + + aName + + "&" + + "type=" + + aType + + "&" + + "RP_HEADER=" + + rpHeader + + "&" + + "SCHEME_FROM=" + + schemeFrom; + return url; +} + +// test page using iframe referrer attribute +// if aParams are set this creates a test where the iframe url is a redirect +function createIframeTestPageUsingRefferer( + aMetaPolicy, + aAttributePolicy, + aNewAttributePolicy, + aName, + aParams, + aSchemeFrom, + aSchemeTo, + aChangingMethod +) { + var metaString = ""; + if (aMetaPolicy) { + metaString = ``; + } + var changeString = ""; + if (aChangingMethod === "setAttribute") { + changeString = `document.getElementById("myframe").setAttribute("referrerpolicy", "${aNewAttributePolicy}")`; + } else if (aChangingMethod === "property") { + changeString = `document.getElementById("myframe").referrerPolicy = "${aNewAttributePolicy}"`; + } + var iFrameString = ``; + var iframeUrl = ""; + if (aParams) { + aParams.delete("ACTION"); + aParams.append("ACTION", "redirectIframe"); + iframeUrl = "http://" + CROSS_ORIGIN_URL + aParams.toString(); + } else { + iframeUrl = createTestUrl( + aAttributePolicy, + "test", + aName, + "iframe", + aSchemeFrom, + aSchemeTo + ); + } + + return ` + + + ${metaString} + + + ${iFrameString} + + + `; +} + +function buildAnchorString( + aMetaPolicy, + aReferrerPolicy, + aName, + aRelString, + aSchemeFrom, + aSchemeTo +) { + if (aReferrerPolicy) { + return `${aReferrerPolicy}`; + } + return `link`; +} + +function buildAreaString( + aMetaPolicy, + aReferrerPolicy, + aName, + aRelString, + aSchemeFrom, + aSchemeTo +) { + var result = `image`; + result += ``; + if (aReferrerPolicy) { + result += `theArea`; + } else { + result += `theArea`; + } + result += ``; + + return result; +} + +// test page using anchor or area referrer attribute +function createAETestPageUsingRefferer( + aMetaPolicy, + aAttributePolicy, + aNewAttributePolicy, + aName, + aRel, + aStringBuilder, + aSchemeFrom, + aSchemeTo, + aChangingMethod +) { + var metaString = ""; + if (aMetaPolicy) { + metaString = ``; + } + var changeString = ""; + if (aChangingMethod === "setAttribute") { + changeString = `document.getElementById("link").setAttribute("referrerpolicy", "${aNewAttributePolicy}")`; + } else if (aChangingMethod === "property") { + changeString = `document.getElementById("link").referrerPolicy = "${aNewAttributePolicy}"`; + } + var relString = ""; + if (aRel) { + relString = `rel="noreferrer"`; + } + var elementString = aStringBuilder( + aMetaPolicy, + aAttributePolicy, + aName, + relString, + aSchemeFrom, + aSchemeTo + ); + + return ` + + ${metaString} + + ${elementString} + + + `; +} + +// test page using anchor target=_blank rel=noopener +function createTargetBlankRefferer( + aMetaPolicy, + aName, + aSchemeFrom, + aSchemeTo, + aRpHeader +) { + var metaString = ""; + if (aMetaPolicy) { + metaString = ``; + } + var elementString = `link`; + + return ` + + ${metaString} + + ${elementString} + + + `; +} + +// creates test page with img that is a redirect +function createRedirectImgTestCase(aParams, aAttributePolicy) { + var metaString = ""; + if (aParams.has("META_POLICY")) { + metaString = ``; + } + aParams.delete("ACTION"); + aParams.append("ACTION", "redirectImg"); + var imgUrl = "http://" + CROSS_ORIGIN_URL + aParams.toString(); + + return ` + + + + ${metaString} + Test referrer policies on redirect (img) + + + + + + `; +} + +// test page using link referrer attribute +function createLinkPageUsingRefferer( + aMetaPolicy, + aAttributePolicy, + aNewAttributePolicy, + aName, + aRel, + aStringBuilder, + aSchemeFrom, + aSchemeTo, + aTestType +) { + var metaString = ""; + if (aMetaPolicy) { + metaString = ``; + } + + var changeString = ""; + var policy = aAttributePolicy ? aAttributePolicy : aMetaPolicy; + var elementString = aStringBuilder( + policy, + aName, + aRel, + aSchemeFrom, + aSchemeTo, + aTestType + ); + + if (aTestType === "setAttribute") { + changeString = `var link = document.getElementById("test_link"); + link.setAttribute("referrerpolicy", "${aNewAttributePolicy}"); + link.href = "${createTestUrl( + policy, + "test", + aName, + "link_element_" + aRel, + aSchemeFrom, + aSchemeTo + )}";`; + } else if (aTestType === "property") { + changeString = `var link = document.getElementById("test_link"); + link.referrerPolicy = "${aNewAttributePolicy}"; + link.href = "${createTestUrl( + policy, + "test", + aName, + "link_element_" + aRel, + aSchemeFrom, + aSchemeTo + )}";`; + } + + return ` + + + ${metaString} + + + ${elementString} + + + `; +} + +function createFetchUserControlRPTestCase( + aName, + aSchemeFrom, + aSchemeTo, + crossOrigin +) { + var srcUrl = createTestUrl( + "", + "test", + aName, + "fetch", + aSchemeFrom, + aSchemeTo, + crossOrigin + ); + + return ` + + + + Test user control referrer policies + + + + + `; +} + +function buildLinkString( + aPolicy, + aName, + aRel, + aSchemeFrom, + aSchemeTo, + aTestType +) { + var href = ""; + var onChildComplete = `window.parent.postMessage("childLoadComplete", "http://mochi.test:8888");`; + var policy = ""; + var asString = ""; + var relString = ""; + + if (aRel) { + relString = `rel="${aRel}"`; + } + + if (aPolicy) { + policy = `referrerpolicy=${aPolicy}`; + } + + if (aRel == "preload") { + asString = 'as="image"'; + } + + if (!aTestType) { + href = `href=${createTestUrl( + aPolicy, + "test", + aName, + "link_element_" + aRel, + aSchemeFrom, + aSchemeTo + )}`; + } + + return ``; +} + +// eslint-disable-next-line complexity +function handleRequest(request, response) { + var params = new URLSearchParams(request.queryString); + var action = params.get("ACTION"); + var schemeFrom = params.get("SCHEME_FROM") || "http"; + var schemeTo = params.get("SCHEME_TO") || "http"; + var crossOrigin = params.get("CROSS_ORIGIN") || false; + var referrerPolicyHeader = params.get("RP_HEADER") || ""; + + response.setHeader("Access-Control-Allow-Origin", "*", false); + if (referrerPolicyHeader) { + response.setHeader("Referrer-Policy", referrerPolicyHeader, false); + } + + if (action === "resetState") { + setSharedState(SHARED_KEY, "{}"); + response.write(""); + return; + } + if (action === "get-test-results") { + // ?action=get-result + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.write(getSharedState(SHARED_KEY)); + return; + } + if (action === "redirect") { + response.write( + '' + ); + return; + } + if (action === "redirectImg") { + params.delete("ACTION"); + params.append("ACTION", "test"); + params.append("type", "img"); + // 302 found, 301 Moved Permanently, 303 See Other, 307 Temporary Redirect + response.setStatusLine("1.1", 302, "found"); + response.setHeader( + "Location", + "http://" + CROSS_ORIGIN_URL + params.toString(), + false + ); + return; + } + if (action === "redirectIframe") { + params.delete("ACTION"); + params.append("ACTION", "test"); + params.append("type", "iframe"); + // 302 found, 301 Moved Permanently, 303 See Other, 307 Temporary Redirect + response.setStatusLine("1.1", 302, "found"); + response.setHeader( + "Location", + "http://" + CROSS_ORIGIN_URL + params.toString(), + false + ); + return; + } + if (action === "test") { + // ?action=test&policy=origin&name=name + var policy = params.get("policy"); + var name = params.get("NAME"); + var type = params.get("type"); + var result = getSharedState(SHARED_KEY); + + result = result ? JSON.parse(result) : {}; + + var referrerLevel = "none"; + var test = {}; + if (request.hasHeader("Referer")) { + var referrer = request.getHeader("Referer"); + if (referrer.indexOf("referrer_testserver") > 0) { + referrerLevel = "full"; + } else if (referrer.indexOf(schemeFrom + "://example.com") == 0) { + referrerLevel = "origin"; + } else { + // this is never supposed to happen + referrerLevel = "other-origin"; + } + test.referrer = referrer; + } else { + test.referrer = ""; + } + test.policy = referrerLevel; + test.expected = policy; + + result[name] = test; + + setSharedState(SHARED_KEY, JSON.stringify(result)); + + if (type === "img" || type == "link_element_preload") { + // return image + response.setHeader("Content-Type", "image/png"); + response.write(IMG_BYTES); + return; + } + if (type === "iframe") { + // return iframe page + response.write("I am the iframe"); + return; + } + if (type === "link") { + // forward link click to redirect URL to finish test + var loc = "http://" + BASE_URL + "ACTION=redirect"; + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", loc, false); + } + return; + } + + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html; charset=utf-8", false); + + // parse test arguments and start test + var attributePolicy = params.get("ATTRIBUTE_POLICY") || ""; + var newAttributePolicy = params.get("NEW_ATTRIBUTE_POLICY") || ""; + var metaPolicy = params.get("META_POLICY") || ""; + var rel = params.get("REL") || ""; + var name = params.get("NAME"); + + // anchor & area + var _getPage = createAETestPageUsingRefferer.bind( + null, + metaPolicy, + attributePolicy, + newAttributePolicy, + name, + rel + ); + var _getAnchorPage = _getPage.bind( + null, + buildAnchorString, + schemeFrom, + schemeTo + ); + var _getAreaPage = _getPage.bind(null, buildAreaString, schemeFrom, schemeTo); + + // aMetaPolicy, aAttributePolicy, aNewAttributePolicy, aName, aChangingMethod, aStringBuilder + if (action === "generate-anchor-policy-test") { + response.write(_getAnchorPage()); + return; + } + if (action === "generate-anchor-changing-policy-test-set-attribute") { + response.write(_getAnchorPage("setAttribute")); + return; + } + if (action === "generate-anchor-changing-policy-test-property") { + response.write(_getAnchorPage("property")); + return; + } + if (action === "generate-area-policy-test") { + response.write(_getAreaPage()); + return; + } + if (action === "generate-area-changing-policy-test-set-attribute") { + response.write(_getAreaPage("setAttribute")); + return; + } + if (action === "generate-area-changing-policy-test-property") { + response.write(_getAreaPage("property")); + return; + } + if (action === "generate-anchor-target-blank-policy-test") { + response.write( + createTargetBlankRefferer( + metaPolicy, + name, + schemeFrom, + schemeTo, + referrerPolicyHeader + ) + ); + return; + } + + // iframe + _getPage = createIframeTestPageUsingRefferer.bind( + null, + metaPolicy, + attributePolicy, + newAttributePolicy, + name, + "", + schemeFrom, + schemeTo + ); + + // aMetaPolicy, aAttributePolicy, aNewAttributePolicy, aName, aChangingMethod + if (action === "generate-iframe-policy-test") { + response.write(_getPage()); + return; + } + if (action === "generate-iframe-changing-policy-test-set-attribute") { + response.write(_getPage("setAttribute")); + return; + } + if (action === "generate-iframe-changing-policy-test-property") { + response.write(_getPage("property")); + return; + } + + // redirect tests with img and iframe + if (action === "generate-img-redirect-policy-test") { + response.write(createRedirectImgTestCase(params, attributePolicy)); + return; + } + if (action === "generate-iframe-redirect-policy-test") { + response.write( + createIframeTestPageUsingRefferer( + metaPolicy, + attributePolicy, + newAttributePolicy, + name, + params, + schemeFrom, + schemeTo + ) + ); + return; + } + + var _getPage = createLinkPageUsingRefferer.bind( + null, + metaPolicy, + attributePolicy, + newAttributePolicy, + name, + rel + ); + var _getLinkPage = _getPage.bind(null, buildLinkString, schemeFrom, schemeTo); + + // link + if (action === "generate-link-policy-test") { + response.write(_getLinkPage()); + return; + } + if (action === "generate-link-policy-test-set-attribute") { + response.write(_getLinkPage("setAttribute")); + return; + } + if (action === "generate-link-policy-test-property") { + response.write(_getLinkPage("property")); + return; + } + + if (action === "generate-fetch-user-control-policy-test") { + response.write( + createFetchUserControlRPTestCase(name, schemeFrom, schemeTo, crossOrigin) + ); + return; + } + + response.write("I don't know action " + action); + return; +} diff --git a/dom/base/test/reftest/mixed-bmp-png.ico b/dom/base/test/reftest/mixed-bmp-png.ico new file mode 100644 index 0000000000..32e2c4995c Binary files /dev/null and b/dom/base/test/reftest/mixed-bmp-png.ico differ diff --git a/dom/base/test/reftest/reftest.list b/dom/base/test/reftest/reftest.list new file mode 100644 index 0000000000..8aa3f3b949 --- /dev/null +++ b/dom/base/test/reftest/reftest.list @@ -0,0 +1,7 @@ +== test_bug920877.html test_bug920877-ref.html +HTTP == test_xmlPrettyPrint_csp.xml test_xmlPrettyPrint_csp-ref.xml +# Ordinarily, reftests use a browser.viewport.desktopWidth of 800px, same as the +# size of the reftest document. This test however needs something more representative +# of a real mobile device, where the desktop viewport width doesn't match the +# width of the device screen. +test-pref(dom.meta-viewport.enabled,true) test-pref(browser.viewport.desktopWidth,1200) == test_bug1525662.txt test_bug1525662-ref.html diff --git a/dom/base/test/reftest/test_bug1525662-ref.html b/dom/base/test/reftest/test_bug1525662-ref.html new file mode 100644 index 0000000000..063daf7615 --- /dev/null +++ b/dom/base/test/reftest/test_bug1525662-ref.html @@ -0,0 +1,15 @@ + + + + + +
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras ac velit sed tellus facilisis euismod. Proin vel nulla vel turpis tristique dignissim. Donec lacus ipsum, eleifend ut, volutpat a, ultrices adipiscing, arcu. Etiam ligula dolor, adipiscing ut, porta vitae, bibendum non, dolor. Mauris ligula. Sed placerat tincidunt elit. Vestibulum non libero. Curabitur cursus tortor id sem. Integer consectetuer auctor lacus. Proin nisl nisi, pulvinar eget, pharetra at, aliquam eu, velit. Morbi fringilla. Quisque faucibus, mauris posuere vulputate interdum, lectus libero sollicitudin tellus, sit amet ultrices enim purus ac mauris. Pellentesque sit amet mauris eu ante aliquet egestas. Mauris dapibus, velit consectetuer tristique luctus, enim augue pulvinar libero, fringilla dictum lectus felis eu ligula. In ac lorem.
                    +
                    +Integer laoreet. Ut ultricies arcu nec est. Aenean varius nisl ut odio. Nullam arcu. Vestibulum non pede. Proin vel est. Nam condimentum fermentum dui. Donec at arcu. Donec at libero adipiscing odio mattis dapibus. Suspendisse libero neque, faucibus sed, facilisis et, convallis sit amet, justo. Duis purus tortor, ornare ac, convallis ut, pretium et, tellus. Nam accumsan, ipsum eget accumsan mollis, sapien dolor adipiscing metus, id tincidunt ipsum metus sed nulla. Praesent hendrerit lectus eget tortor. Morbi id lectus et elit ultrices hendrerit. Cras gravida velit sed mauris. Proin lacinia tempus est. Sed sapien tortor, fringilla vel, elementum in, volutpat ac, ante. Vivamus eu tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
                    +
                    +Mauris in sem ac felis pretium placerat. Donec tempus cursus sem. Aliquam scelerisque porttitor sem. Curabitur consectetuer, pede vitae aliquam aliquet, sapien lacus vehicula neque, ut rhoncus nibh neque sed velit. In rhoncus, nulla eu dignissim egestas, diam nibh hendrerit mauris, condimentum laoreet sapien arcu quis mi. Sed euismod sem. Nulla non ligula sed lacus tempor molestie. Quisque varius. In hac habitasse platea dictumst. Sed felis ipsum, consequat et, blandit vitae, tincidunt id, quam. Nunc nunc. Duis gravida. In massa neque, cursus quis, rutrum sed, semper quis, erat. Donec enim. Suspendisse condimentum eros vel elit. Vestibulum adipiscing erat id lorem. Maecenas enim dui, cursus a, pulvinar ac, rutrum sed, sem. Suspendisse gravida ante vel lectus.
                    +
                    +Vestibulum molestie, ante at dignissim venenatis, pede urna dictum arcu, vel ullamcorper ligula eros eget metus. Pellentesque nec nisl. Morbi ut nibh. Aenean mauris. Mauris rutrum justo nec velit. Nunc condimentum tortor id augue. Quisque semper massa eget nibh. Maecenas ac odio pretium lorem tincidunt faucibus. Sed congue. Cras sit amet orci ut ligula cursus congue. Etiam laoreet lacus sit amet tortor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus accumsan. Ut gravida urna hendrerit leo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
                    +
                    + + diff --git a/dom/base/test/reftest/test_bug1525662.txt b/dom/base/test/reftest/test_bug1525662.txt new file mode 100644 index 0000000000..33fd1fd851 --- /dev/null +++ b/dom/base/test/reftest/test_bug1525662.txt @@ -0,0 +1,7 @@ +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras ac velit sed tellus facilisis euismod. Proin vel nulla vel turpis tristique dignissim. Donec lacus ipsum, eleifend ut, volutpat a, ultrices adipiscing, arcu. Etiam ligula dolor, adipiscing ut, porta vitae, bibendum non, dolor. Mauris ligula. Sed placerat tincidunt elit. Vestibulum non libero. Curabitur cursus tortor id sem. Integer consectetuer auctor lacus. Proin nisl nisi, pulvinar eget, pharetra at, aliquam eu, velit. Morbi fringilla. Quisque faucibus, mauris posuere vulputate interdum, lectus libero sollicitudin tellus, sit amet ultrices enim purus ac mauris. Pellentesque sit amet mauris eu ante aliquet egestas. Mauris dapibus, velit consectetuer tristique luctus, enim augue pulvinar libero, fringilla dictum lectus felis eu ligula. In ac lorem. + +Integer laoreet. Ut ultricies arcu nec est. Aenean varius nisl ut odio. Nullam arcu. Vestibulum non pede. Proin vel est. Nam condimentum fermentum dui. Donec at arcu. Donec at libero adipiscing odio mattis dapibus. Suspendisse libero neque, faucibus sed, facilisis et, convallis sit amet, justo. Duis purus tortor, ornare ac, convallis ut, pretium et, tellus. Nam accumsan, ipsum eget accumsan mollis, sapien dolor adipiscing metus, id tincidunt ipsum metus sed nulla. Praesent hendrerit lectus eget tortor. Morbi id lectus et elit ultrices hendrerit. Cras gravida velit sed mauris. Proin lacinia tempus est. Sed sapien tortor, fringilla vel, elementum in, volutpat ac, ante. Vivamus eu tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + +Mauris in sem ac felis pretium placerat. Donec tempus cursus sem. Aliquam scelerisque porttitor sem. Curabitur consectetuer, pede vitae aliquam aliquet, sapien lacus vehicula neque, ut rhoncus nibh neque sed velit. In rhoncus, nulla eu dignissim egestas, diam nibh hendrerit mauris, condimentum laoreet sapien arcu quis mi. Sed euismod sem. Nulla non ligula sed lacus tempor molestie. Quisque varius. In hac habitasse platea dictumst. Sed felis ipsum, consequat et, blandit vitae, tincidunt id, quam. Nunc nunc. Duis gravida. In massa neque, cursus quis, rutrum sed, semper quis, erat. Donec enim. Suspendisse condimentum eros vel elit. Vestibulum adipiscing erat id lorem. Maecenas enim dui, cursus a, pulvinar ac, rutrum sed, sem. Suspendisse gravida ante vel lectus. + +Vestibulum molestie, ante at dignissim venenatis, pede urna dictum arcu, vel ullamcorper ligula eros eget metus. Pellentesque nec nisl. Morbi ut nibh. Aenean mauris. Mauris rutrum justo nec velit. Nunc condimentum tortor id augue. Quisque semper massa eget nibh. Maecenas ac odio pretium lorem tincidunt faucibus. Sed congue. Cras sit amet orci ut ligula cursus congue. Etiam laoreet lacus sit amet tortor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus accumsan. Ut gravida urna hendrerit leo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. diff --git a/dom/base/test/reftest/test_bug920877-ref.html b/dom/base/test/reftest/test_bug920877-ref.html new file mode 100644 index 0000000000..1a593e5849 --- /dev/null +++ b/dom/base/test/reftest/test_bug920877-ref.html @@ -0,0 +1,20 @@ + + + + + diff --git a/dom/base/test/reftest/test_bug920877.html b/dom/base/test/reftest/test_bug920877.html new file mode 100644 index 0000000000..18bae4009e --- /dev/null +++ b/dom/base/test/reftest/test_bug920877.html @@ -0,0 +1,38 @@ + + + + + + + + + diff --git a/dom/base/test/reftest/test_xmlPrettyPrint_csp-ref.xml b/dom/base/test/reftest/test_xmlPrettyPrint_csp-ref.xml new file mode 100644 index 0000000000..7b3c180912 --- /dev/null +++ b/dom/base/test/reftest/test_xmlPrettyPrint_csp-ref.xml @@ -0,0 +1,4 @@ + + + This is an XML document + diff --git a/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml b/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml new file mode 100644 index 0000000000..7b3c180912 --- /dev/null +++ b/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml @@ -0,0 +1,4 @@ + + + This is an XML document + diff --git a/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml^headers^ b/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml^headers^ new file mode 100644 index 0000000000..93d453bd3b --- /dev/null +++ b/dom/base/test/reftest/test_xmlPrettyPrint_csp.xml^headers^ @@ -0,0 +1 @@ +Content-Security-Policy: default-src 'none'; diff --git a/dom/base/test/script-1_bug597345.sjs b/dom/base/test/script-1_bug597345.sjs new file mode 100644 index 0000000000..00180c997f --- /dev/null +++ b/dom/base/test/script-1_bug597345.sjs @@ -0,0 +1,22 @@ +// timer has to be alive so it can't be eaten by the GC. +var timer; + +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/javascript", false); + // The "stray" open comment at the end of the write is important! + response.write( + "document.write(\" + + + Test for Bug 338583 + + + + + + +Mozilla Bug 716841 +

                    + +
                    +
                    +
                    + + + + diff --git a/dom/base/test/test_Image_constructor.html b/dom/base/test/test_Image_constructor.html new file mode 100644 index 0000000000..4c4bb70e54 --- /dev/null +++ b/dom/base/test/test_Image_constructor.html @@ -0,0 +1,32 @@ + + + + + + + + Test for Bug 862702 + + + + + +Mozilla Bug 862702 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_NodeIterator_basics_filters.xhtml b/dom/base/test/test_NodeIterator_basics_filters.xhtml new file mode 100644 index 0000000000..47504eebbe --- /dev/null +++ b/dom/base/test/test_NodeIterator_basics_filters.xhtml @@ -0,0 +1,178 @@ + + + + DOM Traversal: NodeIterator: Basics and Filters + + + + +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_NodeIterator_mutations_1.xhtml b/dom/base/test/test_NodeIterator_mutations_1.xhtml new file mode 100644 index 0000000000..5f6dc2f861 --- /dev/null +++ b/dom/base/test/test_NodeIterator_mutations_1.xhtml @@ -0,0 +1,204 @@ + + + + DOM Traversal: NodeIterator: Mutations (1/x) + + + + +

                    + +
                    +
                    diff --git a/dom/base/test/test_NodeIterator_mutations_2.html b/dom/base/test/test_NodeIterator_mutations_2.html new file mode 100644 index 0000000000..47d7b8b5e4 --- /dev/null +++ b/dom/base/test/test_NodeIterator_mutations_2.html @@ -0,0 +1,112 @@ + + + + + DOM Traversal: NodeIterator: Mutations (2/x) + + + +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_NodeIterator_mutations_3.html b/dom/base/test/test_NodeIterator_mutations_3.html new file mode 100644 index 0000000000..3eb23ee3ce --- /dev/null +++ b/dom/base/test/test_NodeIterator_mutations_3.html @@ -0,0 +1,160 @@ + + + + DOM Traversal: NodeIterator: Mutations (3/x) + + + +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_anchor_area_referrer.html b/dom/base/test/test_anchor_area_referrer.html new file mode 100644 index 0000000000..7e6992b404 --- /dev/null +++ b/dom/base/test/test_anchor_area_referrer.html @@ -0,0 +1,127 @@ + + + + + Test anchor and area policy attribute for Bug 1174913 + + + + + + + + + + + + + diff --git a/dom/base/test/test_anchor_area_referrer_changing.html b/dom/base/test/test_anchor_area_referrer_changing.html new file mode 100644 index 0000000000..e8d6c249fb --- /dev/null +++ b/dom/base/test/test_anchor_area_referrer_changing.html @@ -0,0 +1,66 @@ + + + + + Test anchor and area policy attribute for Bug 1174913 + + + + + + + + + + + + + diff --git a/dom/base/test/test_anchor_area_referrer_invalid.html b/dom/base/test/test_anchor_area_referrer_invalid.html new file mode 100644 index 0000000000..f5687b7180 --- /dev/null +++ b/dom/base/test/test_anchor_area_referrer_invalid.html @@ -0,0 +1,74 @@ + + + + + Test anchor and area policy attribute for Bug 1174913 + + + + + + + + + + + + + diff --git a/dom/base/test/test_anchor_area_referrer_rel.html b/dom/base/test/test_anchor_area_referrer_rel.html new file mode 100644 index 0000000000..71cd4f6390 --- /dev/null +++ b/dom/base/test/test_anchor_area_referrer_rel.html @@ -0,0 +1,50 @@ + + + + + Test anchor and area policy attribute for Bug 1174913 + + + + + + + + + + + + + diff --git a/dom/base/test/test_anchor_target_blank_referrer.html b/dom/base/test/test_anchor_target_blank_referrer.html new file mode 100644 index 0000000000..fbd1ff9207 --- /dev/null +++ b/dom/base/test/test_anchor_target_blank_referrer.html @@ -0,0 +1,134 @@ + + + + + Test anchor target=_blank rel=noopener referrer header for Bug 1502678 + + + + + + + + + + + + + diff --git a/dom/base/test/test_anonymousContent_api.html b/dom/base/test/test_anonymousContent_api.html new file mode 100644 index 0000000000..2bc8d08e62 --- /dev/null +++ b/dom/base/test/test_anonymousContent_api.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 1020244 - Test the chrome-only AnonymousContent API + + + + +Mozilla Bug 1020244 + + + diff --git a/dom/base/test/test_anonymousContent_append_after_reflow.html b/dom/base/test/test_anonymousContent_append_after_reflow.html new file mode 100644 index 0000000000..1e1e62d3d5 --- /dev/null +++ b/dom/base/test/test_anonymousContent_append_after_reflow.html @@ -0,0 +1,40 @@ + + + + + + Test for Bug 1020244 - Make sure anonymous content still works after a reflow (after the canvasframe has been reconstructed) + + + + +
                    +
                    text content
                    +
                    + + + diff --git a/dom/base/test/test_anonymousContent_canvas.html b/dom/base/test/test_anonymousContent_canvas.html new file mode 100644 index 0000000000..cca364a52d --- /dev/null +++ b/dom/base/test/test_anonymousContent_canvas.html @@ -0,0 +1,59 @@ + + + + + + Test for Bug 1212477 - Needs a way to access to <canvas>'s context (2d, webgl) from Anonymous Content API + + + + + Mozilla Bug 1212477 +
                    +
                    text content
                    + + + +
                    + + + diff --git a/dom/base/test/test_anonymousContent_insert.html b/dom/base/test/test_anonymousContent_insert.html new file mode 100644 index 0000000000..81e03cb45b --- /dev/null +++ b/dom/base/test/test_anonymousContent_insert.html @@ -0,0 +1,45 @@ + + + + + + Test for Bug 1020244 - Insert content using the AnonymousContent API, several times, and don't remove it + + + + +Mozilla Bug 1020244 +
                    +
                    text content
                    +
                    + + + diff --git a/dom/base/test/test_anonymousContent_manipulate_content.html b/dom/base/test/test_anonymousContent_manipulate_content.html new file mode 100644 index 0000000000..eb4bcb6be3 --- /dev/null +++ b/dom/base/test/test_anonymousContent_manipulate_content.html @@ -0,0 +1,74 @@ + + + + + + Test for Bug 1020244 - Manipulate content created with the AnonymousContent API + + + + +Mozilla Bug 1020244 +
                    +
                    text content
                    +
                    + + + diff --git a/dom/base/test/test_anonymousContent_set_style.html b/dom/base/test/test_anonymousContent_set_style.html new file mode 100644 index 0000000000..75587b3e0f --- /dev/null +++ b/dom/base/test/test_anonymousContent_set_style.html @@ -0,0 +1,35 @@ + + + + + + Test for Bug 1571650 - Test AnonymousContent.setStyle() API + + + + +Mozilla Bug 1571650 + + + diff --git a/dom/base/test/test_anonymousContent_style_csp.html b/dom/base/test/test_anonymousContent_style_csp.html new file mode 100644 index 0000000000..0eca83404c --- /dev/null +++ b/dom/base/test/test_anonymousContent_style_csp.html @@ -0,0 +1,28 @@ + + + + + + Test for Bug 1185351 - Make sure that we don't enforce CSP on styles for AnonymousContent + + + + +
                    +
                    text content
                    +
                    + + + diff --git a/dom/base/test/test_anonymousContent_style_csp.html^headers^ b/dom/base/test/test_anonymousContent_style_csp.html^headers^ new file mode 100644 index 0000000000..b7b3c8a4f9 --- /dev/null +++ b/dom/base/test/test_anonymousContent_style_csp.html^headers^ @@ -0,0 +1 @@ +Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' diff --git a/dom/base/test/test_anonymousContent_xul_window.xhtml b/dom/base/test/test_anonymousContent_xul_window.xhtml new file mode 100644 index 0000000000..b81f827075 --- /dev/null +++ b/dom/base/test/test_anonymousContent_xul_window.xhtml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/dom/base/test/test_appname_override.html b/dom/base/test/test_appname_override.html new file mode 100644 index 0000000000..bf1162a900 --- /dev/null +++ b/dom/base/test/test_appname_override.html @@ -0,0 +1,26 @@ + + + + + + Test for Bug 939445 - general.appname.override + + + + +Mozilla Bug 939445 + + + diff --git a/dom/base/test/test_async_setTimeout_stack.html b/dom/base/test/test_async_setTimeout_stack.html new file mode 100644 index 0000000000..773a923be3 --- /dev/null +++ b/dom/base/test/test_async_setTimeout_stack.html @@ -0,0 +1,60 @@ + + + + + + Test for Bug 1142577 - Async stacks for setTimeout + + + + + Mozilla Bug 1142577 +
                    
                    +  
                    +
                    +
                    diff --git a/dom/base/test/test_async_setTimeout_stack_across_globals.html b/dom/base/test/test_async_setTimeout_stack_across_globals.html
                    new file mode 100644
                    index 0000000000..358aa21abe
                    --- /dev/null
                    +++ b/dom/base/test/test_async_setTimeout_stack_across_globals.html
                    @@ -0,0 +1,60 @@
                    +
                    +
                    +
                    +
                    +  
                    +  Test for Bug 1142577 - Async stacks for setTimeout
                    +  
                    +  
                    +
                    +
                    +  Mozilla Bug 1142577
                    +  
                    
                    +  
                    +  
                    +
                    +
                    diff --git a/dom/base/test/test_base.xhtml b/dom/base/test/test_base.xhtml
                    new file mode 100644
                    index 0000000000..b61bc72f68
                    --- /dev/null
                    +++ b/dom/base/test/test_base.xhtml
                    @@ -0,0 +1,39 @@
                    +
                    +
                    +  Test for base URIs
                    +  
                    +  
                    +  
                    +
                    +
                    +

                    text

                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_blockParsing.html b/dom/base/test/test_blockParsing.html new file mode 100644 index 0000000000..05f104ce62 --- /dev/null +++ b/dom/base/test/test_blockParsing.html @@ -0,0 +1,134 @@ + + + + Test for document.blockParsing + + + + + + + diff --git a/dom/base/test/test_blocking_image.html b/dom/base/test/test_blocking_image.html new file mode 100644 index 0000000000..64924b0dab --- /dev/null +++ b/dom/base/test/test_blocking_image.html @@ -0,0 +1,94 @@ + + + + + Test for Bug 1267075 + + + + + +Mozilla Bug 1267075 +
                    +
                    +
                    +

                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1008126.html b/dom/base/test/test_bug1008126.html new file mode 100644 index 0000000000..414f2727ec --- /dev/null +++ b/dom/base/test/test_bug1008126.html @@ -0,0 +1,62 @@ + + + + + + + Test for Bug 1008126 + + + + +Mozilla Bug 1008126 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1016960.html b/dom/base/test/test_bug1016960.html new file mode 100644 index 0000000000..d801a1dba5 --- /dev/null +++ b/dom/base/test/test_bug1016960.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1016960 + + + + + +Mozilla Bug 1016960 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1022229.html b/dom/base/test/test_bug1022229.html new file mode 100644 index 0000000000..7663cc22d0 --- /dev/null +++ b/dom/base/test/test_bug1022229.html @@ -0,0 +1,33 @@ + + + + + + Test for Bug 1022229 + + + + + +Mozilla Bug 1022229 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1025933.html b/dom/base/test/test_bug1025933.html new file mode 100644 index 0000000000..e578ebef20 --- /dev/null +++ b/dom/base/test/test_bug1025933.html @@ -0,0 +1,41 @@ + + + + + + Test for Bug 1025933 + + + + + +Mozilla Bug 1025933 +

                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1037687.html b/dom/base/test/test_bug1037687.html new file mode 100644 index 0000000000..62f886c837 --- /dev/null +++ b/dom/base/test/test_bug1037687.html @@ -0,0 +1,32 @@ + + + + + + Test for Bug 1037687 + + + + +Mozilla Bug 1037687 +

                    + +
                    +
                    + + + diff --git a/dom/base/test/test_bug1037687_subframe.html b/dom/base/test/test_bug1037687_subframe.html new file mode 100644 index 0000000000..4258f772b6 --- /dev/null +++ b/dom/base/test/test_bug1037687_subframe.html @@ -0,0 +1,46 @@ + + + + + + +
                    + + diff --git a/dom/base/test/test_bug1043106.html b/dom/base/test/test_bug1043106.html new file mode 100644 index 0000000000..42d6cfff57 --- /dev/null +++ b/dom/base/test/test_bug1043106.html @@ -0,0 +1,44 @@ + + + + + + Test for Bug 1043106 + + + + + Mozilla Bug 1043106 + + + + diff --git a/dom/base/test/test_bug1057176.html b/dom/base/test/test_bug1057176.html new file mode 100644 index 0000000000..e9e516ac1e --- /dev/null +++ b/dom/base/test/test_bug1057176.html @@ -0,0 +1,32 @@ + + + + + + Test for Bug 1057176 + + + + + +Mozilla Bug 1057176 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1060938.html b/dom/base/test/test_bug1060938.html new file mode 100644 index 0000000000..451ed0d6fb --- /dev/null +++ b/dom/base/test/test_bug1060938.html @@ -0,0 +1,44 @@ + + + + + + Test for Bug 1060938 + + + + + + Mozilla Bug 1060938 +

                    + +
                    +  
                    +  
                    +
                    diff --git a/dom/base/test/test_bug1064481.html b/dom/base/test/test_bug1064481.html
                    new file mode 100644
                    index 0000000000..9ce32f4d49
                    --- /dev/null
                    +++ b/dom/base/test/test_bug1064481.html
                    @@ -0,0 +1,24 @@
                    +
                    +
                    +
                    +
                    +  
                    +  Test for Bug 1064481
                    +  
                    +  
                    +
                    +
                    +  Mozilla Bug 1064481
                    +  
                    +  
                    +
                    +
                    diff --git a/dom/base/test/test_bug1070015.html b/dom/base/test/test_bug1070015.html
                    new file mode 100644
                    index 0000000000..5debff4dc0
                    --- /dev/null
                    +++ b/dom/base/test/test_bug1070015.html
                    @@ -0,0 +1,53 @@
                    +
                    +
                    +
                    +
                    +  Test for Bug 1070015
                    +  
                    +  
                    +  
                    +
                    +
                    +Mozilla Bug 1070015
                    +

                    + +
                    +
                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1075702.html b/dom/base/test/test_bug1075702.html new file mode 100644 index 0000000000..a3842a21a5 --- /dev/null +++ b/dom/base/test/test_bug1075702.html @@ -0,0 +1,77 @@ + + + + + + Test for Bug 1075702 + + + + + + Mozilla Bug 1075702 +

                    + +
                    +
                    +
                    +
                    diff --git a/dom/base/test/test_bug1091883.html b/dom/base/test/test_bug1091883.html
                    new file mode 100644
                    index 0000000000..fd2558d89c
                    --- /dev/null
                    +++ b/dom/base/test/test_bug1091883.html
                    @@ -0,0 +1,89 @@
                    +
                    +
                    +
                    +
                    +  
                    +  
                    +  Test for Bug 1091883
                    +  
                    +  
                    +
                    +
                    +

                    Mozilla Bug 1091883

                    +

                    Results

                    +
                    Running...
                    + + + + + diff --git a/dom/base/test/test_bug1100912.html b/dom/base/test/test_bug1100912.html new file mode 100644 index 0000000000..95913e8cdd --- /dev/null +++ b/dom/base/test/test_bug1100912.html @@ -0,0 +1,35 @@ + + + + + + Test for Bug 1100912 + + + + + +Mozilla Bug 1100912 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1101364.html b/dom/base/test/test_bug1101364.html new file mode 100644 index 0000000000..f3794d3dd0 --- /dev/null +++ b/dom/base/test/test_bug1101364.html @@ -0,0 +1,93 @@ + + + + +Test for Bug 1101364 + + + + + + + + + + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1118689.html b/dom/base/test/test_bug1118689.html new file mode 100644 index 0000000000..e073b6fcfa --- /dev/null +++ b/dom/base/test/test_bug1118689.html @@ -0,0 +1,40 @@ + + + + + + Test for Bug 1118689 + + + + + +Mozilla Bug 1118689 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1120222.html b/dom/base/test/test_bug1120222.html new file mode 100644 index 0000000000..f4f1bf8faa --- /dev/null +++ b/dom/base/test/test_bug1120222.html @@ -0,0 +1,31 @@ + + + + + + Test document-title-changed observer + + + + + + + diff --git a/dom/base/test/test_bug1126851.html b/dom/base/test/test_bug1126851.html new file mode 100644 index 0000000000..117aabb530 --- /dev/null +++ b/dom/base/test/test_bug1126851.html @@ -0,0 +1,44 @@ + + + + + + Test for Bug 1126851 + + + + + +Mozilla Bug 1126851 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug116083.html b/dom/base/test/test_bug116083.html new file mode 100644 index 0000000000..a1736d6cce --- /dev/null +++ b/dom/base/test/test_bug116083.html @@ -0,0 +1,120 @@ + + + + + Test for Bug 116083 + + + + + +Mozilla Bug 116083 +
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    foo bar
                    +
                    bar baz
                    +
                    bar baz
                    +
                    bar baz
                    +
                    bar baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar

                    !


                    baz
                    +
                    foo
                    bar
                    baz
                    qux
                    +
                    foo
                    bar
                    baz
                    qux
                    +
                    foo

                    +
                    foo

                    +
                    foo

                    bar
                    +
                    foo

                    bar
                    +
                    foo
                    bar
                    +
                    foo
                    bar
                    +
                    foo
                    bar
                    baz
                    +
                    foo
                    bar
                    baz
                    +


                    foo
                    +


                    foo
                    +
                    foo
                    bar
                    +
                    foo
                    bar
                    +
                    foo
                    bar
                    +
                    foo
                    bar
                    +
                    foo bar
                    +
                    + + + diff --git a/dom/base/test/test_bug1163743.html b/dom/base/test/test_bug1163743.html new file mode 100644 index 0000000000..1965909284 --- /dev/null +++ b/dom/base/test/test_bug1163743.html @@ -0,0 +1,44 @@ + + + + + + + Test policies for Bug 1163743 + + + + + + + + + + + + + diff --git a/dom/base/test/test_bug1165501.html b/dom/base/test/test_bug1165501.html new file mode 100644 index 0000000000..d0f98a9b05 --- /dev/null +++ b/dom/base/test/test_bug1165501.html @@ -0,0 +1,51 @@ + + + + + + + Test policies for Bug 1165501 + + + + + + + + + + + + + diff --git a/dom/base/test/test_bug1187157.html b/dom/base/test/test_bug1187157.html new file mode 100644 index 0000000000..d96c11e635 --- /dev/null +++ b/dom/base/test/test_bug1187157.html @@ -0,0 +1,30 @@ + + + + + + Test for Bug 1187157 + + + + +Mozilla Bug 1187157 +
                    + + + + + diff --git a/dom/base/test/test_bug1198095.html b/dom/base/test/test_bug1198095.html new file mode 100644 index 0000000000..bcc005d897 --- /dev/null +++ b/dom/base/test/test_bug1198095.html @@ -0,0 +1,71 @@ + + + + + Test for Bug 1198095 + + + + + +Mozilla Bug 1198095 + +
                    +
                    +
                    + diff --git a/dom/base/test/test_bug1222633.html b/dom/base/test/test_bug1222633.html new file mode 100644 index 0000000000..f2f83145de --- /dev/null +++ b/dom/base/test/test_bug1222633.html @@ -0,0 +1,112 @@ + + + + + Test for Bug 1222633 + + + + +Mozilla Bug 1222633 +

                    + + + + diff --git a/dom/base/test/test_bug1222633_link_update.html b/dom/base/test/test_bug1222633_link_update.html new file mode 100644 index 0000000000..07c6662085 --- /dev/null +++ b/dom/base/test/test_bug1222633_link_update.html @@ -0,0 +1,129 @@ + + + + + Test for Bug 1222633 + + + + +Mozilla Bug 1222633 +

                    + + + + diff --git a/dom/base/test/test_bug1238440.html b/dom/base/test/test_bug1238440.html new file mode 100644 index 0000000000..528b337c00 --- /dev/null +++ b/dom/base/test/test_bug1238440.html @@ -0,0 +1,88 @@ + + + + + Test - bug 1238440 + + + + + + + + diff --git a/dom/base/test/test_bug1250148.html b/dom/base/test/test_bug1250148.html new file mode 100644 index 0000000000..b32124ded6 --- /dev/null +++ b/dom/base/test/test_bug1250148.html @@ -0,0 +1,64 @@ + + + + + + Test for Bug 1250148 - FormData and HTML submission compatibility + + + + +
                    + + + diff --git a/dom/base/test/test_bug1259588.html b/dom/base/test/test_bug1259588.html new file mode 100644 index 0000000000..40a272f905 --- /dev/null +++ b/dom/base/test/test_bug1259588.html @@ -0,0 +1,13 @@ + + +Test for Bug 1259588 + + +
                    + diff --git a/dom/base/test/test_bug1268962.html b/dom/base/test/test_bug1268962.html new file mode 100644 index 0000000000..54f99f8456 --- /dev/null +++ b/dom/base/test/test_bug1268962.html @@ -0,0 +1,104 @@ + + + + + Test for Bug 1268962 + + + + +Mozilla Bug 1268962 +

                    + + + + diff --git a/dom/base/test/test_bug1274806.html b/dom/base/test/test_bug1274806.html new file mode 100644 index 0000000000..c8ccb0bc65 --- /dev/null +++ b/dom/base/test/test_bug1274806.html @@ -0,0 +1,31 @@ + + + + + + Test for Bug 1274806 + + + + + +Mozilla Bug 1274806 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1281963.html b/dom/base/test/test_bug1281963.html new file mode 100644 index 0000000000..b2d48cc7ec --- /dev/null +++ b/dom/base/test/test_bug1281963.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 1281963 + + + + +

                    +
                    + + + + + diff --git a/dom/base/test/test_bug1295852.html b/dom/base/test/test_bug1295852.html new file mode 100644 index 0000000000..e8049f30a8 --- /dev/null +++ b/dom/base/test/test_bug1295852.html @@ -0,0 +1,23 @@ + + +Bug 1295852 + + + + diff --git a/dom/base/test/test_bug1307730.html b/dom/base/test/test_bug1307730.html new file mode 100644 index 0000000000..e0cad741f9 --- /dev/null +++ b/dom/base/test/test_bug1307730.html @@ -0,0 +1,44 @@ + + + + + Test for Bug 1307730 + + + + +Mozilla Bug 1307730 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1308069.html b/dom/base/test/test_bug1308069.html new file mode 100644 index 0000000000..2775ff1b7e --- /dev/null +++ b/dom/base/test/test_bug1308069.html @@ -0,0 +1,87 @@ + + + + +Bug 1308069 + + + + +Mozilla Bug 1308069 + + + diff --git a/dom/base/test/test_bug1314032.html b/dom/base/test/test_bug1314032.html new file mode 100644 index 0000000000..693eba2f62 --- /dev/null +++ b/dom/base/test/test_bug1314032.html @@ -0,0 +1,38 @@ + + + + + Test for Bug 1314032 + + + + +Mozilla Bug 1243846 +

                    +
                    +
                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1318303.html b/dom/base/test/test_bug1318303.html new file mode 100644 index 0000000000..86053b2d7e --- /dev/null +++ b/dom/base/test/test_bug1318303.html @@ -0,0 +1,49 @@ + + + + + + Test for Bug 1318303 + + + + + + diff --git a/dom/base/test/test_bug1375050.html b/dom/base/test/test_bug1375050.html new file mode 100644 index 0000000000..5f598d7469 --- /dev/null +++ b/dom/base/test/test_bug1375050.html @@ -0,0 +1,33 @@ + + + + + + Test for Bug 1375050 + + + + + +Mozilla Bug 1375050 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1381710.html b/dom/base/test/test_bug1381710.html new file mode 100644 index 0000000000..97531d1426 --- /dev/null +++ b/dom/base/test/test_bug1381710.html @@ -0,0 +1,40 @@ + + + + + Test for Mozilla Bug 1381710 + + + + +Mozilla Bug 1381710 +
                    +
                    +
                    +
                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1399605.html b/dom/base/test/test_bug1399605.html new file mode 100644 index 0000000000..a8e0c6453d --- /dev/null +++ b/dom/base/test/test_bug1399605.html @@ -0,0 +1,32 @@ + + + + + Test for Bug 1399605 + + + + +Mozilla Bug 1399605 +

                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1404385.html b/dom/base/test/test_bug1404385.html new file mode 100644 index 0000000000..828a44918f --- /dev/null +++ b/dom/base/test/test_bug1404385.html @@ -0,0 +1,31 @@ + + + + + Test for Bug 1404385 + + + + +Mozilla Bug 1404385 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1406102.html b/dom/base/test/test_bug1406102.html new file mode 100644 index 0000000000..a561f1e8b6 --- /dev/null +++ b/dom/base/test/test_bug1406102.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 1406102 + + + + + +Mozilla Bug 1406102 +

                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1421568.html b/dom/base/test/test_bug1421568.html new file mode 100644 index 0000000000..f4864c81c1 --- /dev/null +++ b/dom/base/test/test_bug1421568.html @@ -0,0 +1,48 @@ + + + + + + Test for Bug 1421568 + + + + + +Mozilla Bug 1421568 +

                    +
                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1433073.html b/dom/base/test/test_bug1433073.html new file mode 100644 index 0000000000..7fe91aa287 --- /dev/null +++ b/dom/base/test/test_bug1433073.html @@ -0,0 +1,89 @@ + + + + + Test bug 1433073 + + + + + + +Mozilla Bug 1433073 +

                    +
                    + + + + + + + + + + + +
                    xy
                    uv
                    +
                    + + diff --git a/dom/base/test/test_bug1472427.html b/dom/base/test/test_bug1472427.html new file mode 100644 index 0000000000..902b9cd05b --- /dev/null +++ b/dom/base/test/test_bug1472427.html @@ -0,0 +1,89 @@ + + + + + + Test for Bug 1472427 + + + + + + +Mozilla Bug 1472427 +

                    + +
                    +
                    + + diff --git a/dom/base/test/test_bug1499169.html b/dom/base/test/test_bug1499169.html new file mode 100644 index 0000000000..7d5141797d --- /dev/null +++ b/dom/base/test/test_bug1499169.html @@ -0,0 +1,32 @@ + + + + + + Test for Bug 1499169 + + + + + + + Mozilla Bug 1499169 + + + diff --git a/dom/base/test/test_bug1576154.html b/dom/base/test/test_bug1576154.html new file mode 100644 index 0000000000..eca8db6275 --- /dev/null +++ b/dom/base/test/test_bug1576154.html @@ -0,0 +1,36 @@ + + + + + Test for Bug 1576154 + + + + + +Mozilla Bug 1576154 +

                    + + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1632975.html b/dom/base/test/test_bug1632975.html new file mode 100644 index 0000000000..8b54ca47a5 --- /dev/null +++ b/dom/base/test/test_bug1632975.html @@ -0,0 +1,54 @@ + + + + + Test for Bug 1632975 + + + + + + +Mozilla Bug 1632975 +

                    + + + diff --git a/dom/base/test/test_bug1639328.html b/dom/base/test/test_bug1639328.html new file mode 100644 index 0000000000..f7d88de5a4 --- /dev/null +++ b/dom/base/test/test_bug1639328.html @@ -0,0 +1,68 @@ + + +Test for bug 1639328 + + + + + + + + + + diff --git a/dom/base/test/test_bug1640766.html b/dom/base/test/test_bug1640766.html new file mode 100644 index 0000000000..ea77c99e59 --- /dev/null +++ b/dom/base/test/test_bug1640766.html @@ -0,0 +1,67 @@ + + + + + Test for Bug 1640766 + + + + +Mozilla Bug 1640766 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1648887.html b/dom/base/test/test_bug1648887.html new file mode 100644 index 0000000000..a185086137 --- /dev/null +++ b/dom/base/test/test_bug1648887.html @@ -0,0 +1,34 @@ + + + + +Test for Bug 1648887 + + + + +Mozilla Bug 1648887 +

                    + + +
                    + + diff --git a/dom/base/test/test_bug166235.html b/dom/base/test/test_bug166235.html new file mode 100644 index 0000000000..9743d725f6 --- /dev/null +++ b/dom/base/test/test_bug166235.html @@ -0,0 +1,156 @@ + + + + + Test for Bug 166235 + + + + +Mozilla Bug 166235 and Bug 816298 +

                    This text should be copied.

                    +

                    This text should NOT be copied.

                    +

                    This text should NOT be copied.

                    +

                    This text should NOT be copied.

                    +

                    This text should NOT be copied.

                    +

                    This text should be copied.

                    + + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug1667316.html b/dom/base/test/test_bug1667316.html new file mode 100644 index 0000000000..2770d58dd4 --- /dev/null +++ b/dom/base/test/test_bug1667316.html @@ -0,0 +1,153 @@ + + + + + Test for Bug 1667316 + + + + +Mozilla Bug 1667316 +

                    + + + + diff --git a/dom/base/test/test_bug1730284.html b/dom/base/test/test_bug1730284.html new file mode 100644 index 0000000000..6a24f69b05 --- /dev/null +++ b/dom/base/test/test_bug1730284.html @@ -0,0 +1,71 @@ + + +Test for bug 1730284 (throttling of same-origin iframes) + + + + + + + + +
                    +
                    + +
                    + + + + + diff --git a/dom/base/test/test_bug1739957.html b/dom/base/test/test_bug1739957.html new file mode 100644 index 0000000000..fdfe1e3861 --- /dev/null +++ b/dom/base/test/test_bug1739957.html @@ -0,0 +1,40 @@ + + + + + Importing a node should respect sandbox + + + + + +

                    + + +
                    
                    +
                    +
                    diff --git a/dom/base/test/test_bug1784187.html b/dom/base/test/test_bug1784187.html
                    new file mode 100644
                    index 0000000000..6f9f782e3e
                    --- /dev/null
                    +++ b/dom/base/test/test_bug1784187.html
                    @@ -0,0 +1,38 @@
                    +
                    +
                    +
                    +
                    +  Test for Bug 1784187
                    +  
                    +  
                    +  
                    +
                    +
                    +
                    +Mozilla Bug 1784187
                    +

                    + + + + diff --git a/dom/base/test/test_bug1799354.html b/dom/base/test/test_bug1799354.html new file mode 100644 index 0000000000..ba2177d576 --- /dev/null +++ b/dom/base/test/test_bug1799354.html @@ -0,0 +1,77 @@ + + + + + Test bug 1799354 + + + + + +

                    + +
                    
                    +
                    +
                    diff --git a/dom/base/test/test_bug199959.html b/dom/base/test/test_bug199959.html
                    new file mode 100644
                    index 0000000000..e807646c10
                    --- /dev/null
                    +++ b/dom/base/test/test_bug199959.html
                    @@ -0,0 +1,39 @@
                    +
                    +
                    +
                    +
                    +  Test for Bug 199959
                    +  
                    +  
                    +
                    +
                    +Mozilla Bug 199959
                    +

                    + +
                    +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug218236.html b/dom/base/test/test_bug218236.html new file mode 100644 index 0000000000..d691ad4418 --- /dev/null +++ b/dom/base/test/test_bug218236.html @@ -0,0 +1,139 @@ + + + + + Test for Bug 218236 + + + + +Mozilla Bug 218236 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug218277.html b/dom/base/test/test_bug218277.html new file mode 100644 index 0000000000..bcad1dafd7 --- /dev/null +++ b/dom/base/test/test_bug218277.html @@ -0,0 +1,28 @@ + + + + + Test for Bug 218277 + + + + +Mozilla Bug 218277 +

                    +
                    + +
                    +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug238409.html b/dom/base/test/test_bug238409.html new file mode 100644 index 0000000000..ac0b261548 --- /dev/null +++ b/dom/base/test/test_bug238409.html @@ -0,0 +1,45 @@ + + + + + Test for Bug 238409 + + + + +Mozilla Bug 238409 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug254337.html b/dom/base/test/test_bug254337.html new file mode 100644 index 0000000000..1c68b18c14 --- /dev/null +++ b/dom/base/test/test_bug254337.html @@ -0,0 +1,42 @@ + + + + + Test for Bug 254337 + + + + +Mozilla Bug 254337 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug270145.xhtml b/dom/base/test/test_bug270145.xhtml new file mode 100644 index 0000000000..ebf89ef5ca --- /dev/null +++ b/dom/base/test/test_bug270145.xhtml @@ -0,0 +1,51 @@ + + + + Test the html copy encoder with XHTML + + + + +Mozilla Bug 270145 +

                    +
                    +

                    +
                    +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug276037-1.html b/dom/base/test/test_bug276037-1.html new file mode 100644 index 0000000000..2216480337 --- /dev/null +++ b/dom/base/test/test_bug276037-1.html @@ -0,0 +1,105 @@ + + + + + Test for Bug 276037 + + + + +Mozilla Bug 276037 +

                    + +
                    +
                    +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +
                    + + + diff --git a/dom/base/test/test_bug276037-2.xhtml b/dom/base/test/test_bug276037-2.xhtml new file mode 100644 index 0000000000..d0155a4168 --- /dev/null +++ b/dom/base/test/test_bug276037-2.xhtml @@ -0,0 +1,106 @@ + + + + Test for Bug 276037 + + + + +Mozilla Bug 276037 +

                    + +
                    +
                    +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +

                    Static text in span.

                    + +
                    + + + diff --git a/dom/base/test/test_bug282547.html b/dom/base/test/test_bug282547.html new file mode 100644 index 0000000000..4c310a2724 --- /dev/null +++ b/dom/base/test/test_bug282547.html @@ -0,0 +1,104 @@ + + + + + Test for Bug 282547 + + + + +Mozilla Bug 282547 +

                    + + + + + + diff --git a/dom/base/test/test_bug28293.html b/dom/base/test/test_bug28293.html new file mode 100644 index 0000000000..332c75e42b --- /dev/null +++ b/dom/base/test/test_bug28293.html @@ -0,0 +1,86 @@ + + + + + Test for Bug 28293 + + + + + +Mozilla Bug 28293 + + + + + + + + + + + + + diff --git a/dom/base/test/test_bug28293.xhtml b/dom/base/test/test_bug28293.xhtml new file mode 100644 index 0000000000..47d73a01b4 --- /dev/null +++ b/dom/base/test/test_bug28293.xhtml @@ -0,0 +1,87 @@ + + + + Test for Bug 28293 + + + + + +Mozilla Bug 28293 + + + + + + + + + + + + + diff --git a/dom/base/test/test_bug298064.html b/dom/base/test/test_bug298064.html new file mode 100644 index 0000000000..6fd21e5129 --- /dev/null +++ b/dom/base/test/test_bug298064.html @@ -0,0 +1,32 @@ + + + + + Test for Bug 298064 + + + + +Mozilla Bug 298064 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug300992.html b/dom/base/test/test_bug300992.html new file mode 100644 index 0000000000..c9059bea85 --- /dev/null +++ b/dom/base/test/test_bug300992.html @@ -0,0 +1,45 @@ + + + + + Test for Bug 300992 + + + + +Mozilla Bug 300992 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug311681.xml b/dom/base/test/test_bug311681.xml new file mode 100644 index 0000000000..23efcb4688 --- /dev/null +++ b/dom/base/test/test_bug311681.xml @@ -0,0 +1,103 @@ + + + + Test for Bug 311681 + + + + +Mozilla Bug 311681 + +

                    + +
                    +
                    + + + diff --git a/dom/base/test/test_bug313646.html b/dom/base/test/test_bug313646.html new file mode 100644 index 0000000000..55bb760978 --- /dev/null +++ b/dom/base/test/test_bug313646.html @@ -0,0 +1,62 @@ + + + + + Test for Bug 313646 + + + + +Mozilla Bug 313646 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug320799.html b/dom/base/test/test_bug320799.html new file mode 100644 index 0000000000..dd7f598a0f --- /dev/null +++ b/dom/base/test/test_bug320799.html @@ -0,0 +1,74 @@ + + + + + Test for Bug 320799 + + + + +Mozilla Bug 320799 +

                    + + + + +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug322317.html b/dom/base/test/test_bug322317.html new file mode 100644 index 0000000000..d4e7b6f853 --- /dev/null +++ b/dom/base/test/test_bug322317.html @@ -0,0 +1,33 @@ + + + + + Test for Bug 322317 + + + + +Mozilla Bug 322317 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug326337.html b/dom/base/test/test_bug326337.html new file mode 100644 index 0000000000..fc789018cb --- /dev/null +++ b/dom/base/test/test_bug326337.html @@ -0,0 +1,35 @@ + + + + + Test for Bug 326337 + + + + +Mozilla Bug 326337 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug331959.html b/dom/base/test/test_bug331959.html new file mode 100644 index 0000000000..c098c55d7b --- /dev/null +++ b/dom/base/test/test_bug331959.html @@ -0,0 +1,151 @@ + + + + + Test for Bug 331959 + + + + + +Mozilla Bug 331959 +

                    + + + + + + +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug333064.html b/dom/base/test/test_bug333064.html new file mode 100644 index 0000000000..65cc893a42 --- /dev/null +++ b/dom/base/test/test_bug333064.html @@ -0,0 +1,59 @@ + + + + + Test for Bug 333064 + + + + + +Mozilla Bug 333064 +

                    + +
                    +
                    +
                    안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안
                    + +
                    +
                    + + + + + diff --git a/dom/base/test/test_bug333198.html b/dom/base/test/test_bug333198.html new file mode 100644 index 0000000000..e1c09000e8 --- /dev/null +++ b/dom/base/test/test_bug333198.html @@ -0,0 +1,84 @@ + + + + + Test for Bug 333198 + + + + + +
                    +Mozilla Bug 333198 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug333673.html b/dom/base/test/test_bug333673.html new file mode 100644 index 0000000000..2e8547b56c --- /dev/null +++ b/dom/base/test/test_bug333673.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 333673 + + + + +Mozilla Bug 333673 +

                    + +
                    +
                    +
                    + + diff --git a/dom/base/test/test_bug337631.html b/dom/base/test/test_bug337631.html new file mode 100644 index 0000000000..ad8d4e3d5a --- /dev/null +++ b/dom/base/test/test_bug337631.html @@ -0,0 +1,99 @@ + + + + + Test for Bug 337631 + + + + +Mozilla Bug 337631 +

                    +
                    + +foo + +

                    adsfasdf

                    + +
                    +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug338541.xhtml b/dom/base/test/test_bug338541.xhtml new file mode 100644 index 0000000000..9a83332a13 --- /dev/null +++ b/dom/base/test/test_bug338541.xhtml @@ -0,0 +1,49 @@ + + + + Test for Bug 338541 + + + + +Mozilla Bug 338541 +

                    +
                    +
                    +
                    + + + + diff --git a/dom/base/test/test_bug338583.html b/dom/base/test/test_bug338583.html new file mode 100644 index 0000000000..a399dd490c --- /dev/null +++ b/dom/base/test/test_bug338583.html @@ -0,0 +1,665 @@ + + + + + + Test for Bug 338583 + + + + + + +Mozilla Bug 338583 +

                    + +
                    +
                    +
                    + Wait please... + + diff --git a/dom/base/test/test_bug338679.html b/dom/base/test/test_bug338679.html new file mode 100644 index 0000000000..bcc214f349 --- /dev/null +++ b/dom/base/test/test_bug338679.html @@ -0,0 +1,82 @@ + + + + +Bug 338679: correct reporting of newValue/prevValue in + DOMAttrModified events + + + + +Bug + 338679: correct reporting of newValue/prevValue in + DOMAttrModified events + +
                    + + + + diff --git a/dom/base/test/test_bug339494.html b/dom/base/test/test_bug339494.html new file mode 100644 index 0000000000..dbf81f5e98 --- /dev/null +++ b/dom/base/test/test_bug339494.html @@ -0,0 +1,59 @@ + + + + + Test for Bug 339494 + + + + +Mozilla Bug 339494 +

                    + +
                    +
                    +
                    + + + diff --git a/dom/base/test/test_bug339494.xhtml b/dom/base/test/test_bug339494.xhtml new file mode 100644 index 0000000000..985d78b368 --- /dev/null +++ b/dom/base/test/test_bug339494.xhtml @@ -0,0 +1,58 @@ + + + + Test for Bug 339494 + + + + +Mozilla Bug 339494 +

                    +