From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- toolkit/content/tests/browser/audio.ogg | Bin 0 -> 14290 bytes toolkit/content/tests/browser/audio_file.txt | 1 + toolkit/content/tests/browser/browser.ini | 149 ++ .../content/tests/browser/browser_about_logging.js | 464 +++++ .../tests/browser/browser_about_networking.js | 47 + .../tests/browser/browser_autoscroll_disabled.js | 82 + ...wser_autoscroll_disabled_on_editable_content.js | 306 +++ .../browser_autoscroll_disabled_on_links.js | 125 ++ .../content/tests/browser/browser_bug1170531.js | 139 ++ .../content/tests/browser/browser_bug1198465.js | 76 + .../content/tests/browser/browser_bug1572798.js | 29 + .../content/tests/browser/browser_bug1693577.js | 49 + .../browser_bug295977_autoscroll_overflow.js | 389 ++++ toolkit/content/tests/browser/browser_bug451286.js | 166 ++ toolkit/content/tests/browser/browser_bug594509.js | 15 + toolkit/content/tests/browser/browser_bug982298.js | 77 + ...ng_autoscrolling_requested_by_background_tab.js | 156 ++ .../browser_charsetMenu_disable_on_ascii.js | 18 + .../browser/browser_charsetMenu_swapBrowsers.js | 39 + .../browser_click_event_during_autoscrolling.js | 577 ++++++ .../content/tests/browser/browser_contentTitle.js | 17 + .../browser/browser_content_url_annotation.js | 78 + .../browser/browser_crash_previous_frameloader.js | 131 ++ .../browser/browser_default_audio_filename.js | 98 + .../browser_default_image_filename_redirect.js | 53 + .../browser_delay_autoplay_cross_origin_iframe.js | 91 + ...owser_delay_autoplay_cross_origin_navigation.js | 65 + .../tests/browser/browser_delay_autoplay_media.js | 145 ++ ...browser_delay_autoplay_media_pausedAfterPlay.js | 121 ++ .../browser_delay_autoplay_multipleMedia.js | 77 + .../browser_delay_autoplay_notInTreeAudio.js | 66 + .../browser_delay_autoplay_playAfterTabVisible.js | 68 + .../browser_delay_autoplay_playMediaInMuteTab.js | 97 + ...rowser_delay_autoplay_silentAudioTrack_media.js | 63 + .../browser/browser_delay_autoplay_webAudio.js | 42 + .../tests/browser/browser_f7_caret_browsing.js | 367 ++++ toolkit/content/tests/browser/browser_findbar.js | 560 +++++ .../browser/browser_findbar_disabled_manual.js | 33 + .../tests/browser/browser_findbar_hiddenframes.js | 59 + .../content/tests/browser/browser_findbar_marks.js | 263 +++ .../content/tests/browser/browser_isSynthetic.js | 69 + .../browser_keyevents_during_autoscrolling.js | 129 ++ .../tests/browser/browser_label_textlink.js | 65 + .../content/tests/browser/browser_license_links.js | 27 + .../tests/browser/browser_mediaStreamPlayback.html | 24 + .../browser_mediaStreamPlaybackWithoutAudio.html | 17 + .../tests/browser/browser_media_wakelock.js | 159 ++ .../tests/browser/browser_media_wakelock_PIP.js | 155 ++ .../browser/browser_media_wakelock_webaudio.js | 127 ++ ...rowser_moz_support_link_open_links_in_chrome.js | 85 + .../tests/browser/browser_quickfind_editable.js | 59 + .../browser/browser_remoteness_change_listeners.js | 39 + .../browser_resume_bkg_video_on_tab_hover.js | 154 ++ .../tests/browser/browser_richlistbox_keyboard.js | 81 + .../content/tests/browser/browser_saveImageURL.js | 76 + .../browser_save_folder_standalone_image.js | 81 + .../tests/browser/browser_save_resend_postdata.js | 169 ++ ...browser_starting_autoscroll_in_about_content.js | 74 + .../browser_suspend_videos_outside_viewport.js | 39 + .../content/tests/browser/common/mockTransfer.js | 85 + .../content/tests/browser/data/post_form_inner.sjs | 33 + .../content/tests/browser/data/post_form_outer.sjs | 36 + toolkit/content/tests/browser/datetime/browser.ini | 74 + .../browser/datetime/browser_datetime_blur.js | 265 +++ .../datetime/browser_datetime_datepicker.js | 369 ++++ .../datetime/browser_datetime_datepicker_clear.js | 56 + .../datetime/browser_datetime_datepicker_focus.js | 191 ++ .../datetime/browser_datetime_datepicker_keynav.js | 576 ++++++ .../datetime/browser_datetime_datepicker_markup.js | 483 +++++ .../browser_datetime_datepicker_min_max.js | 405 ++++ .../browser_datetime_datepicker_monthyear.js | 209 ++ .../browser_datetime_datepicker_mousenav.js | 201 ++ .../browser_datetime_datepicker_prev_next_month.js | 534 +++++ .../datetime/browser_datetime_showPicker.js | 52 + .../browser/datetime/browser_datetime_toplevel.js | 27 + .../tests/browser/datetime/browser_spinner.js | 180 ++ .../browser/datetime/browser_spinner_keynav.js | 622 ++++++ toolkit/content/tests/browser/datetime/head.js | 441 ++++ toolkit/content/tests/browser/doggy.png | Bin 0 -> 46876 bytes toolkit/content/tests/browser/empty.png | Bin 0 -> 14528 bytes .../content/tests/browser/file_contentTitle.html | 14 + .../tests/browser/file_document_open_audio.html | 11 + toolkit/content/tests/browser/file_empty.html | 8 + .../content/tests/browser/file_findinframe.html | 5 + .../content/tests/browser/file_iframe_media.html | 14 + .../content/tests/browser/file_mediaPlayback2.html | 14 + .../content/tests/browser/file_multipleAudio.html | 19 + .../tests/browser/file_multiplePlayingAudio.html | 23 + .../tests/browser/file_nonAutoplayAudio.html | 7 + .../browser/file_outside_viewport_videos.html | 41 + toolkit/content/tests/browser/file_redirect.html | 13 + .../content/tests/browser/file_redirect_to.html | 15 + .../tests/browser/file_silentAudioTrack.html | 18 + toolkit/content/tests/browser/file_video.html | 9 + .../tests/browser/file_videoWithAudioOnly.html | 9 + .../tests/browser/file_videoWithoutAudioTrack.html | 9 + toolkit/content/tests/browser/file_webAudio.html | 29 + toolkit/content/tests/browser/firebird.png | Bin 0 -> 16179 bytes .../content/tests/browser/firebird.png^headers^ | 2 + toolkit/content/tests/browser/gizmo-noaudio.webm | Bin 0 -> 112663 bytes toolkit/content/tests/browser/gizmo.mp4 | Bin 0 -> 455255 bytes toolkit/content/tests/browser/head.js | 244 +++ toolkit/content/tests/browser/image.jpg | Bin 0 -> 24204 bytes toolkit/content/tests/browser/image_page.html | 9 + .../content/tests/browser/silentAudioTrack.webm | Bin 0 -> 224800 bytes .../tests/chrome/RegisterUnregisterChrome.js | 141 ++ .../content/tests/chrome/bug263683_window.xhtml | 202 ++ .../content/tests/chrome/bug304188_window.xhtml | 90 + .../content/tests/chrome/bug331215_window.xhtml | 97 + .../content/tests/chrome/bug360437_window.xhtml | 125 ++ .../content/tests/chrome/bug366992_window.xhtml | 74 + .../content/tests/chrome/bug409624_window.xhtml | 96 + .../content/tests/chrome/bug429723_window.xhtml | 92 + .../content/tests/chrome/bug451540_window.xhtml | 253 +++ .../content/tests/chrome/bug624329_window.xhtml | 22 + toolkit/content/tests/chrome/chrome.ini | 221 ++ toolkit/content/tests/chrome/dialog_button.xhtml | 9 + .../content/tests/chrome/dialog_dialogfocus.xhtml | 62 + .../content/tests/chrome/dialog_dialogfocus2.xhtml | 8 + .../tests/chrome/file_about_networking_wsh.py | 10 + .../chrome/file_autocomplete_with_composition.js | 714 +++++++ .../tests/chrome/file_edit_contextmenu.xhtml | 46 + .../tests/chrome/file_editor_with_autocomplete.js | 627 ++++++ toolkit/content/tests/chrome/file_empty.xhtml | 3 + .../content/tests/chrome/file_maximized_persist.js | 141 ++ .../tests/chrome/findbar_entireword_window.xhtml | 273 +++ .../tests/chrome/findbar_events_window.xhtml | 193 ++ toolkit/content/tests/chrome/findbar_window.xhtml | 788 +++++++ .../content/tests/chrome/frame_popup_anchor.xhtml | 84 + .../tests/chrome/frame_popupremoving_frame.xhtml | 75 + .../chrome/frame_subframe_origin_subframe1.xhtml | 41 + .../chrome/frame_subframe_origin_subframe2.xhtml | 37 + toolkit/content/tests/chrome/popup_trigger.js | 1208 +++++++++++ .../tests/chrome/sample_entireword_latin1.html | 11 + .../tests/chrome/test_about_networking.html | 54 + toolkit/content/tests/chrome/test_arrowpanel.xhtml | 332 +++ .../content/tests/chrome/test_autocomplete2.xhtml | 189 ++ .../content/tests/chrome/test_autocomplete3.xhtml | 200 ++ .../content/tests/chrome/test_autocomplete4.xhtml | 280 +++ .../content/tests/chrome/test_autocomplete5.xhtml | 164 ++ .../tests/chrome/test_autocomplete_emphasis.xhtml | 180 ++ .../tests/chrome/test_autocomplete_mac_caret.xhtml | 80 + ...test_autocomplete_placehold_last_complete.xhtml | 303 +++ ...est_autocomplete_with_composition_on_input.html | 65 + .../content/tests/chrome/test_browser_drop.xhtml | 35 + toolkit/content/tests/chrome/test_bug1048178.xhtml | 83 + toolkit/content/tests/chrome/test_bug263683.xhtml | 39 + toolkit/content/tests/chrome/test_bug304188.xhtml | 37 + toolkit/content/tests/chrome/test_bug331215.xhtml | 38 + toolkit/content/tests/chrome/test_bug360220.xhtml | 61 + toolkit/content/tests/chrome/test_bug360437.xhtml | 40 + toolkit/content/tests/chrome/test_bug365773.xhtml | 67 + toolkit/content/tests/chrome/test_bug366992.xhtml | 40 + toolkit/content/tests/chrome/test_bug382990.xhtml | 44 + toolkit/content/tests/chrome/test_bug409624.xhtml | 38 + toolkit/content/tests/chrome/test_bug418874.xhtml | 64 + toolkit/content/tests/chrome/test_bug429723.xhtml | 38 + toolkit/content/tests/chrome/test_bug451540.xhtml | 39 + toolkit/content/tests/chrome/test_bug457632.xhtml | 160 ++ toolkit/content/tests/chrome/test_bug460942.xhtml | 42 + toolkit/content/tests/chrome/test_bug471776.xhtml | 45 + toolkit/content/tests/chrome/test_bug509732.xhtml | 53 + toolkit/content/tests/chrome/test_bug557987.xhtml | 68 + toolkit/content/tests/chrome/test_bug562554.xhtml | 81 + toolkit/content/tests/chrome/test_bug624329.xhtml | 167 ++ toolkit/content/tests/chrome/test_bug792324.xhtml | 74 + toolkit/content/tests/chrome/test_button.xhtml | 81 + .../content/tests/chrome/test_chromemargin.xhtml | 35 + .../tests/chrome/test_closemenu_attribute.xhtml | 96 + .../tests/chrome/test_contextmenu_list.xhtml | 296 +++ .../tests/chrome/test_contextmenu_rtl.xhtml | 35 + toolkit/content/tests/chrome/test_cursorsnap.xhtml | 123 ++ .../tests/chrome/test_custom_element_base.xhtml | 363 ++++ .../test_custom_element_delay_connection.xhtml | 110 + .../tests/chrome/test_custom_element_parts.html | 44 + toolkit/content/tests/chrome/test_deck.xhtml | 133 ++ .../content/tests/chrome/test_dialog_button.xhtml | 36 + .../content/tests/chrome/test_dialogfocus.xhtml | 137 ++ .../tests/chrome/test_edit_contextmenu.html | 90 + .../test_editor_for_input_with_autocomplete.html | 81 + toolkit/content/tests/chrome/test_findbar.xhtml | 47 + .../tests/chrome/test_findbar_entireword.xhtml | 38 + .../content/tests/chrome/test_findbar_events.xhtml | 38 + toolkit/content/tests/chrome/test_frames.xhtml | 61 + .../content/tests/chrome/test_hiddenitems.xhtml | 76 + .../content/tests/chrome/test_hiddenpaging.xhtml | 83 + toolkit/content/tests/chrome/test_keys.xhtml | 28 + .../content/tests/chrome/test_labelcontrol.xhtml | 54 + toolkit/content/tests/chrome/test_largemenu.html | 26 + .../tests/chrome/test_maximized_persist.xhtml | 18 + .../test_maximized_persist_with_no_titlebar.xhtml | 18 + toolkit/content/tests/chrome/test_menu.xhtml | 75 + .../tests/chrome/test_menu_activateitem.xhtml | 169 ++ toolkit/content/tests/chrome/test_menu_hide.xhtml | 80 + .../tests/chrome/test_menu_mouse_menuactive.xhtml | 91 + .../tests/chrome/test_menu_withcapture.xhtml | 61 + toolkit/content/tests/chrome/test_menuchecks.xhtml | 155 ++ .../content/tests/chrome/test_menuitem_blink.xhtml | 106 + .../tests/chrome/test_menuitem_commands.xhtml | 102 + toolkit/content/tests/chrome/test_menulist.xhtml | 350 ++++ .../tests/chrome/test_menulist_in_popup.xhtml | 57 + .../tests/chrome/test_menulist_keynav.xhtml | 316 +++ .../tests/chrome/test_menulist_null_value.xhtml | 96 + .../tests/chrome/test_menulist_paging.xhtml | 178 ++ .../tests/chrome/test_menulist_position.xhtml | 119 ++ .../content/tests/chrome/test_mousescroll.xhtml | 291 +++ .../tests/chrome/test_mozinputbox_dictionary.xhtml | 100 + toolkit/content/tests/chrome/test_named_deck.html | 249 +++ .../tests/chrome/test_navigate_persist.html | 87 + .../tests/chrome/test_notificationbox.xhtml | 733 +++++++ toolkit/content/tests/chrome/test_panel.xhtml | 29 + .../tests/chrome/test_panel_anchoradjust.xhtml | 29 + .../content/tests/chrome/test_panel_focus.xhtml | 36 + .../tests/chrome/test_panel_hover_menu.xhtml | 46 + toolkit/content/tests/chrome/test_panel_open.xhtml | 83 + .../content/tests/chrome/test_panelfrommenu.xhtml | 118 ++ .../content/tests/chrome/test_popup_anchor.xhtml | 29 + .../tests/chrome/test_popup_anchoratrect.xhtml | 28 + .../tests/chrome/test_popup_attribute.xhtml | 33 + .../content/tests/chrome/test_popup_button.xhtml | 33 + .../content/tests/chrome/test_popup_coords.xhtml | 92 + toolkit/content/tests/chrome/test_popup_keys.xhtml | 143 ++ .../tests/chrome/test_popup_moveToAnchor.xhtml | 86 + .../tests/chrome/test_popup_preventdefault.xhtml | 76 + .../chrome/test_popup_preventdefault_chrome.xhtml | 28 + .../content/tests/chrome/test_popup_recreate.xhtml | 93 + .../content/tests/chrome/test_popup_scaled.xhtml | 98 + toolkit/content/tests/chrome/test_popup_tree.xhtml | 72 + .../content/tests/chrome/test_popuphidden.xhtml | 74 + .../content/tests/chrome/test_popupincontent.xhtml | 137 ++ .../content/tests/chrome/test_popupremoving.xhtml | 165 ++ .../tests/chrome/test_popupremoving_frame.xhtml | 80 + toolkit/content/tests/chrome/test_position.xhtml | 130 ++ .../content/tests/chrome/test_preferences.xhtml | 525 +++++ .../chrome/test_preferences_beforeaccept.xhtml | 65 + .../test_preferences_onsyncfrompreference.xhtml | 59 + toolkit/content/tests/chrome/test_props.xhtml | 87 + toolkit/content/tests/chrome/test_radio.xhtml | 83 + .../content/tests/chrome/test_richlistbox.xhtml | 117 ++ .../tests/chrome/test_screenPersistence.xhtml | 62 + toolkit/content/tests/chrome/test_scrollbar.xhtml | 131 ++ toolkit/content/tests/chrome/test_showcaret.xhtml | 99 + .../tests/chrome/test_subframe_origin.xhtml | 36 + toolkit/content/tests/chrome/test_tabbox.xhtml | 223 ++ toolkit/content/tests/chrome/test_tabindex.xhtml | 136 ++ .../content/tests/chrome/test_textbox_search.xhtml | 175 ++ toolkit/content/tests/chrome/test_tooltip.xhtml | 28 + .../tests/chrome/test_tooltip_noautohide.xhtml | 56 + toolkit/content/tests/chrome/test_tree.xhtml | 84 + toolkit/content/tests/chrome/test_tree_hier.xhtml | 136 ++ .../content/tests/chrome/test_tree_scroll.xhtml | 93 + .../content/tests/chrome/test_tree_single.xhtml | 110 + toolkit/content/tests/chrome/test_tree_view.xhtml | 113 + .../tests/chrome/test_window_intrinsic_size.xhtml | 43 + .../content/tests/chrome/window_browser_drop.xhtml | 247 +++ .../content/tests/chrome/window_chromemargin.xhtml | 69 + .../tests/chrome/window_cursorsnap_dialog.xhtml | 104 + .../tests/chrome/window_cursorsnap_wizard.xhtml | 109 + .../tests/chrome/window_intrinsic_size.xhtml | 7 + toolkit/content/tests/chrome/window_keys.xhtml | 210 ++ .../content/tests/chrome/window_largemenu.xhtml | 430 ++++ .../tests/chrome/window_maximized_persist.xhtml | 15 + ...window_maximized_persist_with_no_titlebar.xhtml | 16 + .../tests/chrome/window_navigate_persist.html | 11 + toolkit/content/tests/chrome/window_panel.xhtml | 294 +++ .../tests/chrome/window_panel_anchoradjust.xhtml | 193 ++ .../content/tests/chrome/window_panel_focus.xhtml | 132 ++ .../content/tests/chrome/window_popup_anchor.xhtml | 28 + .../tests/chrome/window_popup_anchoratrect.xhtml | 130 ++ .../tests/chrome/window_popup_attribute.xhtml | 45 + .../content/tests/chrome/window_popup_button.xhtml | 45 + .../window_popup_preventdefault_chrome.xhtml | 124 ++ .../content/tests/chrome/window_preferences.xhtml | 68 + .../content/tests/chrome/window_preferences2.xhtml | 29 + .../content/tests/chrome/window_preferences3.xhtml | 68 + .../chrome/window_preferences_beforeaccept.xhtml | 49 + .../window_preferences_commandretarget.xhtml | 40 + .../tests/chrome/window_preferences_disabled.xhtml | 38 + .../window_preferences_onsyncfrompreference.xhtml | 55 + .../tests/chrome/window_screenPosSize.xhtml | 17 + .../content/tests/chrome/window_showcaret.xhtml | 11 + .../tests/chrome/window_subframe_origin.xhtml | 40 + toolkit/content/tests/chrome/window_tooltip.xhtml | 375 ++++ toolkit/content/tests/chrome/xul_selectcontrol.js | 689 +++++++ .../content/tests/mochitest/file_mousecapture.html | 1 + .../tests/mochitest/file_mousecapture2.html | 8 + .../tests/mochitest/file_mousecapture3.html | 1 + .../tests/mochitest/file_mousecapture4.html | 1 + .../tests/mochitest/file_mousecapture5.html | 1 + toolkit/content/tests/mochitest/gizmo.mp4 | Bin 0 -> 455255 bytes toolkit/content/tests/mochitest/mochitest.ini | 20 + .../test_autocomplete_change_after_focus.html | 102 + .../content/tests/mochitest/test_bug1407085.html | 38 + .../tests/mochitest/test_mousecapture.xhtml | 351 ++++ .../test_video_control_no_control_overlay.html | 35 + toolkit/content/tests/moz.build | 22 + .../audio-dynamically-change-small-width-ref.html | 13 + .../audio-dynamically-change-small-width.html | 32 + .../tests/reftests/audio-with-bogus-url-ref.html | 14 + .../tests/reftests/audio-with-bogus-url.html | 14 + .../tests/reftests/audio-with-padding-ref.html | 19 + .../content/tests/reftests/audio-with-padding.html | 17 + toolkit/content/tests/reftests/foo.vtt | 4 + toolkit/content/tests/reftests/reftest.list | 4 + .../videocontrols-dynamically-add-cc-ref.html | 32 + .../reftests/videocontrols-dynamically-add-cc.html | 61 + .../content/tests/unit/test_contentAreaUtils.js | 80 + toolkit/content/tests/unit/xpcshell.ini | 4 + toolkit/content/tests/widgets/audio.ogg | Bin 0 -> 14293 bytes toolkit/content/tests/widgets/audio.wav | Bin 0 -> 1422 bytes toolkit/content/tests/widgets/chrome.ini | 45 + .../widgets/file_videocontrols_jsdisabled.html | 2 + toolkit/content/tests/widgets/head.js | 67 + toolkit/content/tests/widgets/image-zh.png | Bin 0 -> 5442 bytes toolkit/content/tests/widgets/image.png | Bin 0 -> 7061 bytes toolkit/content/tests/widgets/mochitest.ini | 68 + toolkit/content/tests/widgets/popup_shared.js | 586 ++++++ toolkit/content/tests/widgets/seek_with_sound.ogg | Bin 0 -> 299507 bytes toolkit/content/tests/widgets/test-webvtt-1.vtt | 10 + toolkit/content/tests/widgets/test-webvtt-2.vtt | 10 + .../widgets/test_audiocontrols_dimensions.html | 66 + .../widgets/test_audiocontrols_fullscreen.html | 61 + toolkit/content/tests/widgets/test_bug1654500.html | 33 + toolkit/content/tests/widgets/test_bug898940.html | 31 + .../tests/widgets/test_contextmenu_menugroup.xhtml | 102 + .../tests/widgets/test_contextmenu_nested.xhtml | 132 ++ .../tests/widgets/test_editor_currentURI.xhtml | 37 + .../tests/widgets/test_image_recognition.html | 67 + .../test_image_recognition_unsupported.html | 36 + .../tests/widgets/test_image_recognition_zh.html | 53 + .../tests/widgets/test_label_checkbox.xhtml | 42 + toolkit/content/tests/widgets/test_menubar.xhtml | 30 + .../tests/widgets/test_mousecapture_area.html | 106 + .../tests/widgets/test_moz_button_group.html | 236 +++ toolkit/content/tests/widgets/test_moz_label.html | 142 ++ .../tests/widgets/test_moz_support_link.html | 153 ++ toolkit/content/tests/widgets/test_moz_toggle.html | 85 + .../content/tests/widgets/test_nac_mutations.html | 65 + .../tests/widgets/test_panel_item_accesskey.html | 105 + .../widgets/test_panel_list_accessibility.html | 79 + .../widgets/test_panel_list_in_xul_panel.html | 87 + .../test_panel_list_min_width_from_anchor.html | 70 + .../test_panel_list_shadow_node_anchor.html | 96 + .../content/tests/widgets/test_popupanchor.xhtml | 387 ++++ .../content/tests/widgets/test_popupreflows.xhtml | 96 + .../tests/widgets/test_tree_column_reorder.xhtml | 75 + .../widgets/test_ua_widget_elementFromPoint.html | 22 + .../tests/widgets/test_ua_widget_sandbox.html | 101 + .../tests/widgets/test_ua_widget_unbind.html | 56 + .../content/tests/widgets/test_videocontrols.html | 564 +++++ .../tests/widgets/test_videocontrols_audio.html | 40 + .../test_videocontrols_audio_direction.html | 31 + .../test_videocontrols_clickToPlay_ariaLabel.html | 56 + .../test_videocontrols_closed_caption_menu.html | 144 ++ .../tests/widgets/test_videocontrols_error.html | 60 + .../tests/widgets/test_videocontrols_focus.html | 111 + .../test_videocontrols_iframe_fullscreen.html | 60 + .../widgets/test_videocontrols_jsdisabled.html | 69 + .../widgets/test_videocontrols_keyhandler.html | 150 ++ .../widgets/test_videocontrols_onclickplay.html | 74 + .../widgets/test_videocontrols_orientation.html | 63 + .../test_videocontrols_scrubber_position.html | 51 + ..._videocontrols_scrubber_position_nopreload.html | 123 ++ .../tests/widgets/test_videocontrols_size.html | 179 ++ .../widgets/test_videocontrols_standalone.html | 131 ++ .../test_videocontrols_video_direction.html | 31 + .../widgets/test_videocontrols_video_noaudio.html | 42 + .../tests/widgets/test_videocontrols_vtt.html | 112 + toolkit/content/tests/widgets/tree_shared.js | 2181 ++++++++++++++++++++ toolkit/content/tests/widgets/video.ogg | Bin 0 -> 285310 bytes .../widgets/videocontrols_direction-1-ref.html | 10 + .../tests/widgets/videocontrols_direction-1a.html | 10 + .../tests/widgets/videocontrols_direction-1b.html | 10 + .../tests/widgets/videocontrols_direction-1c.html | 10 + .../tests/widgets/videocontrols_direction-1d.html | 10 + .../tests/widgets/videocontrols_direction-1e.html | 10 + .../widgets/videocontrols_direction-2-ref.html | 10 + .../tests/widgets/videocontrols_direction-2a.html | 10 + .../tests/widgets/videocontrols_direction-2b.html | 10 + .../tests/widgets/videocontrols_direction-2c.html | 10 + .../tests/widgets/videocontrols_direction-2d.html | 10 + .../tests/widgets/videocontrols_direction-2e.html | 10 + .../tests/widgets/videocontrols_direction_test.js | 119 ++ toolkit/content/tests/widgets/videomask.css | 23 + .../tests/widgets/window_label_checkbox.xhtml | 46 + toolkit/content/tests/widgets/window_menubar.xhtml | 1015 +++++++++ 386 files changed, 44679 insertions(+) create mode 100644 toolkit/content/tests/browser/audio.ogg create mode 100644 toolkit/content/tests/browser/audio_file.txt create mode 100644 toolkit/content/tests/browser/browser.ini create mode 100644 toolkit/content/tests/browser/browser_about_logging.js create mode 100644 toolkit/content/tests/browser/browser_about_networking.js create mode 100644 toolkit/content/tests/browser/browser_autoscroll_disabled.js create mode 100644 toolkit/content/tests/browser/browser_autoscroll_disabled_on_editable_content.js create mode 100644 toolkit/content/tests/browser/browser_autoscroll_disabled_on_links.js create mode 100644 toolkit/content/tests/browser/browser_bug1170531.js create mode 100644 toolkit/content/tests/browser/browser_bug1198465.js create mode 100644 toolkit/content/tests/browser/browser_bug1572798.js create mode 100644 toolkit/content/tests/browser/browser_bug1693577.js create mode 100644 toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js create mode 100644 toolkit/content/tests/browser/browser_bug451286.js create mode 100644 toolkit/content/tests/browser/browser_bug594509.js create mode 100644 toolkit/content/tests/browser/browser_bug982298.js create mode 100644 toolkit/content/tests/browser/browser_cancel_starting_autoscrolling_requested_by_background_tab.js create mode 100644 toolkit/content/tests/browser/browser_charsetMenu_disable_on_ascii.js create mode 100644 toolkit/content/tests/browser/browser_charsetMenu_swapBrowsers.js create mode 100644 toolkit/content/tests/browser/browser_click_event_during_autoscrolling.js create mode 100644 toolkit/content/tests/browser/browser_contentTitle.js create mode 100644 toolkit/content/tests/browser/browser_content_url_annotation.js create mode 100644 toolkit/content/tests/browser/browser_crash_previous_frameloader.js create mode 100644 toolkit/content/tests/browser/browser_default_audio_filename.js create mode 100644 toolkit/content/tests/browser/browser_default_image_filename_redirect.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_cross_origin_iframe.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_cross_origin_navigation.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_media.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_media_pausedAfterPlay.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_multipleMedia.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_notInTreeAudio.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_playAfterTabVisible.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_playMediaInMuteTab.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_silentAudioTrack_media.js create mode 100644 toolkit/content/tests/browser/browser_delay_autoplay_webAudio.js create mode 100644 toolkit/content/tests/browser/browser_f7_caret_browsing.js create mode 100644 toolkit/content/tests/browser/browser_findbar.js create mode 100644 toolkit/content/tests/browser/browser_findbar_disabled_manual.js create mode 100644 toolkit/content/tests/browser/browser_findbar_hiddenframes.js create mode 100644 toolkit/content/tests/browser/browser_findbar_marks.js create mode 100644 toolkit/content/tests/browser/browser_isSynthetic.js create mode 100644 toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js create mode 100644 toolkit/content/tests/browser/browser_label_textlink.js create mode 100644 toolkit/content/tests/browser/browser_license_links.js create mode 100644 toolkit/content/tests/browser/browser_mediaStreamPlayback.html create mode 100644 toolkit/content/tests/browser/browser_mediaStreamPlaybackWithoutAudio.html create mode 100644 toolkit/content/tests/browser/browser_media_wakelock.js create mode 100644 toolkit/content/tests/browser/browser_media_wakelock_PIP.js create mode 100644 toolkit/content/tests/browser/browser_media_wakelock_webaudio.js create mode 100644 toolkit/content/tests/browser/browser_moz_support_link_open_links_in_chrome.js create mode 100644 toolkit/content/tests/browser/browser_quickfind_editable.js create mode 100644 toolkit/content/tests/browser/browser_remoteness_change_listeners.js create mode 100644 toolkit/content/tests/browser/browser_resume_bkg_video_on_tab_hover.js create mode 100644 toolkit/content/tests/browser/browser_richlistbox_keyboard.js create mode 100644 toolkit/content/tests/browser/browser_saveImageURL.js create mode 100644 toolkit/content/tests/browser/browser_save_folder_standalone_image.js create mode 100644 toolkit/content/tests/browser/browser_save_resend_postdata.js create mode 100644 toolkit/content/tests/browser/browser_starting_autoscroll_in_about_content.js create mode 100644 toolkit/content/tests/browser/browser_suspend_videos_outside_viewport.js create mode 100644 toolkit/content/tests/browser/common/mockTransfer.js create mode 100644 toolkit/content/tests/browser/data/post_form_inner.sjs create mode 100644 toolkit/content/tests/browser/data/post_form_outer.sjs create mode 100644 toolkit/content/tests/browser/datetime/browser.ini create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_blur.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_clear.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_focus.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_keynav.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_markup.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_min_max.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_monthyear.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_mousenav.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_datepicker_prev_next_month.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_showPicker.js create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js create mode 100644 toolkit/content/tests/browser/datetime/browser_spinner.js create mode 100644 toolkit/content/tests/browser/datetime/browser_spinner_keynav.js create mode 100644 toolkit/content/tests/browser/datetime/head.js create mode 100644 toolkit/content/tests/browser/doggy.png create mode 100644 toolkit/content/tests/browser/empty.png create mode 100644 toolkit/content/tests/browser/file_contentTitle.html create mode 100644 toolkit/content/tests/browser/file_document_open_audio.html create mode 100644 toolkit/content/tests/browser/file_empty.html create mode 100644 toolkit/content/tests/browser/file_findinframe.html create mode 100644 toolkit/content/tests/browser/file_iframe_media.html create mode 100644 toolkit/content/tests/browser/file_mediaPlayback2.html create mode 100644 toolkit/content/tests/browser/file_multipleAudio.html create mode 100644 toolkit/content/tests/browser/file_multiplePlayingAudio.html create mode 100644 toolkit/content/tests/browser/file_nonAutoplayAudio.html create mode 100644 toolkit/content/tests/browser/file_outside_viewport_videos.html create mode 100644 toolkit/content/tests/browser/file_redirect.html create mode 100644 toolkit/content/tests/browser/file_redirect_to.html create mode 100644 toolkit/content/tests/browser/file_silentAudioTrack.html create mode 100644 toolkit/content/tests/browser/file_video.html create mode 100644 toolkit/content/tests/browser/file_videoWithAudioOnly.html create mode 100644 toolkit/content/tests/browser/file_videoWithoutAudioTrack.html create mode 100644 toolkit/content/tests/browser/file_webAudio.html create mode 100644 toolkit/content/tests/browser/firebird.png create mode 100644 toolkit/content/tests/browser/firebird.png^headers^ create mode 100644 toolkit/content/tests/browser/gizmo-noaudio.webm create mode 100644 toolkit/content/tests/browser/gizmo.mp4 create mode 100644 toolkit/content/tests/browser/head.js create mode 100644 toolkit/content/tests/browser/image.jpg create mode 100644 toolkit/content/tests/browser/image_page.html create mode 100644 toolkit/content/tests/browser/silentAudioTrack.webm create mode 100644 toolkit/content/tests/chrome/RegisterUnregisterChrome.js create mode 100644 toolkit/content/tests/chrome/bug263683_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug304188_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug331215_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug360437_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug366992_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug409624_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug429723_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug451540_window.xhtml create mode 100644 toolkit/content/tests/chrome/bug624329_window.xhtml create mode 100644 toolkit/content/tests/chrome/chrome.ini create mode 100644 toolkit/content/tests/chrome/dialog_button.xhtml create mode 100644 toolkit/content/tests/chrome/dialog_dialogfocus.xhtml create mode 100644 toolkit/content/tests/chrome/dialog_dialogfocus2.xhtml create mode 100644 toolkit/content/tests/chrome/file_about_networking_wsh.py create mode 100644 toolkit/content/tests/chrome/file_autocomplete_with_composition.js create mode 100644 toolkit/content/tests/chrome/file_edit_contextmenu.xhtml create mode 100644 toolkit/content/tests/chrome/file_editor_with_autocomplete.js create mode 100644 toolkit/content/tests/chrome/file_empty.xhtml create mode 100644 toolkit/content/tests/chrome/file_maximized_persist.js create mode 100644 toolkit/content/tests/chrome/findbar_entireword_window.xhtml create mode 100644 toolkit/content/tests/chrome/findbar_events_window.xhtml create mode 100644 toolkit/content/tests/chrome/findbar_window.xhtml create mode 100644 toolkit/content/tests/chrome/frame_popup_anchor.xhtml create mode 100644 toolkit/content/tests/chrome/frame_popupremoving_frame.xhtml create mode 100644 toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xhtml create mode 100644 toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xhtml create mode 100644 toolkit/content/tests/chrome/popup_trigger.js create mode 100644 toolkit/content/tests/chrome/sample_entireword_latin1.html create mode 100644 toolkit/content/tests/chrome/test_about_networking.html create mode 100644 toolkit/content/tests/chrome/test_arrowpanel.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete2.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete3.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete4.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete5.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete_emphasis.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xhtml create mode 100644 toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html create mode 100644 toolkit/content/tests/chrome/test_browser_drop.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug1048178.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug263683.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug304188.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug331215.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug360220.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug360437.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug365773.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug366992.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug382990.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug409624.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug418874.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug429723.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug451540.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug457632.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug460942.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug471776.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug509732.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug557987.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug562554.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug624329.xhtml create mode 100644 toolkit/content/tests/chrome/test_bug792324.xhtml create mode 100644 toolkit/content/tests/chrome/test_button.xhtml create mode 100644 toolkit/content/tests/chrome/test_chromemargin.xhtml create mode 100644 toolkit/content/tests/chrome/test_closemenu_attribute.xhtml create mode 100644 toolkit/content/tests/chrome/test_contextmenu_list.xhtml create mode 100644 toolkit/content/tests/chrome/test_contextmenu_rtl.xhtml create mode 100644 toolkit/content/tests/chrome/test_cursorsnap.xhtml create mode 100644 toolkit/content/tests/chrome/test_custom_element_base.xhtml create mode 100644 toolkit/content/tests/chrome/test_custom_element_delay_connection.xhtml create mode 100644 toolkit/content/tests/chrome/test_custom_element_parts.html create mode 100644 toolkit/content/tests/chrome/test_deck.xhtml create mode 100644 toolkit/content/tests/chrome/test_dialog_button.xhtml create mode 100644 toolkit/content/tests/chrome/test_dialogfocus.xhtml create mode 100644 toolkit/content/tests/chrome/test_edit_contextmenu.html create mode 100644 toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html create mode 100644 toolkit/content/tests/chrome/test_findbar.xhtml create mode 100644 toolkit/content/tests/chrome/test_findbar_entireword.xhtml create mode 100644 toolkit/content/tests/chrome/test_findbar_events.xhtml create mode 100644 toolkit/content/tests/chrome/test_frames.xhtml create mode 100644 toolkit/content/tests/chrome/test_hiddenitems.xhtml create mode 100644 toolkit/content/tests/chrome/test_hiddenpaging.xhtml create mode 100644 toolkit/content/tests/chrome/test_keys.xhtml create mode 100644 toolkit/content/tests/chrome/test_labelcontrol.xhtml create mode 100644 toolkit/content/tests/chrome/test_largemenu.html create mode 100644 toolkit/content/tests/chrome/test_maximized_persist.xhtml create mode 100644 toolkit/content/tests/chrome/test_maximized_persist_with_no_titlebar.xhtml create mode 100644 toolkit/content/tests/chrome/test_menu.xhtml create mode 100644 toolkit/content/tests/chrome/test_menu_activateitem.xhtml create mode 100644 toolkit/content/tests/chrome/test_menu_hide.xhtml create mode 100644 toolkit/content/tests/chrome/test_menu_mouse_menuactive.xhtml create mode 100644 toolkit/content/tests/chrome/test_menu_withcapture.xhtml create mode 100644 toolkit/content/tests/chrome/test_menuchecks.xhtml create mode 100644 toolkit/content/tests/chrome/test_menuitem_blink.xhtml create mode 100644 toolkit/content/tests/chrome/test_menuitem_commands.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist_in_popup.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist_keynav.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist_null_value.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist_paging.xhtml create mode 100644 toolkit/content/tests/chrome/test_menulist_position.xhtml create mode 100644 toolkit/content/tests/chrome/test_mousescroll.xhtml create mode 100644 toolkit/content/tests/chrome/test_mozinputbox_dictionary.xhtml create mode 100644 toolkit/content/tests/chrome/test_named_deck.html create mode 100644 toolkit/content/tests/chrome/test_navigate_persist.html create mode 100644 toolkit/content/tests/chrome/test_notificationbox.xhtml create mode 100644 toolkit/content/tests/chrome/test_panel.xhtml create mode 100644 toolkit/content/tests/chrome/test_panel_anchoradjust.xhtml create mode 100644 toolkit/content/tests/chrome/test_panel_focus.xhtml create mode 100644 toolkit/content/tests/chrome/test_panel_hover_menu.xhtml create mode 100644 toolkit/content/tests/chrome/test_panel_open.xhtml create mode 100644 toolkit/content/tests/chrome/test_panelfrommenu.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_anchor.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_anchoratrect.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_attribute.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_button.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_coords.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_keys.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_moveToAnchor.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_preventdefault.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_recreate.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_scaled.xhtml create mode 100644 toolkit/content/tests/chrome/test_popup_tree.xhtml create mode 100644 toolkit/content/tests/chrome/test_popuphidden.xhtml create mode 100644 toolkit/content/tests/chrome/test_popupincontent.xhtml create mode 100644 toolkit/content/tests/chrome/test_popupremoving.xhtml create mode 100644 toolkit/content/tests/chrome/test_popupremoving_frame.xhtml create mode 100644 toolkit/content/tests/chrome/test_position.xhtml create mode 100644 toolkit/content/tests/chrome/test_preferences.xhtml create mode 100644 toolkit/content/tests/chrome/test_preferences_beforeaccept.xhtml create mode 100644 toolkit/content/tests/chrome/test_preferences_onsyncfrompreference.xhtml create mode 100644 toolkit/content/tests/chrome/test_props.xhtml create mode 100644 toolkit/content/tests/chrome/test_radio.xhtml create mode 100644 toolkit/content/tests/chrome/test_richlistbox.xhtml create mode 100644 toolkit/content/tests/chrome/test_screenPersistence.xhtml create mode 100644 toolkit/content/tests/chrome/test_scrollbar.xhtml create mode 100644 toolkit/content/tests/chrome/test_showcaret.xhtml create mode 100644 toolkit/content/tests/chrome/test_subframe_origin.xhtml create mode 100644 toolkit/content/tests/chrome/test_tabbox.xhtml create mode 100644 toolkit/content/tests/chrome/test_tabindex.xhtml create mode 100644 toolkit/content/tests/chrome/test_textbox_search.xhtml create mode 100644 toolkit/content/tests/chrome/test_tooltip.xhtml create mode 100644 toolkit/content/tests/chrome/test_tooltip_noautohide.xhtml create mode 100644 toolkit/content/tests/chrome/test_tree.xhtml create mode 100644 toolkit/content/tests/chrome/test_tree_hier.xhtml create mode 100644 toolkit/content/tests/chrome/test_tree_scroll.xhtml create mode 100644 toolkit/content/tests/chrome/test_tree_single.xhtml create mode 100644 toolkit/content/tests/chrome/test_tree_view.xhtml create mode 100644 toolkit/content/tests/chrome/test_window_intrinsic_size.xhtml create mode 100644 toolkit/content/tests/chrome/window_browser_drop.xhtml create mode 100644 toolkit/content/tests/chrome/window_chromemargin.xhtml create mode 100644 toolkit/content/tests/chrome/window_cursorsnap_dialog.xhtml create mode 100644 toolkit/content/tests/chrome/window_cursorsnap_wizard.xhtml create mode 100644 toolkit/content/tests/chrome/window_intrinsic_size.xhtml create mode 100644 toolkit/content/tests/chrome/window_keys.xhtml create mode 100644 toolkit/content/tests/chrome/window_largemenu.xhtml create mode 100644 toolkit/content/tests/chrome/window_maximized_persist.xhtml create mode 100644 toolkit/content/tests/chrome/window_maximized_persist_with_no_titlebar.xhtml create mode 100644 toolkit/content/tests/chrome/window_navigate_persist.html create mode 100644 toolkit/content/tests/chrome/window_panel.xhtml create mode 100644 toolkit/content/tests/chrome/window_panel_anchoradjust.xhtml create mode 100644 toolkit/content/tests/chrome/window_panel_focus.xhtml create mode 100644 toolkit/content/tests/chrome/window_popup_anchor.xhtml create mode 100644 toolkit/content/tests/chrome/window_popup_anchoratrect.xhtml create mode 100644 toolkit/content/tests/chrome/window_popup_attribute.xhtml create mode 100644 toolkit/content/tests/chrome/window_popup_button.xhtml create mode 100644 toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences2.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences3.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences_beforeaccept.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences_commandretarget.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences_disabled.xhtml create mode 100644 toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xhtml create mode 100644 toolkit/content/tests/chrome/window_screenPosSize.xhtml create mode 100644 toolkit/content/tests/chrome/window_showcaret.xhtml create mode 100644 toolkit/content/tests/chrome/window_subframe_origin.xhtml create mode 100644 toolkit/content/tests/chrome/window_tooltip.xhtml create mode 100644 toolkit/content/tests/chrome/xul_selectcontrol.js create mode 100644 toolkit/content/tests/mochitest/file_mousecapture.html create mode 100644 toolkit/content/tests/mochitest/file_mousecapture2.html create mode 100644 toolkit/content/tests/mochitest/file_mousecapture3.html create mode 100644 toolkit/content/tests/mochitest/file_mousecapture4.html create mode 100644 toolkit/content/tests/mochitest/file_mousecapture5.html create mode 100644 toolkit/content/tests/mochitest/gizmo.mp4 create mode 100644 toolkit/content/tests/mochitest/mochitest.ini create mode 100644 toolkit/content/tests/mochitest/test_autocomplete_change_after_focus.html create mode 100644 toolkit/content/tests/mochitest/test_bug1407085.html create mode 100644 toolkit/content/tests/mochitest/test_mousecapture.xhtml create mode 100644 toolkit/content/tests/mochitest/test_video_control_no_control_overlay.html create mode 100644 toolkit/content/tests/moz.build create mode 100644 toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html create mode 100644 toolkit/content/tests/reftests/audio-dynamically-change-small-width.html create mode 100644 toolkit/content/tests/reftests/audio-with-bogus-url-ref.html create mode 100644 toolkit/content/tests/reftests/audio-with-bogus-url.html create mode 100644 toolkit/content/tests/reftests/audio-with-padding-ref.html create mode 100644 toolkit/content/tests/reftests/audio-with-padding.html create mode 100644 toolkit/content/tests/reftests/foo.vtt create mode 100644 toolkit/content/tests/reftests/reftest.list create mode 100644 toolkit/content/tests/reftests/videocontrols-dynamically-add-cc-ref.html create mode 100644 toolkit/content/tests/reftests/videocontrols-dynamically-add-cc.html create mode 100644 toolkit/content/tests/unit/test_contentAreaUtils.js create mode 100644 toolkit/content/tests/unit/xpcshell.ini create mode 100644 toolkit/content/tests/widgets/audio.ogg create mode 100644 toolkit/content/tests/widgets/audio.wav create mode 100644 toolkit/content/tests/widgets/chrome.ini create mode 100644 toolkit/content/tests/widgets/file_videocontrols_jsdisabled.html create mode 100644 toolkit/content/tests/widgets/head.js create mode 100644 toolkit/content/tests/widgets/image-zh.png create mode 100644 toolkit/content/tests/widgets/image.png create mode 100644 toolkit/content/tests/widgets/mochitest.ini create mode 100644 toolkit/content/tests/widgets/popup_shared.js create mode 100644 toolkit/content/tests/widgets/seek_with_sound.ogg create mode 100644 toolkit/content/tests/widgets/test-webvtt-1.vtt create mode 100644 toolkit/content/tests/widgets/test-webvtt-2.vtt create mode 100644 toolkit/content/tests/widgets/test_audiocontrols_dimensions.html create mode 100644 toolkit/content/tests/widgets/test_audiocontrols_fullscreen.html create mode 100644 toolkit/content/tests/widgets/test_bug1654500.html create mode 100644 toolkit/content/tests/widgets/test_bug898940.html create mode 100644 toolkit/content/tests/widgets/test_contextmenu_menugroup.xhtml create mode 100644 toolkit/content/tests/widgets/test_contextmenu_nested.xhtml create mode 100644 toolkit/content/tests/widgets/test_editor_currentURI.xhtml create mode 100644 toolkit/content/tests/widgets/test_image_recognition.html create mode 100644 toolkit/content/tests/widgets/test_image_recognition_unsupported.html create mode 100644 toolkit/content/tests/widgets/test_image_recognition_zh.html create mode 100644 toolkit/content/tests/widgets/test_label_checkbox.xhtml create mode 100644 toolkit/content/tests/widgets/test_menubar.xhtml create mode 100644 toolkit/content/tests/widgets/test_mousecapture_area.html create mode 100644 toolkit/content/tests/widgets/test_moz_button_group.html create mode 100644 toolkit/content/tests/widgets/test_moz_label.html create mode 100644 toolkit/content/tests/widgets/test_moz_support_link.html create mode 100644 toolkit/content/tests/widgets/test_moz_toggle.html create mode 100644 toolkit/content/tests/widgets/test_nac_mutations.html create mode 100644 toolkit/content/tests/widgets/test_panel_item_accesskey.html create mode 100644 toolkit/content/tests/widgets/test_panel_list_accessibility.html create mode 100644 toolkit/content/tests/widgets/test_panel_list_in_xul_panel.html create mode 100644 toolkit/content/tests/widgets/test_panel_list_min_width_from_anchor.html create mode 100644 toolkit/content/tests/widgets/test_panel_list_shadow_node_anchor.html create mode 100644 toolkit/content/tests/widgets/test_popupanchor.xhtml create mode 100644 toolkit/content/tests/widgets/test_popupreflows.xhtml create mode 100644 toolkit/content/tests/widgets/test_tree_column_reorder.xhtml create mode 100644 toolkit/content/tests/widgets/test_ua_widget_elementFromPoint.html create mode 100644 toolkit/content/tests/widgets/test_ua_widget_sandbox.html create mode 100644 toolkit/content/tests/widgets/test_ua_widget_unbind.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_audio.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_audio_direction.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_clickToPlay_ariaLabel.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_closed_caption_menu.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_error.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_focus.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_iframe_fullscreen.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_jsdisabled.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_keyhandler.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_onclickplay.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_orientation.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_scrubber_position.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_scrubber_position_nopreload.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_size.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_standalone.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_video_direction.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_video_noaudio.html create mode 100644 toolkit/content/tests/widgets/test_videocontrols_vtt.html create mode 100644 toolkit/content/tests/widgets/tree_shared.js create mode 100644 toolkit/content/tests/widgets/video.ogg create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1-ref.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1a.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1b.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1c.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1d.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-1e.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2-ref.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2a.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2b.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2c.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2d.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction-2e.html create mode 100644 toolkit/content/tests/widgets/videocontrols_direction_test.js create mode 100644 toolkit/content/tests/widgets/videomask.css create mode 100644 toolkit/content/tests/widgets/window_label_checkbox.xhtml create mode 100644 toolkit/content/tests/widgets/window_menubar.xhtml (limited to 'toolkit/content/tests') diff --git a/toolkit/content/tests/browser/audio.ogg b/toolkit/content/tests/browser/audio.ogg new file mode 100644 index 0000000000..7f1833508a Binary files /dev/null and b/toolkit/content/tests/browser/audio.ogg differ diff --git a/toolkit/content/tests/browser/audio_file.txt b/toolkit/content/tests/browser/audio_file.txt new file mode 100644 index 0000000000..2e4af84485 --- /dev/null +++ b/toolkit/content/tests/browser/audio_file.txt @@ -0,0 +1 @@ +data:audio/mpeg;base64,//tAxAAABvhjIgSxKQEFCi009CDgFQlHhw2YJxQXGTI1QVJ8WRkDAPBHKiG0yuPRcfEiOvayEXHyQnQLqJrMnjbEwTBMIN//8279Bv86QAAiCXbbgbotwRxCSFkvPxUgvmJ3iYWrqAoCs5buniYp/chXmj6wI6c0ILg/qAbENxV4RiApBAEHKD+U//1vkMWgAAAAXJJQ7CSK1lN3jhQIGtJsc/1mY13o/H2DFvCa0JLC4koaBRX/+0LEFAAIDElpp6TGwQaN7LWDFSAAAsKziRUMG0Cx+ZO03eBVJIS/r/6er/r1sAFAAAFtyCPInCApfqXtMafCH4l5Fws6rufUiy3yiYaLKcWLMKq9V7lbuMlIxZUkD72tRFvqJ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SeZNBgESr0luSjMyxxJJQdBXEoKhosdLA0eEwNCUFfyoaq9R7ES3Q7EQNPlgaPYKuTywdaCoKgr/qadni0SIMCljpQugNkwpEQyHhv/7QsTOgAnIRU+HrMbJPo4qNPGNIcQCsSCUVCEaD4wRkBOaCQYSBCxBMgqpZ2dndnZ2uFpETjSizLQRJGnFlHmJpInGlFmWICaaQNb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7QsTQgAms3USnmGtBRpfosPGNaP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7QsTSAAmgWzIEsMcBKBZSQGSZaf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////1RBR0hhdHMgSWRlYSAgICAgICAgICAgICAgICAgICAgIFNhbGVtICAgICAgICAgICAgICAgICAgICAgICAgIFNhYnJpbmEgVGhlIFRlZW5hZ2UgV2l0Y2ggICAgIDE5OTcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5 \ No newline at end of file diff --git a/toolkit/content/tests/browser/browser.ini b/toolkit/content/tests/browser/browser.ini new file mode 100644 index 0000000000..9ef275efd3 --- /dev/null +++ b/toolkit/content/tests/browser/browser.ini @@ -0,0 +1,149 @@ +[DEFAULT] +support-files = + audio.ogg + empty.png + file_contentTitle.html + file_empty.html + file_iframe_media.html + file_findinframe.html + file_mediaPlayback2.html + file_multipleAudio.html + file_multiplePlayingAudio.html + file_nonAutoplayAudio.html + file_redirect.html + file_redirect_to.html + file_silentAudioTrack.html + file_webAudio.html + gizmo.mp4 + head.js + image.jpg + image_page.html + silentAudioTrack.webm +skip-if = + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure + +[browser_about_logging.js] +skip-if = + tsan # Bug 1804081 +[browser_about_networking.js] +skip-if = socketprocess_networking +[browser_autoscroll_disabled.js] +skip-if = true # Bug 1312652 +[browser_autoscroll_disabled_on_editable_content.js] +[browser_autoscroll_disabled_on_links.js] +[browser_bug1170531.js] +skip-if = + os == "linux" && !debug && !ccov # Bug 1647973 +[browser_bug1198465.js] +[browser_bug1572798.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +support-files = file_document_open_audio.html +[browser_bug1693577.js] +[browser_bug295977_autoscroll_overflow.js] +skip-if = + ((debug || asan) && os == "win" && bits == 64) + os == 'linux' && bits == 64 # Bug 1710788 +[browser_bug451286.js] +skip-if = true # bug 1399845 tracks re-enabling this test. +[browser_bug594509.js] +[browser_bug982298.js] +[browser_cancel_starting_autoscrolling_requested_by_background_tab.js] +[browser_charsetMenu_disable_on_ascii.js] +[browser_charsetMenu_swapBrowsers.js] +[browser_click_event_during_autoscrolling.js] +[browser_contentTitle.js] +[browser_content_url_annotation.js] +skip-if = !crashreporter +[browser_crash_previous_frameloader.js] +run-if = crashreporter +[browser_default_audio_filename.js] +support-files = audio_file.txt +[browser_default_image_filename.js] +[browser_default_image_filename_redirect.js] +support-files = + doggy.png + firebird.png + firebird.png^headers^ +[browser_delay_autoplay_cross_origin_iframe.js] +tags = audiochannel +[browser_delay_autoplay_cross_origin_navigation.js] +tags = audiochannel +[browser_delay_autoplay_media.js] +tags = audiochannel +skip-if = + (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_media_pausedAfterPlay.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_multipleMedia.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_notInTreeAudio.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_playAfterTabVisible.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_playMediaInMuteTab.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_delay_autoplay_silentAudioTrack_media.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") || (os == "mac") || (os == "linux" && !debug) # aarch64 due to 1536573 #Bug 1524746 +[browser_delay_autoplay_webAudio.js] +tags = audiochannel +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 +[browser_f7_caret_browsing.js] +[browser_findbar.js] +skip-if = os == "linux" && bits == 64 && os_version == "18.04" # Bug 1614739 +[browser_findbar_disabled_manual.js] +[browser_findbar_hiddenframes.js] +[browser_findbar_marks.js] +[browser_isSynthetic.js] +[browser_keyevents_during_autoscrolling.js] +[browser_label_textlink.js] +https_first_disabled = true +[browser_license_links.js] +[browser_media_wakelock.js] +support-files = + browser_mediaStreamPlayback.html + browser_mediaStreamPlaybackWithoutAudio.html + file_video.html + file_videoWithAudioOnly.html + file_videoWithoutAudioTrack.html + gizmo.mp4 + gizmo-noaudio.webm +skip-if = + (os == "win" && processor == "aarch64") # aarch64 due to 1536573 + apple_silicon # Disabled due to bleedover with other tests when run in regular suites; passes in "failures" jobs +[browser_media_wakelock_PIP.js] +support-files = + file_video.html + gizmo.mp4 +[browser_media_wakelock_webaudio.js] +[browser_moz_support_link_open_links_in_chrome.js] +[browser_quickfind_editable.js] +skip-if = (verify && debug && (os == 'linux')) +[browser_remoteness_change_listeners.js] +[browser_resume_bkg_video_on_tab_hover.js] +skip-if = + os == "win" && processor == "aarch64" # Bug 1536573 + debug # Bug 1388959 +[browser_richlistbox_keyboard.js] +[browser_saveImageURL.js] +[browser_save_folder_standalone_image.js] +support-files = + doggy.png +[browser_save_resend_postdata.js] +support-files = + common/mockTransfer.js + data/post_form_inner.sjs + data/post_form_outer.sjs +skip-if = true # Bug ?????? - test directly manipulates content (gBrowser.contentDocument.getElementById("postForm").submit();) +[browser_starting_autoscroll_in_about_content.js] +[browser_suspend_videos_outside_viewport.js] +support-files = + file_outside_viewport_videos.html + gizmo.mp4 +skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573 diff --git a/toolkit/content/tests/browser/browser_about_logging.js b/toolkit/content/tests/browser/browser_about_logging.js new file mode 100644 index 0000000000..f458b36e0d --- /dev/null +++ b/toolkit/content/tests/browser/browser_about_logging.js @@ -0,0 +1,464 @@ +const PAGE = "about:logging"; + +function clearLoggingPrefs() { + for (let pref of Services.prefs.getBranch("logging.").getChildList("")) { + info(`Clearing: ${pref}`); + Services.prefs.clearUserPref("logging." + pref); + } +} + +// Before running, save any MOZ_LOG environment variable that might be preset, +// and restore them at the end of this test. +add_setup(async function saveRestoreLogModules() { + let savedLogModules = Services.env.get("MOZ_LOG"); + Services.env.set("MOZ_LOG", ""); + registerCleanupFunction(() => { + clearLoggingPrefs(); + info(" -- Restoring log modules: " + savedLogModules); + for (let pref of savedLogModules.split(",")) { + let [logModule, level] = pref.split(":"); + Services.prefs.setIntPref("logging." + logModule, parseInt(level)); + } + // Removing this line causes a sandboxxing error in nsTraceRefCnt.cpp (!). + Services.env.set("MOZ_LOG", savedLogModules); + }); +}); + +// Test that some UI elements are disabled in some cirumstances. +add_task(async function testElementsDisabled() { + // This test needs a MOZ_LOG env var set. + Services.env.set("MOZ_LOG", "example:4"); + await BrowserTestUtils.withNewTab(PAGE, async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + $("#set-log-modules-button").disabled, + "Because a MOZ_LOG env var is set by the harness, it should be impossible to set new log modules." + ); + }); + }); + Services.env.set("MOZ_LOG", ""); + + await BrowserTestUtils.withNewTab( + PAGE + "?modules=example:5&output=profiler", + async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#some-elements-unavailable").hidden, + "If a log modules are configured via URL params, a warning should be visible." + ); + Assert.ok( + $("#set-log-modules-button").disabled, + "If a log modules are configured via URL params, some in-page elements should be disabled (button)." + ); + Assert.ok( + $("#log-modules").disabled, + "If a log modules are configured via URL params, some in-page elements should be disabled (input)." + ); + Assert.ok( + $("#logging-preset-dropdown").disabled, + "If a log modules are configured via URL params, some in-page elements should be disabled (dropdown)." + ); + Assert.ok( + $("#radio-logging-profiler").disabled && + $("#radio-logging-file").disabled, + "If the ouptut type is configured via URL param, the radio buttons should be disabled." + ); + }); + } + ); + await BrowserTestUtils.withNewTab( + PAGE + "?preset=media-playback", + async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#some-elements-unavailable").hidden, + "If a preset is selected via URL, a warning should be displayed." + ); + Assert.ok( + $("#set-log-modules-button").disabled, + "If a preset is selected via URL, some in-page elements should be disabled (button)." + ); + Assert.ok( + $("#log-modules").disabled, + "If a preset is selected via URL, some in-page elements should be disabled (input)." + ); + Assert.ok( + $("#logging-preset-dropdown").disabled, + "If a preset is selected via URL, some in-page elements should be disabled (dropdown)." + ); + }); + } + ); + clearLoggingPrefs(); +}); + +// Test URL parameters +const modulesInURL = "example:4,otherexample:5"; +const presetInURL = "media-playback"; +const threadsInURL = "example,otherexample"; +const profilerPresetInURL = "media"; +add_task(async function testURLParameters() { + await BrowserTestUtils.withNewTab( + PAGE + "?modules=" + modulesInURL, + async browser => { + await SpecialPowers.spawn(browser, [modulesInURL], async modulesInURL => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#some-elements-unavailable").hidden, + "If modules are selected via URL, a warning should be displayed." + ); + var inPageSorted = $("#current-log-modules") + .innerText.split(",") + .sort() + .join(","); + var inURLSorted = modulesInURL.split(",").sort().join(","); + Assert.equal( + inPageSorted, + inURLSorted, + "When selecting modules via URL params, the same modules are reflected in the page." + ); + }); + } + ); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: PAGE + "?preset=" + presetInURL, + }, + async browser => { + await SpecialPowers.spawn(browser, [presetInURL], async presetInURL => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#some-elements-unavailable").hidden, + "If a preset is selected via URL, a warning should be displayed." + ); + var inPageSorted = $("#current-log-modules") + .innerText.split(",") + .sort() + .join(","); + var presetSorted = content + .presets() + [presetInURL].modules.split(",") + .sort() + .join(","); + Assert.equal( + inPageSorted, + presetSorted, + "When selecting a preset via URL params, the correct log modules are reflected in the page." + ); + }); + } + ); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: PAGE + "?profiler-preset=" + profilerPresetInURL, + }, + async browser => { + await SpecialPowers.spawn(browser, [profilerPresetInURL], async inURL => { + let $ = content.document.querySelector.bind(content.document); + // Threads override doesn't have a UI element, the warning shouldn't + // be displayed. + Assert.ok( + $("#some-elements-unavailable").hidden, + "When overriding the profiler preset, no warning is displayed on the page." + ); + var inSettings = content.settings().profilerPreset; + Assert.equal( + inSettings, + inURL, + "When overriding the profiler preset via URL param, the correct preset is set in the logging manager settings." + ); + }); + } + ); + await BrowserTestUtils.withNewTab(PAGE + "?profilerstacks", async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#some-elements-unavailable").hidden, + "If the profiler stacks config is set via URL, a warning should be displayed." + ); + Assert.ok( + $("#with-profiler-stacks-checkbox").disabled, + "If the profiler stacks config is set via URL, its checkbox should be disabled." + ); + + Assert.ok( + Services.prefs.getBoolPref("logging.config.profilerstacks"), + "The preference for profiler stacks is set initially, as a result of parsing the URL parameter" + ); + + $("#radio-logging-file").click(); + $("#radio-logging-profiler").click(); + + Assert.ok( + $("#with-profiler-stacks-checkbox").disabled, + "If the profiler stacks config is set via URL, its checkbox should be disabled even after clicking around." + ); + }); + }); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: PAGE + "?invalid-param", + }, + async browser => { + await SpecialPowers.spawn(browser, [profilerPresetInURL], async inURL => { + let $ = content.document.querySelector.bind(content.document); + Assert.ok( + !$("#error").hidden, + "When an invalid URL param is passed in, the page displays a warning." + ); + }); + } + ); + clearLoggingPrefs(); +}); + +// Test various things related to presets: that it's populated correctly, that +// setting presets work in terms of UI, but also that it sets the logging.* +// prefs correctly. +add_task(async function testAboutLoggingPresets() { + await BrowserTestUtils.withNewTab(PAGE, async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + let presetsDropdown = $("#logging-preset-dropdown"); + Assert.equal( + Object.keys(content.presets()).length, + presetsDropdown.childNodes.length, + "Presets populated." + ); + + Assert.equal(presetsDropdown.value, "networking"); + $("#set-log-modules-button").click(); + Assert.ok( + $("#no-log-modules").hidden && !$("#current-log-modules").hidden, + "When log modules are set, they are visible." + ); + var lengthModuleListNetworking = $("#log-modules").value.length; + var lengthCurrentModuleListNetworking = $("#current-log-modules") + .innerText.length; + Assert.notEqual( + lengthModuleListNetworking, + 0, + "When setting a profiler preset, the module string is non-empty (input)." + ); + Assert.notEqual( + lengthCurrentModuleListNetworking, + 0, + "When setting a profiler preset, the module string is non-empty (selected modules)." + ); + + // Change preset + presetsDropdown.value = "media-playback"; + presetsDropdown.dispatchEvent(new content.Event("change")); + + // Check the following after "onchange". + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(resolve => content.setTimeout(resolve, 0)); + + Assert.equal( + presetsDropdown.value, + "media-playback", + "Selecting another preset is reflected in the page" + ); + $("#set-log-modules-button").click(); + Assert.ok( + $("#no-log-modules").hidden && !$("#current-log-modules").hidden, + "When other log modules are set, they are still visible" + ); + Assert.notEqual( + $("#log-modules").value.length, + 0, + "When setting a profiler preset, the module string is non-empty (input)." + ); + Assert.notEqual( + $("#current-log-modules").innerText.length, + 0, + "When setting a profiler preset, the module string is non-empty (selected modules)." + ); + Assert.notEqual( + $("#log-modules").value.length, + lengthModuleListNetworking, + "When setting another profiler preset, the module string changes (input)." + ); + let currentLogModulesString = $("#current-log-modules").innerText; + Assert.notEqual( + currentLogModulesString.length, + lengthCurrentModuleListNetworking, + + "When setting another profiler preset, the module string changes (selected modules)." + ); + + // After setting some log modules via the preset dropdown, verify + // that they have been reflected to logging.* preferences. + var activeLogModules = []; + let children = Services.prefs.getBranch("logging.").getChildList(""); + for (let pref of children) { + if (pref.startsWith("config.")) { + continue; + } + + try { + let value = Services.prefs.getIntPref(`logging.${pref}`); + activeLogModules.push(`${pref}:${value}`); + } catch (e) { + console.error(e); + } + } + let mod; + while ((mod = activeLogModules.pop())) { + Assert.ok( + currentLogModulesString.includes(mod), + `${mod} was effectively set` + ); + } + }); + }); + clearLoggingPrefs(); +}); + +// Test various things around the profiler stacks feature +add_task(async function testProfilerStacks() { + // Check the initial state before changing anything. + Assert.ok( + !Services.prefs.getBoolPref("logging.config.profilerstacks", false), + "The preference for profiler stacks isn't set initially" + ); + await BrowserTestUtils.withNewTab(PAGE, async browser => { + await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + const checkbox = $("#with-profiler-stacks-checkbox"); + Assert.ok( + !checkbox.checked, + "The profiler stacks checkbox isn't checked at load time." + ); + checkbox.checked = true; + checkbox.dispatchEvent(new content.Event("change")); + Assert.ok( + Services.prefs.getBoolPref("logging.config.profilerstacks"), + "The preference for profiler stacks is now set to true" + ); + checkbox.checked = false; + checkbox.dispatchEvent(new content.Event("change")); + Assert.ok( + !Services.prefs.getBoolPref("logging.config.profilerstacks"), + "The preference for profiler stacks is now back to false" + ); + + $("#radio-logging-file").click(); + Assert.ok( + checkbox.disabled, + "The profiler stacks checkbox is disabled when the output type is 'file'" + ); + $("#radio-logging-profiler").click(); + Assert.ok( + !checkbox.disabled, + "The profiler stacks checkbox is enabled when the output type is 'profiler'" + ); + }); + }); + clearLoggingPrefs(); +}); + +// Here we test that starting and stopping log collection to the Firefox +// Profiler opens a new tab. We don't actually check the content of the profile. +add_task(async function testProfilerOpens() { + await BrowserTestUtils.withNewTab(PAGE, async browser => { + let profilerOpenedPromise = BrowserTestUtils.waitForNewTab( + gBrowser, + "https://example.com/", + false + ); + SpecialPowers.spawn(browser, [], async savedLogModules => { + let $ = content.document.querySelector.bind(content.document); + // Override the URL the profiler uses to avoid hitting external + // resources (and crash). + await SpecialPowers.pushPrefEnv({ + set: [ + ["devtools.performance.recording.ui-base-url", "https://example.com"], + ["devtools.performance.recording.ui-base-url-path", "/"], + ], + }); + $("#radio-logging-file").click(); + $("#radio-logging-profiler").click(); + $("#logging-preset-dropdown").value = "networking"; + $("#logging-preset-dropdown").dispatchEvent(new content.Event("change")); + $("#set-log-modules-button").click(); + $("#toggle-logging-button").click(); + // Wait for the profiler to start. This can be very slow. + await content.profilerPromise(); + + // Wait for some time for good measure while the profiler collects some + // data. We don't really care about the data itself. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(resolve => content.setTimeout(resolve, 1000)); + $("#toggle-logging-button").click(); + }); + let tab = await profilerOpenedPromise; + Assert.ok(true, "Profiler tab opened after profiling"); + await BrowserTestUtils.removeTab(tab); + }); + clearLoggingPrefs(); +}); + +// Same test, outputing to a file, with network logging, while opening and +// closing a tab. We only check that the file exists and has a non-zero size. +add_task(async function testLogFileFound() { + await BrowserTestUtils.withNewTab(PAGE, async browser => { + await SpecialPowers.spawn(browser, [], async () => { + // Clear any previous log file. + let $ = content.document.querySelector.bind(content.document); + $("#radio-logging-file").click(); + $("#log-file").value = ""; + $("#log-file").dispatchEvent(new content.Event("change")); + $("#set-log-file-button").click(); + + Assert.ok( + !$("#no-log-file").hidden, + "When a log file hasn't been set, it's indicated as such." + ); + }); + }); + await BrowserTestUtils.withNewTab(PAGE, async browser => { + let logPath = await SpecialPowers.spawn(browser, [], async () => { + let $ = content.document.querySelector.bind(content.document); + $("#radio-logging-file").click(); + // Set the log file (use the default path) + $("#set-log-file-button").click(); + var logPath = $("#current-log-file").innerText; + // Set log modules for networking + $("#logging-preset-dropdown").value = "networking"; + $("#logging-preset-dropdown").dispatchEvent(new content.Event("change")); + $("#set-log-modules-button").click(); + return logPath; + }); + + // No need to start or stop logging when logging to a file. Just open + // a tab, any URL will do. Wait for this tab to be loaded so we're sure + // something (anything) has happened in necko. + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "https://example.com", + true /* waitForLoad */ + ); + await BrowserTestUtils.removeTab(tab); + let logDirectory = PathUtils.parent(logPath); + let logBasename = PathUtils.filename(logPath); + let entries = await IOUtils.getChildren(logDirectory); + let foundNonEmptyLogFile = false; + for (let entry of entries) { + if (entry.includes(logBasename)) { + info("-- Log file found: " + entry); + let fileinfo = await IOUtils.stat(entry); + foundNonEmptyLogFile |= fileinfo.size > 0; + } + } + Assert.ok(foundNonEmptyLogFile, "Found at least one non-empty log file."); + }); + clearLoggingPrefs(); +}); diff --git a/toolkit/content/tests/browser/browser_about_networking.js b/toolkit/content/tests/browser/browser_about_networking.js new file mode 100644 index 0000000000..bab285904c --- /dev/null +++ b/toolkit/content/tests/browser/browser_about_networking.js @@ -0,0 +1,47 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_task(async function test_first() { + registerCleanupFunction(() => { + // Must clear mode first, otherwise we'll have non-local connections to + // the cloudflare URL. + Services.prefs.clearUserPref("network.trr.mode"); + Services.prefs.clearUserPref("network.trr.uri"); + }); + + await BrowserTestUtils.withNewTab( + "about:networking#dns", + async function (browser) { + ok(!browser.isRemoteBrowser, "Browser should not be remote."); + await ContentTask.spawn(browser, null, async function () { + let url_tbody = content.document.getElementById("dns_trr_url"); + info(url_tbody); + is( + url_tbody.children[0].children[0].textContent, + "https://mozilla.cloudflare-dns.com/dns-query" + ); + is(url_tbody.children[0].children[1].textContent, "0"); + }); + } + ); + + Services.prefs.setCharPref("network.trr.uri", "https://localhost/testytest"); + Services.prefs.setIntPref("network.trr.mode", 2); + await BrowserTestUtils.withNewTab( + "about:networking#dns", + async function (browser) { + ok(!browser.isRemoteBrowser, "Browser should not be remote."); + await ContentTask.spawn(browser, null, async function () { + let url_tbody = content.document.getElementById("dns_trr_url"); + info(url_tbody); + is( + url_tbody.children[0].children[0].textContent, + "https://localhost/testytest" + ); + is(url_tbody.children[0].children[1].textContent, "2"); + }); + } + ); +}); diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled.js b/toolkit/content/tests/browser/browser_autoscroll_disabled.js new file mode 100644 index 0000000000..e69c319d17 --- /dev/null +++ b/toolkit/content/tests/browser/browser_autoscroll_disabled.js @@ -0,0 +1,82 @@ +add_task(async function () { + const kPrefName_AutoScroll = "general.autoScroll"; + Services.prefs.setBoolPref(kPrefName_AutoScroll, false); + + let dataUri = + 'data:text/html,
\ + \ +'; + + let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + BrowserTestUtils.loadURIString(gBrowser, dataUri); + await loadedPromise; + + await BrowserTestUtils.synthesizeMouse( + "#i", + 50, + 50, + { button: 1 }, + gBrowser.selectedBrowser + ); + + await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function () { + var iframe = content.document.getElementById("iframe"); + + if (iframe) { + var e = new iframe.contentWindow.PageTransitionEvent("pagehide", { + bubbles: true, + cancelable: true, + persisted: false, + }); + iframe.contentDocument.dispatchEvent(e); + iframe.contentDocument.documentElement.dispatchEvent(e); + } + }); + + await BrowserTestUtils.synthesizeMouse( + "#i", + 100, + 100, + { type: "mousemove", clickCount: "0" }, + gBrowser.selectedBrowser + ); + + // If scrolling didn't work, we wouldn't do any redraws and thus time out, so + // request and force redraws to get the chance to check for scrolling at all. + await new Promise(resolve => window.requestAnimationFrame(resolve)); + + let msg = await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [], + async function () { + // Skip the first animation frame callback as it's the same callback that + // the browser uses to kick off the scrolling. + return new Promise(resolve => { + function checkScroll() { + let msg = ""; + let elem = content.document.getElementById("i"); + if (elem.scrollTop != 0) { + msg += "element should not have scrolled vertically"; + } + if (elem.scrollLeft != 0) { + msg += "element should not have scrolled horizontally"; + } + + resolve(msg); + } + + content.requestAnimationFrame(checkScroll); + }); + } + ); + + ok(!msg, "element scroll " + msg); + + // restore the changed prefs + if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) { + Services.prefs.clearUserPref(kPrefName_AutoScroll); + } + + // wait for focus to fix a failure in the next test if the latter runs too soon. + await SimpleTest.promiseFocus(); +}); diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled_on_editable_content.js b/toolkit/content/tests/browser/browser_autoscroll_disabled_on_editable_content.js new file mode 100644 index 0000000000..6e66644bc9 --- /dev/null +++ b/toolkit/content/tests/browser/browser_autoscroll_disabled_on_editable_content.js @@ -0,0 +1,306 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_task(async function () { + await SpecialPowers.pushPrefEnv({ + set: [ + ["general.autoScroll", true], + ["middlemouse.paste", true], + ["middlemouse.contentLoadURL", false], + ["test.events.async.enabled", false], + ], + }); + + let autoScroller; + function onPopupShown(aEvent) { + if (aEvent.originalTarget.id != "autoscroller") { + return false; + } + autoScroller = aEvent.originalTarget; + return true; + } + window.addEventListener("popupshown", onPopupShown, { capture: true }); + registerCleanupFunction(() => { + window.removeEventListener("popupshown", onPopupShown, { capture: true }); + }); + function popupIsNotClosed() { + return autoScroller && autoScroller.state != "closed"; + } + + async function promiseNativeMouseMiddleButtonDown(aBrowser) { + await EventUtils.promiseNativeMouseEvent({ + type: "mousemove", + target: aBrowser, + atCenter: true, + }); + return EventUtils.promiseNativeMouseEvent({ + type: "mousedown", + target: aBrowser, + atCenter: true, + button: 1, // middle button + }); + } + async function promiseNativeMouseMiddleButtonUp(aBrowser) { + return EventUtils.promiseNativeMouseEvent({ + type: "mouseup", + target: aBrowser, + atCenter: true, + button: 1, // middle button + }); + } + function promiseWaitForAutoScrollerClosed() { + if (!autoScroller || autoScroller.state == "closed") { + return Promise.resolve(); + } + let result = BrowserTestUtils.waitForEvent( + autoScroller, + "popuphidden", + { capture: true }, + () => { + return true; + } + ); + EventUtils.synthesizeKey("KEY_Escape"); + return result; + } + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + '
'; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await TestUtils.waitForCondition( + popupIsNotClosed, + "Wait for timeout of popup", + 100, + 10 + ); + ok( + false, + "Autoscroll shouldn't be started on editable
if middle paste is enabled" + ); + } catch (e) { + ok( + typeof e == "string" && e.includes(" - timed out after 10 tries."), + `Autoscroll shouldn't be started on editable
if middle paste is enabled (${ + typeof e == "string" ? e : e.message + })` + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + '
'; + content.document.designMode = "on"; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await TestUtils.waitForCondition( + popupIsNotClosed, + "Wait for timeout of popup", + 100, + 10 + ); + ok( + false, + "Autoscroll shouldn't be started in document whose designMode is 'on' if middle paste is enabled" + ); + } catch (e) { + ok( + typeof e == "string" && e.includes(" - timed out after 10 tries."), + `Autoscroll shouldn't be started in document whose designMode is 'on' if middle paste is enabled (${ + typeof e == "string" ? e : e.message + })` + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + '
'; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await BrowserTestUtils.waitForEvent( + window, + "popupshown", + { capture: true }, + onPopupShown + ); + ok( + true, + "Auto scroll should be started on non-editable
in an editing host if middle paste is enabled" + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await SpecialPowers.pushPrefEnv({ + set: [["middlemouse.paste", false]], + }); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + '
'; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await BrowserTestUtils.waitForEvent( + window, + "popupshown", + { capture: true }, + onPopupShown + ); + ok( + true, + "Auto scroll should be started on editable
if middle paste is disabled" + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + '
'; + content.document.designMode = "on"; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await BrowserTestUtils.waitForEvent( + window, + "popupshown", + { capture: true }, + onPopupShown + ); + ok( + true, + "Auto scroll should be started in document whose designMode is 'on' if middle paste is disabled" + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await SpecialPowers.pushPrefEnv({ + set: [["middlemouse.paste", false]], + }); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + ''; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await BrowserTestUtils.waitForEvent( + window, + "popupshown", + { capture: true }, + onPopupShown + ); + ok( + true, + "Auto scroll should be started on if middle paste is disabled" + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + + await SpecialPowers.pushPrefEnv({ + set: [["middlemouse.paste", true]], + }); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [], () => { + content.document.body.innerHTML = + ''; + content.document.documentElement.scrollTop = 500; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await TestUtils.waitForCondition( + popupIsNotClosed, + "Wait for timeout of popup", + 100, + 10 + ); + ok( + false, + "Autoscroll shouldn't be started on if middle paste is enabled" + ); + } catch (e) { + ok( + typeof e == "string" && e.includes(" - timed out after 10 tries."), + `Autoscroll shouldn't be started on if middle paste is enabled (${ + typeof e == "string" ? e : e.message + })` + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); +}); diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled_on_links.js b/toolkit/content/tests/browser/browser_autoscroll_disabled_on_links.js new file mode 100644 index 0000000000..970870b919 --- /dev/null +++ b/toolkit/content/tests/browser/browser_autoscroll_disabled_on_links.js @@ -0,0 +1,125 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_task(async function test_autoscroll_links() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["general.autoScroll", true], + ["middlemouse.contentLoadURL", false], + ["test.events.async.enabled", false], + ], + }); + + let autoScroller; + function onPopupShown(aEvent) { + if (aEvent.originalTarget.id != "autoscroller") { + return false; + } + autoScroller = aEvent.originalTarget; + return true; + } + window.addEventListener("popupshown", onPopupShown, { capture: true }); + registerCleanupFunction(() => { + window.removeEventListener("popupshown", onPopupShown, { capture: true }); + }); + function popupIsNotClosed() { + return autoScroller && autoScroller.state != "closed"; + } + + async function promiseNativeMouseMiddleButtonDown(aBrowser) { + await EventUtils.promiseNativeMouseEvent({ + type: "mousemove", + target: aBrowser, + atCenter: true, + }); + return EventUtils.promiseNativeMouseEvent({ + type: "mousedown", + target: aBrowser, + atCenter: true, + button: 1, // middle button + }); + } + async function promiseNativeMouseMiddleButtonUp(aBrowser) { + return EventUtils.promiseNativeMouseEvent({ + type: "mouseup", + target: aBrowser, + atCenter: true, + button: 1, // middle button + }); + } + function promiseWaitForAutoScrollerClosed() { + if (!autoScroller || autoScroller.state == "closed") { + return Promise.resolve(); + } + let result = BrowserTestUtils.waitForEvent( + autoScroller, + "popuphidden", + { capture: true }, + () => { + return true; + } + ); + EventUtils.synthesizeKey("KEY_Escape"); + return result; + } + + async function testMarkup(markup) { + return BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + await SpecialPowers.spawn(browser, [markup], html => { + // eslint-disable-next-line no-unsanitized/property + content.document.body.innerHTML = html; + content.document.documentElement.scrollTop = 1; + content.document.documentElement.scrollTop; // Flush layout. + }); + await promiseNativeMouseMiddleButtonDown(browser); + try { + await TestUtils.waitForCondition( + popupIsNotClosed, + "Wait for timeout of popup", + 100, + 10 + ); + ok(false, "Autoscroll shouldn't be started on " + markup); + } catch (e) { + ok( + typeof e == "string" && e.includes(" - timed out after 10 tries."), + `Autoscroll shouldn't be started on ${markup} (${ + typeof e == "string" ? e : e.message + })` + ); + } finally { + await promiseNativeMouseMiddleButtonUp(browser); + let waitForAutoScrollEnd = promiseWaitForAutoScrollerClosed(); + await waitForAutoScrollEnd; + } + } + ); + } + + await testMarkup( + 'Click me' + ); + + await testMarkup(` + + + + + `); + + await testMarkup(` + + + + + + + + + + `); +}); diff --git a/toolkit/content/tests/browser/browser_bug1170531.js b/toolkit/content/tests/browser/browser_bug1170531.js new file mode 100644 index 0000000000..483d2dad7f --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug1170531.js @@ -0,0 +1,139 @@ +/* eslint-disable mozilla/no-arbitrary-setTimeout */ +// Test for bug 1170531 +// https://bugzilla.mozilla.org/show_bug.cgi?id=1170531 + +add_task(async function () { + // Get a bunch of DOM nodes + let editMenu = document.getElementById("edit-menu"); + let menuPopup = editMenu.menupopup; + + let closeMenu = function (aCallback) { + if (Services.appinfo.OS == "Darwin") { + executeSoon(aCallback); + return; + } + + menuPopup.addEventListener( + "popuphidden", + function () { + executeSoon(aCallback); + }, + { once: true } + ); + + executeSoon(function () { + editMenu.open = false; + }); + }; + + let openMenu = function (aCallback) { + if (Services.appinfo.OS == "Darwin") { + goUpdateGlobalEditMenuItems(); + // On OSX, we have a native menu, so it has to be updated. In single process browsers, + // this happens synchronously, but in e10s, we have to wait for the main thread + // to deal with it for us. 1 second should be plenty of time. + setTimeout(aCallback, 1000); + return; + } + + menuPopup.addEventListener( + "popupshown", + function () { + executeSoon(aCallback); + }, + { once: true } + ); + + executeSoon(function () { + editMenu.open = true; + }); + }; + + await BrowserTestUtils.withNewTab( + { gBrowser, url: "about:blank" }, + async function (browser) { + let menu_cut_disabled, menu_copy_disabled; + + BrowserTestUtils.loadURIString( + browser, + "data:text/html,
hello!
" + ); + await BrowserTestUtils.browserLoaded(browser); + browser.focus(); + await new Promise(resolve => waitForFocus(resolve, window)); + await new Promise(resolve => + window.requestAnimationFrame(() => executeSoon(resolve)) + ); + await new Promise(openMenu); + menu_cut_disabled = + menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true"; + is(menu_cut_disabled, false, "menu_cut should be enabled"); + menu_copy_disabled = + menuPopup.querySelector("#menu_copy").getAttribute("disabled") == + "true"; + is(menu_copy_disabled, false, "menu_copy should be enabled"); + await new Promise(closeMenu); + + // When there is no text selected in the contentEditable, we expect the Cut + // and Copy commands to be disabled. + BrowserTestUtils.loadURIString( + browser, + "data:text/html,
hello!
" + ); + await BrowserTestUtils.browserLoaded(browser); + browser.focus(); + await new Promise(resolve => waitForFocus(resolve, window)); + await new Promise(resolve => + window.requestAnimationFrame(() => executeSoon(resolve)) + ); + await new Promise(openMenu); + menu_cut_disabled = + menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true"; + is(menu_cut_disabled, true, "menu_cut should be disabled"); + menu_copy_disabled = + menuPopup.querySelector("#menu_copy").getAttribute("disabled") == + "true"; + is(menu_copy_disabled, true, "menu_copy should be disabled"); + await new Promise(closeMenu); + + // When the text of the contentEditable is selected, the Cut and Copy commands + // should be enabled. + BrowserTestUtils.loadURIString( + browser, + "data:text/html,
hello!
" + ); + await BrowserTestUtils.browserLoaded(browser); + browser.focus(); + await new Promise(resolve => waitForFocus(resolve, window)); + await new Promise(resolve => + window.requestAnimationFrame(() => executeSoon(resolve)) + ); + await new Promise(openMenu); + menu_cut_disabled = + menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true"; + is(menu_cut_disabled, false, "menu_cut should be enabled"); + menu_copy_disabled = + menuPopup.querySelector("#menu_copy").getAttribute("disabled") == + "true"; + is(menu_copy_disabled, false, "menu_copy should be enabled"); + await new Promise(closeMenu); + + BrowserTestUtils.loadURIString(browser, "about:preferences"); + await BrowserTestUtils.browserLoaded(browser); + browser.focus(); + await new Promise(resolve => waitForFocus(resolve, window)); + await new Promise(resolve => + window.requestAnimationFrame(() => executeSoon(resolve)) + ); + await new Promise(openMenu); + menu_cut_disabled = + menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true"; + is(menu_cut_disabled, true, "menu_cut should be disabled"); + menu_copy_disabled = + menuPopup.querySelector("#menu_copy").getAttribute("disabled") == + "true"; + is(menu_copy_disabled, true, "menu_copy should be disabled"); + await new Promise(closeMenu); + } + ); +}); diff --git a/toolkit/content/tests/browser/browser_bug1198465.js b/toolkit/content/tests/browser/browser_bug1198465.js new file mode 100644 index 0000000000..52a3705ac4 --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug1198465.js @@ -0,0 +1,76 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +var kPrefName = "accessibility.typeaheadfind.prefillwithselection"; +var kEmptyURI = "data:text/html,"; + +// This pref is false by default in OSX; ensure the test still works there. +Services.prefs.setBoolPref(kPrefName, true); + +registerCleanupFunction(function () { + Services.prefs.clearUserPref(kPrefName); +}); + +add_task(async function () { + let aTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kEmptyURI); + ok(!gFindBarInitialized, "findbar isn't initialized yet"); + + // Note: the use case here is when the user types directly in the findbar + // _before_ it's prefilled with a text selection in the page. + + // So `yield BrowserTestUtils.sendChar()` can't be used here: + // - synthesizing a key in the browser won't actually send it to the + // findbar; the findbar isn't part of the browser content. + // - we need to _not_ wait for _startFindDeferred to be resolved; yielding + // a synthesized keypress on the browser implicitely happens after the + // browser has dispatched its return message with the prefill value for + // the findbar, which essentially nulls these tests. + + // The parent-side of the sidebar initialization is also async, so we do + // need to wait for that. We verify a bit further down that _startFindDeferred + // hasn't been resolved yet. + await gFindBarPromise; + + let findBar = gFindBar; + is(findBar._findField.value, "", "findbar is empty"); + + // Test 1 + // Any input in the findbar should erase a previous search. + + findBar._findField.value = "xy"; + findBar.startFind(); + is(findBar._findField.value, "xy", "findbar should have xy initial query"); + is(findBar._findField, document.activeElement, "findbar is now focused"); + + EventUtils.sendChar("z", window); + is(findBar._findField.value, "z", "z erases xy"); + + findBar._findField.value = ""; + ok(!findBar._findField.value, "erase findbar after first test"); + + // Test 2 + // Prefilling the findbar should be ignored if a search has been run. + + findBar.startFind(); + ok(findBar._startFindDeferred, "prefilled value hasn't been fetched yet"); + is(findBar._findField, document.activeElement, "findbar is still focused"); + + EventUtils.sendChar("a", window); + EventUtils.sendChar("b", window); + is(findBar._findField.value, "ab", "initial ab typed in the findbar"); + + // This resolves _startFindDeferred if it's still pending; let's just skip + // over waiting for the browser's return message that should do this as it + // doesn't really matter. + findBar.onCurrentSelection("foo", true); + ok(!findBar._startFindDeferred, "prefilled value fetched"); + is(findBar._findField.value, "ab", "ab kept instead of prefill value"); + + EventUtils.sendChar("c", window); + is(findBar._findField.value, "abc", "c is appended after ab"); + + // Clear the findField value to make the test run successfully + // for multiple runs in the same browser session. + findBar._findField.value = ""; + BrowserTestUtils.removeTab(aTab); +}); diff --git a/toolkit/content/tests/browser/browser_bug1572798.js b/toolkit/content/tests/browser/browser_bug1572798.js new file mode 100644 index 0000000000..0e15ef4f3d --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug1572798.js @@ -0,0 +1,29 @@ +add_task(async function test_bug_1572798() { + let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank"); + BrowserTestUtils.loadURIString( + tab.linkedBrowser, + "https://example.com/browser/toolkit/content/tests/browser/file_document_open_audio.html" + ); + await BrowserTestUtils.browserLoaded(tab.linkedBrowser); + let windowLoaded = BrowserTestUtils.waitForNewWindow(); + info("- clicking button to spawn a new window -"); + await ContentTask.spawn(tab.linkedBrowser, null, function () { + content.document.querySelector("button").click(); + }); + info("- waiting for the new window -"); + let newWin = await windowLoaded; + info("- checking that the new window plays the audio -"); + let documentOpenedBrowser = newWin.gBrowser.selectedBrowser; + await ContentTask.spawn(documentOpenedBrowser, null, async function () { + try { + await content.document.querySelector("audio").play(); + ok(true, "Could play the audio"); + } catch (e) { + ok(false, "Rejected audio promise" + e); + } + }); + + info("- Cleaning up -"); + await BrowserTestUtils.closeWindow(newWin); + await BrowserTestUtils.removeTab(tab); +}); diff --git a/toolkit/content/tests/browser/browser_bug1693577.js b/toolkit/content/tests/browser/browser_bug1693577.js new file mode 100644 index 0000000000..712749dc89 --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug1693577.js @@ -0,0 +1,49 @@ +/* + * This test checks that the popupshowing event for input fields, which do not + * have a dedicated contextmenu event, but use the global one (added by + * editMenuOverlay.js, see bug 1693577) include a triggerNode. + * + * The search-input field of the browser-sidebar is one of the rare cases in + * mozilla-central, which can be used to test this. There are a few more in + * comm-central, which need the triggerNode information. + */ + +add_task(async function test_search_input_popupshowing() { + let sidebar = document.getElementById("sidebar"); + + let loadPromise = BrowserTestUtils.waitForEvent(sidebar, "load", true); + SidebarUI.toggle("viewBookmarksSidebar"); + await loadPromise; + + let inputField = + sidebar.contentDocument.getElementById("search-box").inputField; + const popupshowing = BrowserTestUtils.waitForEvent( + sidebar.contentWindow, + "popupshowing" + ); + + EventUtils.synthesizeMouseAtCenter( + inputField, + { + type: "contextmenu", + button: 2, + }, + sidebar.contentWindow + ); + let popupshowingEvent = await popupshowing; + + Assert.equal( + popupshowingEvent.target.triggerNode?.id, + "search-box", + "Popupshowing event for the search input includes triggernode." + ); + + const popup = popupshowingEvent.target; + await BrowserTestUtils.waitForEvent(popup, "popupshown"); + + const popuphidden = BrowserTestUtils.waitForEvent(popup, "popuphidden"); + popup.hidePopup(); + await popuphidden; + + SidebarUI.toggle("viewBookmarksSidebar"); +}); diff --git a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js new file mode 100644 index 0000000000..431fdf048f --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js @@ -0,0 +1,389 @@ +requestLongerTimeout(2); +add_task(async function () { + function pushPrefs(prefs) { + return SpecialPowers.pushPrefEnv({ set: prefs }); + } + + await pushPrefs([ + ["general.autoScroll", true], + ["test.events.async.enabled", true], + ]); + + const expectScrollNone = 0; + const expectScrollVert = 1; + const expectScrollHori = 2; + const expectScrollBoth = 3; + + var allTests = [ + { + dataUri: + 'data:text/html,\ +
\ +
\ +
\ +
\ + \ + \ +
\ +
\ + \ + ', + }, + { elem: "a", expected: expectScrollNone }, + { elem: "b", expected: expectScrollBoth }, + { elem: "c", expected: expectScrollHori }, + { elem: "d", expected: expectScrollVert }, + { elem: "e", expected: expectScrollVert }, + { elem: "f", expected: expectScrollNone }, + { elem: "g", expected: expectScrollBoth }, + { elem: "h", expected: expectScrollNone }, + { + dataUri: + 'data:text/html,
\ + \ + ', + }, + { elem: "i", expected: expectScrollVert }, // bug 695121 + { + dataUri: + 'data:text/html,\ +
\ + \ + ', + }, + { elem: "j", expected: expectScrollVert }, // bug 914251 + { + dataUri: + 'data:text/html,\ +\ +
', + }, + { elem: "t", expected: expectScrollBoth }, // bug 1308775 + { + dataUri: + 'data:text/html,\ +
\ +\ +
\ +
\ +\ +
\ +\ +
filler to make document overflow: scroll;
\ +', + }, + { elem: "k", expected: expectScrollBoth }, + { elem: "k", expected: expectScrollNone, testwindow: true }, + { elem: "l", expected: expectScrollNone }, + { elem: "m", expected: expectScrollVert, testwindow: true }, + { + dataUri: + 'data:text/html,\ +image map\ +\ + \ +\ +link\ +\ +\ +
\ +', + }, + { elem: "n", expected: expectScrollNone, testwindow: true }, + { elem: "o", expected: expectScrollNone, testwindow: true }, + { + elem: "p", + expected: expectScrollVert, + testwindow: true, + middlemousepastepref: false, + }, + { + elem: "q", + expected: expectScrollVert, + testwindow: true, + middlemousepastepref: false, + }, + { + dataUri: + 'data:text/html,\ +\ +\ +
\ +', + }, + { + elem: "r", + expected: expectScrollNone, + testwindow: true, + middlemousepastepref: true, + }, + { + elem: "s", + expected: expectScrollNone, + testwindow: true, + middlemousepastepref: true, + }, + { + dataUri: + "data:text/html," + + encodeURIComponent(` + + +
+ `), + }, + { + elem: "i", + // We expect the outer window to scroll vertically, not the iframe's window. + expected: expectScrollVert, + testwindow: true, + }, + { + dataUri: + "data:text/html," + + encodeURIComponent(` + + +
+ `), + }, + { + elem: "i", + // We expect the iframe's window to scroll vertically, so the outer window should not scroll. + expected: expectScrollNone, + testwindow: true, + }, + { + // Test: scroll is initiated in out of process iframe having no scrollable area + dataUri: + "data:text/html," + + encodeURIComponent(` + + +
+ +
+
+ `), + }, + { + elem: "noscroll-outofprocess-iframe", + // We expect the div to scroll vertically, not the iframe's window. + expected: expectScrollVert, + scrollable: "scroller", + }, + ]; + + for (let test of allTests) { + if (test.dataUri) { + let loadedPromise = BrowserTestUtils.browserLoaded( + gBrowser.selectedBrowser + ); + BrowserTestUtils.loadURIString(gBrowser, test.dataUri); + await loadedPromise; + await ContentTask.spawn(gBrowser.selectedBrowser, {}, async () => { + // Wait for a paint so that hit-testing works correctly. + await new Promise(resolve => + content.requestAnimationFrame(() => + content.requestAnimationFrame(resolve) + ) + ); + }); + continue; + } + + let prefsChanged = "middlemousepastepref" in test; + if (prefsChanged) { + await pushPrefs([["middlemouse.paste", test.middlemousepastepref]]); + } + + await BrowserTestUtils.synthesizeMouse( + "#" + test.elem, + 50, + 80, + { button: 1 }, + gBrowser.selectedBrowser + ); + + // This ensures bug 605127 is fixed: pagehide in an unrelated document + // should not cancel the autoscroll. + await ContentTask.spawn( + gBrowser.selectedBrowser, + { waitForAutoScrollStart: test.expected != expectScrollNone }, + async ({ waitForAutoScrollStart }) => { + var iframe = content.document.getElementById("iframe"); + + if (iframe) { + var e = new iframe.contentWindow.PageTransitionEvent("pagehide", { + bubbles: true, + cancelable: true, + persisted: false, + }); + iframe.contentDocument.dispatchEvent(e); + iframe.contentDocument.documentElement.dispatchEvent(e); + } + if (waitForAutoScrollStart) { + await new Promise(resolve => + Services.obs.addObserver(resolve, "autoscroll-start") + ); + } + } + ); + + is( + document.activeElement, + gBrowser.selectedBrowser, + "Browser still focused after autoscroll started" + ); + + await BrowserTestUtils.synthesizeMouse( + "#" + test.elem, + 100, + 100, + { type: "mousemove", clickCount: "0" }, + gBrowser.selectedBrowser + ); + + if (prefsChanged) { + await SpecialPowers.popPrefEnv(); + } + + // Start checking for the scroll. + let firstTimestamp = undefined; + let timeCompensation; + do { + let timestamp = await new Promise(resolve => + window.requestAnimationFrame(resolve) + ); + if (firstTimestamp === undefined) { + firstTimestamp = timestamp; + } + + // This value is calculated similarly to the value of the same name in + // ClickEventHandler.autoscrollLoop, except here it's cumulative across + // all frames after the first one instead of being based only on the + // current frame. + timeCompensation = (timestamp - firstTimestamp) / 20; + info( + "timestamp=" + + timestamp + + " firstTimestamp=" + + firstTimestamp + + " timeCompensation=" + + timeCompensation + ); + + // Try to wait until enough time has passed to allow the scroll to happen. + // autoscrollLoop incrementally scrolls during each animation frame, but + // due to how its calculations work, when a frame is very close to the + // previous frame, no scrolling may actually occur during that frame. + // After 100ms's worth of frames, timeCompensation will be 1, making it + // more likely that the accumulated scroll in autoscrollLoop will be >= 1, + // although it also depends on acceleration, which here in this test + // should be > 1 due to how it synthesizes mouse events below. + } while (timeCompensation < 5); + + // Close the autoscroll popup by synthesizing Esc. + EventUtils.synthesizeKey("KEY_Escape"); + let scrollVert = test.expected & expectScrollVert; + let scrollHori = test.expected & expectScrollHori; + + await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [ + { + scrollVert, + scrollHori, + elemid: test.scrollable || test.elem, + checkWindow: test.testwindow, + }, + ], + async function (args) { + let msg = ""; + if (args.checkWindow) { + if ( + !( + (args.scrollVert && content.scrollY > 0) || + (!args.scrollVert && content.scrollY == 0) + ) + ) { + msg += "Failed: "; + } + msg += + "Window for " + + args.elemid + + " should" + + (args.scrollVert ? "" : " not") + + " have scrolled vertically\n"; + + if ( + !( + (args.scrollHori && content.scrollX > 0) || + (!args.scrollHori && content.scrollX == 0) + ) + ) { + msg += "Failed: "; + } + msg += + " Window for " + + args.elemid + + " should" + + (args.scrollHori ? "" : " not") + + " have scrolled horizontally\n"; + } else { + let elem = content.document.getElementById(args.elemid); + if ( + !( + (args.scrollVert && elem.scrollTop > 0) || + (!args.scrollVert && elem.scrollTop == 0) + ) + ) { + msg += "Failed: "; + } + msg += + " " + + args.elemid + + " should" + + (args.scrollVert ? "" : " not") + + " have scrolled vertically\n"; + if ( + !( + (args.scrollHori && elem.scrollLeft > 0) || + (!args.scrollHori && elem.scrollLeft == 0) + ) + ) { + msg += "Failed: "; + } + msg += + args.elemid + + " should" + + (args.scrollHori ? "" : " not") + + " have scrolled horizontally"; + } + + Assert.ok(!msg.includes("Failed"), msg); + } + ); + + // Before continuing the test, we need to ensure that the IPC + // message that stops autoscrolling has had time to arrive. + await new Promise(resolve => executeSoon(resolve)); + } + + // remove 2 tabs that were opened by middle-click on links + while (gBrowser.visibleTabs.length > 1) { + gBrowser.removeTab(gBrowser.visibleTabs[gBrowser.visibleTabs.length - 1]); + } + + // wait for focus to fix a failure in the next test if the latter runs too soon. + await SimpleTest.promiseFocus(); +}); diff --git a/toolkit/content/tests/browser/browser_bug451286.js b/toolkit/content/tests/browser/browser_bug451286.js new file mode 100644 index 0000000000..e7f03c96f7 --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug451286.js @@ -0,0 +1,166 @@ +Services.scriptloader.loadSubScript( + "chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js", + this +); + +add_task(async function () { + const SEARCH_TEXT = "text"; + const DATAURI = "data:text/html," + SEARCH_TEXT; + + // Bug 451286. An iframe that should be highlighted + let visible = ""; + + // Bug 493658. An invisible iframe that shouldn't interfere with + // highlighting matches lying after it in the document + let invisible = + ""; + + let uri = DATAURI + invisible + SEARCH_TEXT + visible + SEARCH_TEXT; + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, uri); + let contentRect = tab.linkedBrowser.getBoundingClientRect(); + let noHighlightSnapshot = snapshotRect(window, contentRect); + ok(noHighlightSnapshot, "Got noHighlightSnapshot"); + + await openFindBarAndWait(); + gFindBar._findField.value = SEARCH_TEXT; + await findAgainAndWait(); + var matchCase = gFindBar.getElement("find-case-sensitive"); + if (matchCase.checked) { + matchCase.doCommand(); + } + + // Turn on highlighting + await toggleHighlightAndWait(true); + await closeFindBarAndWait(); + + // Take snapshot of highlighting + let findSnapshot = snapshotRect(window, contentRect); + ok(findSnapshot, "Got findSnapshot"); + + // Now, remove the highlighting, and take a snapshot to compare + // to our original state + await openFindBarAndWait(); + await toggleHighlightAndWait(false); + await closeFindBarAndWait(); + + let unhighlightSnapshot = snapshotRect(window, contentRect); + ok(unhighlightSnapshot, "Got unhighlightSnapshot"); + + // Select the matches that should have been highlighted manually + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + let doc = content.document; + let win = doc.defaultView; + + // Create a manual highlight in the visible iframe to test bug 451286 + let iframe = doc.getElementById("visible"); + let ifBody = iframe.contentDocument.body; + let range = iframe.contentDocument.createRange(); + range.selectNodeContents(ifBody.childNodes[0]); + let ifWindow = iframe.contentWindow; + let ifDocShell = ifWindow.docShell; + + let ifController = ifDocShell + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsISelectionDisplay) + .QueryInterface(Ci.nsISelectionController); + + let frameFindSelection = ifController.getSelection( + ifController.SELECTION_FIND + ); + frameFindSelection.addRange(range); + + // Create manual highlights in the main document (the matches that lie + // before/after the iframes + let docShell = win.docShell; + + let controller = docShell + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsISelectionDisplay) + .QueryInterface(Ci.nsISelectionController); + + let docFindSelection = controller.getSelection(ifController.SELECTION_FIND); + + range = doc.createRange(); + range.selectNodeContents(doc.body.childNodes[0]); + docFindSelection.addRange(range); + range = doc.createRange(); + range.selectNodeContents(doc.body.childNodes[2]); + docFindSelection.addRange(range); + range = doc.createRange(); + range.selectNodeContents(doc.body.childNodes[4]); + docFindSelection.addRange(range); + }); + + // Take snapshot of manual highlighting + let manualSnapshot = snapshotRect(window, contentRect); + ok(manualSnapshot, "Got manualSnapshot"); + + // Test 1: Were the matches in iframe correctly highlighted? + let res = compareSnapshots(findSnapshot, manualSnapshot, true); + ok(res[0], "Matches found in iframe correctly highlighted"); + + // Test 2: Were the matches in iframe correctly unhighlighted? + res = compareSnapshots(noHighlightSnapshot, unhighlightSnapshot, true); + ok(res[0], "Highlighting in iframe correctly removed"); + + BrowserTestUtils.removeTab(tab); +}); + +function toggleHighlightAndWait(shouldHighlight) { + return new Promise(resolve => { + let listener = { + onFindResult() {}, + onHighlightFinished() { + gFindBar.browser.finder.removeResultListener(listener); + resolve(); + }, + onMatchesCountResult() {}, + }; + gFindBar.browser.finder.addResultListener(listener); + gFindBar.toggleHighlight(shouldHighlight); + }); +} + +function findAgainAndWait() { + return new Promise(resolve => { + let listener = { + onFindResult() { + gFindBar.browser.finder.removeResultListener(listener); + resolve(); + }, + onHighlightFinished() {}, + onMatchesCountResult() {}, + }; + gFindBar.browser.finder.addResultListener(listener); + gFindBar.onFindAgainCommand(); + }); +} + +async function openFindBarAndWait() { + await gFindBarPromise; + let awaitTransitionEnd = BrowserTestUtils.waitForEvent( + gFindBar, + "transitionend" + ); + gFindBar.open(); + await awaitTransitionEnd; +} + +// This test is comparing snapshots. It is necessary to wait for the gFindBar +// to close before taking the snapshot so the gFindBar does not take up space +// on the new snapshot. +async function closeFindBarAndWait() { + let awaitTransitionEnd = BrowserTestUtils.waitForEvent( + gFindBar, + "transitionend", + false, + event => { + return event.propertyName == "visibility"; + } + ); + gFindBar.close(); + await awaitTransitionEnd; +} diff --git a/toolkit/content/tests/browser/browser_bug594509.js b/toolkit/content/tests/browser/browser_bug594509.js new file mode 100644 index 0000000000..b177c00d7c --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug594509.js @@ -0,0 +1,15 @@ +add_task(async function () { + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:rights" + ); + + await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { + Assert.ok( + content.document.getElementById("your-rights"), + "about:rights content loaded" + ); + }); + + BrowserTestUtils.removeTab(tab); +}); diff --git a/toolkit/content/tests/browser/browser_bug982298.js b/toolkit/content/tests/browser/browser_bug982298.js new file mode 100644 index 0000000000..94846ff1cd --- /dev/null +++ b/toolkit/content/tests/browser/browser_bug982298.js @@ -0,0 +1,77 @@ +const scrollHtml = + 'blank'; + +add_task(async function () { + let url = "data:text/html;base64," + btoa(scrollHtml); + await BrowserTestUtils.withNewTab( + { gBrowser, url }, + async function (browser) { + let awaitFindResult = new Promise(resolve => { + let listener = { + onFindResult(aData) { + info("got find result"); + browser.finder.removeResultListener(listener); + + ok( + aData.result == Ci.nsITypeAheadFind.FIND_FOUND, + "should find string" + ); + resolve(); + }, + onCurrentSelection() {}, + onMatchesCountResult() {}, + }; + info( + "about to add results listener, open find bar, and send 'F' string" + ); + browser.finder.addResultListener(listener); + }); + await gFindBarPromise; + gFindBar.onFindCommand(); + EventUtils.sendString("F"); + info("added result listener and sent string 'F'"); + await awaitFindResult; + + // scroll textarea to bottom + await SpecialPowers.spawn(browser, [], () => { + let textarea = content.document.getElementById("textarea1"); + textarea.scrollTop = textarea.scrollHeight; + }); + BrowserTestUtils.loadURIString(browser, "about:blank"); + await BrowserTestUtils.browserLoaded(browser); + + ok( + browser.currentURI.spec == "about:blank", + "got load event for about:blank" + ); + + let awaitFindResult2 = new Promise(resolve => { + let listener = { + onFindResult(aData) { + info("got find result #2"); + browser.finder.removeResultListener(listener); + resolve(); + }, + onCurrentSelection() {}, + onMatchesCountResult() {}, + }; + + browser.finder.addResultListener(listener); + info("added result listener"); + }); + // find again needs delay for crash test + setTimeout(function () { + // ignore exception if occured + try { + info("about to send find again command"); + gFindBar.onFindAgainCommand(false); + info("sent find again command"); + } catch (e) { + info("got exception from onFindAgainCommand: " + e); + } + }, 0); + await awaitFindResult2; + } + ); +}); diff --git a/toolkit/content/tests/browser/browser_cancel_starting_autoscrolling_requested_by_background_tab.js b/toolkit/content/tests/browser/browser_cancel_starting_autoscrolling_requested_by_background_tab.js new file mode 100644 index 0000000000..989c91f2fb --- /dev/null +++ b/toolkit/content/tests/browser/browser_cancel_starting_autoscrolling_requested_by_background_tab.js @@ -0,0 +1,156 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_task(async function testStopStartingAutoScroll() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["general.autoScroll", true], + ["middlemouse.contentLoadURL", false], + ["test.events.async.enabled", true], + [ + "accessibility.mouse_focuses_formcontrol", + !navigator.platform.includes("Mac"), + ], + ], + }); + + await BrowserTestUtils.withNewTab( + "https://example.com/browser/toolkit/content/tests/browser/file_empty.html", + async function (browser) { + async function doTest({ + aInnerHTML, + aDescription, + aExpectedActiveElement, + }) { + await SpecialPowers.spawn(browser, [aInnerHTML], async contentHTML => { + // eslint-disable-next-line no-unsanitized/property + content.document.body.innerHTML = contentHTML; + content.document.documentElement.scrollTop; // Flush layout. + const iframe = content.document.querySelector("iframe"); + // If the test page has an iframe, we need to ensure it has loaded. + if (!iframe || iframe.contentDocument?.readyState == "complete") { + return; + } + // It's too late to check "load" event. Let's check + // Document#readyState instead. + await ContentTaskUtils.waitForCondition( + () => iframe.contentDocument?.readyState == "complete", + "Waiting for loading the subdocument" + ); + }); + + let autoScroller; + let onPopupShown = event => { + if (event.originalTarget.id !== "autoscroller") { + return false; + } + autoScroller = event.originalTarget; + info(`${aDescription}: "popupshown" event is fired`); + autoScroller.getBoundingClientRect(); // Flush layout of the autoscroller + return true; + }; + window.addEventListener("popupshown", onPopupShown, { capture: true }); + registerCleanupFunction(() => { + window.removeEventListener("popupshown", onPopupShown, { + capture: true, + }); + }); + + let waitForNewTabForeground = BrowserTestUtils.waitForEvent( + gBrowser, + "TabSwitchDone" + ); + await EventUtils.promiseNativeMouseEvent({ + type: "mousedown", + button: 1, // middle click + target: browser, + atCenter: true, + }); + info(`${aDescription}: Waiting for active tab switched...`); + await waitForNewTabForeground; + // To confirm that autoscrolling won't start accidentally, we should + // wait a while. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(resolve => setTimeout(resolve, 500)); + is( + autoScroller, + undefined, + `${aDescription}: autoscroller should not be open because requested tab is now in background` + ); + // Clean up + await EventUtils.promiseNativeMouseEvent({ + type: "mouseup", + button: 1, // middle click + target: browser, + atCenter: true, + }); // release implicit capture + EventUtils.synthesizeKey("KEY_Escape"); // To close unexpected autoscroller + isnot( + browser, + gBrowser.selectedBrowser, + `${aDescription}: The clicked tab shouldn't be foreground tab` + ); + is( + gBrowser.selectedTab, + gBrowser.tabs[gBrowser.tabs.length - 1], + `${aDescription}: The opened tab should be foreground tab` + ); + await SpecialPowers.spawn( + browser, + [aExpectedActiveElement, aDescription], + (expectedActiveElement, description) => { + if (expectedActiveElement != null) { + if (expectedActiveElement == "iframe") { + // Check only whether the subdocument gets focus. + return; + } + Assert.equal( + content.document.activeElement, + content.document.querySelector(expectedActiveElement), + `${description}: Active element should be the result of querySelector("${expectedActiveElement}")` + ); + } else { + Assert.deepEqual( + content.document.activeElement, + new content.window.Object(null), + `${description}: No element should be active` + ); + } + } + ); + gBrowser.removeTab(gBrowser.tabs[gBrowser.tabs.length - 1]); + await SimpleTest.promiseFocus(browser); + if (aExpectedActiveElement == "iframe") { + await SpecialPowers.spawn(browser, [aDescription], description => { + // XXX Due to no `Assert#todo`, this checks opposite result. + Assert.ok( + !content.document + .querySelector("iframe") + .contentDocument.hasFocus(), + `TODO: ${description}: The subdocument should have focus when the tab gets foreground` + ); + }); + } + } + await doTest({ + aInnerHTML: `
Click to open new tab
`, + aDescription: "Clicking non-focusable
with middle mouse button", + aExpectedActiveElement: null, + }); + await doTest({ + aInnerHTML: ``, + aDescription: `Clicking focusable + + + diff --git a/toolkit/content/tests/browser/firebird.png b/toolkit/content/tests/browser/firebird.png new file mode 100644 index 0000000000..de5c22f8ce Binary files /dev/null and b/toolkit/content/tests/browser/firebird.png differ diff --git a/toolkit/content/tests/browser/firebird.png^headers^ b/toolkit/content/tests/browser/firebird.png^headers^ new file mode 100644 index 0000000000..2918fdbe5f --- /dev/null +++ b/toolkit/content/tests/browser/firebird.png^headers^ @@ -0,0 +1,2 @@ +HTTP 302 Found +Location: doggy.png diff --git a/toolkit/content/tests/browser/gizmo-noaudio.webm b/toolkit/content/tests/browser/gizmo-noaudio.webm new file mode 100644 index 0000000000..9f412cb6e3 Binary files /dev/null and b/toolkit/content/tests/browser/gizmo-noaudio.webm differ diff --git a/toolkit/content/tests/browser/gizmo.mp4 b/toolkit/content/tests/browser/gizmo.mp4 new file mode 100644 index 0000000000..87efad5ade Binary files /dev/null and b/toolkit/content/tests/browser/gizmo.mp4 differ diff --git a/toolkit/content/tests/browser/head.js b/toolkit/content/tests/browser/head.js new file mode 100644 index 0000000000..2cf411479a --- /dev/null +++ b/toolkit/content/tests/browser/head.js @@ -0,0 +1,244 @@ +"use strict"; + +/** + * Set the findbar value to the given text, start a search for that text, and + * return a promise that resolves when the find has completed. + * + * @param gBrowser tabbrowser to search in the current tab. + * @param searchText text to search for. + * @param highlightOn true if highlight mode should be enabled before searching. + * @returns Promise resolves when find is complete. + */ +async function promiseFindFinished(gBrowser, searchText, highlightOn = false) { + let findbar = await gBrowser.getFindBar(); + findbar.startFind(findbar.FIND_NORMAL); + let highlightElement = findbar.getElement("highlight"); + if (highlightElement.checked != highlightOn) { + highlightElement.click(); + } + return new Promise(resolve => { + executeSoon(() => { + findbar._findField.value = searchText; + + let resultListener; + // When highlighting is on the finder sends a second "FOUND" message after + // the search wraps. This causes timing problems with e10s. waitMore + // forces foundOrTimeout wait for the second "FOUND" message before + // resolving the promise. + let waitMore = highlightOn; + let findTimeout = setTimeout(() => foundOrTimedout(null), 5000); + let foundOrTimedout = function (aData) { + if (aData !== null && waitMore) { + waitMore = false; + return; + } + if (aData === null) { + info("Result listener not called, timeout reached."); + } + clearTimeout(findTimeout); + findbar.browser?.finder.removeResultListener(resultListener); + resolve(); + }; + + resultListener = { + onFindResult: foundOrTimedout, + onCurrentSelection() {}, + onMatchesCountResult() {}, + onHighlightFinished() {}, + }; + findbar.browser.finder.addResultListener(resultListener); + findbar._find(); + }); + }); +} + +/** + * A wrapper for the findbar's method "close", which is not synchronous + * because of animation. + */ +function closeFindbarAndWait(findbar) { + return new Promise(resolve => { + if (findbar.hidden) { + resolve(); + return; + } + findbar.addEventListener("transitionend", function cont(aEvent) { + if (aEvent.propertyName != "visibility") { + return; + } + findbar.removeEventListener("transitionend", cont); + resolve(); + }); + let close = findbar.getElement("find-closebutton"); + close.doCommand(); + }); +} + +function pushPrefs(...aPrefs) { + return new Promise(resolve => { + SpecialPowers.pushPrefEnv({ set: aPrefs }, resolve); + }); +} + +/** + * Used to check whether the audio unblocking icon is in the tab. + */ +async function waitForTabBlockEvent(tab, expectBlocked) { + if (tab.activeMediaBlocked == expectBlocked) { + ok(true, "The tab should " + (expectBlocked ? "" : "not ") + "be blocked"); + } else { + info("Block state doens't match, wait for attributes changes."); + await BrowserTestUtils.waitForEvent( + tab, + "TabAttrModified", + false, + event => { + if (event.detail.changed.includes("activemedia-blocked")) { + is( + tab.activeMediaBlocked, + expectBlocked, + "The tab should " + (expectBlocked ? "" : "not ") + "be blocked" + ); + return true; + } + return false; + } + ); + } +} + +/** + * Used to check whether the tab has soundplaying attribute. + */ +async function waitForTabPlayingEvent(tab, expectPlaying) { + if (tab.soundPlaying == expectPlaying) { + ok(true, "The tab should " + (expectPlaying ? "" : "not ") + "be playing"); + } else { + info("Playing state doesn't match, wait for attributes changes."); + await BrowserTestUtils.waitForEvent( + tab, + "TabAttrModified", + false, + event => { + if (event.detail.changed.includes("soundplaying")) { + is( + tab.soundPlaying, + expectPlaying, + "The tab should " + (expectPlaying ? "" : "not ") + "be playing" + ); + return true; + } + return false; + } + ); + } +} + +function disable_non_test_mouse(disable) { + let utils = window.windowUtils; + utils.disableNonTestMouseEvents(disable); +} + +function hover_icon(icon, tooltip) { + disable_non_test_mouse(true); + + let popupShownPromise = BrowserTestUtils.waitForEvent(tooltip, "popupshown"); + EventUtils.synthesizeMouse(icon, 1, 1, { type: "mouseover" }); + EventUtils.synthesizeMouse(icon, 2, 2, { type: "mousemove" }); + EventUtils.synthesizeMouse(icon, 3, 3, { type: "mousemove" }); + EventUtils.synthesizeMouse(icon, 4, 4, { type: "mousemove" }); + return popupShownPromise; +} + +function leave_icon(icon) { + EventUtils.synthesizeMouse(icon, 0, 0, { type: "mouseout" }); + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mousemove", + }); + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mousemove", + }); + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mousemove", + }); + + disable_non_test_mouse(false); +} + +/** + * Used to listen events if you just need it once + */ +function once(target, name) { + var p = new Promise(function (resolve, reject) { + target.addEventListener( + name, + function () { + resolve(); + }, + { once: true } + ); + }); + return p; +} + +/** + * check if current wakelock is equal to expected state, if not, then wait until + * the wakelock changes its state to expected state. + * @param needLock + * the wakolock should be locked or not + * @param isForegroundLock + * when the lock is on, the wakelock should be in the foreground or not + */ +async function waitForExpectedWakeLockState( + topic, + { needLock, isForegroundLock } +) { + const powerManagerService = Cc["@mozilla.org/power/powermanagerservice;1"]; + const powerManager = powerManagerService.getService( + Ci.nsIPowerManagerService + ); + const wakelockState = powerManager.getWakeLockState(topic); + let expectedLockState = "unlocked"; + if (needLock) { + expectedLockState = isForegroundLock + ? "locked-foreground" + : "locked-background"; + } + if (wakelockState != expectedLockState) { + info(`wait until wakelock becomes ${expectedLockState}`); + await wakeLockObserved( + powerManager, + topic, + state => state == expectedLockState + ); + } + is( + powerManager.getWakeLockState(topic), + expectedLockState, + `the wakelock state for '${topic}' is equal to '${expectedLockState}'` + ); +} + +function wakeLockObserved(powerManager, observeTopic, checkFn) { + return new Promise(resolve => { + function wakeLockListener() {} + wakeLockListener.prototype = { + QueryInterface: ChromeUtils.generateQI(["nsIDOMMozWakeLockListener"]), + callback(topic, state) { + if (topic == observeTopic && checkFn(state)) { + powerManager.removeWakeLockListener(wakeLockListener.prototype); + resolve(); + } + }, + }; + powerManager.addWakeLockListener(wakeLockListener.prototype); + }); +} + +function getTestWebBasedURL(fileName, { crossOrigin = false } = {}) { + const origin = crossOrigin ? "http://example.org" : "http://example.com"; + return ( + getRootDirectory(gTestPath).replace("chrome://mochitests/content", origin) + + fileName + ); +} diff --git a/toolkit/content/tests/browser/image.jpg b/toolkit/content/tests/browser/image.jpg new file mode 100644 index 0000000000..5031808ad2 Binary files /dev/null and b/toolkit/content/tests/browser/image.jpg differ diff --git a/toolkit/content/tests/browser/image_page.html b/toolkit/content/tests/browser/image_page.html new file mode 100644 index 0000000000..522a1d8cf9 --- /dev/null +++ b/toolkit/content/tests/browser/image_page.html @@ -0,0 +1,9 @@ + + + + +OHAI + + + + diff --git a/toolkit/content/tests/browser/silentAudioTrack.webm b/toolkit/content/tests/browser/silentAudioTrack.webm new file mode 100644 index 0000000000..8e08a86c45 Binary files /dev/null and b/toolkit/content/tests/browser/silentAudioTrack.webm differ diff --git a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js new file mode 100644 index 0000000000..26e4e80922 --- /dev/null +++ b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js @@ -0,0 +1,141 @@ +/* This code is mostly copied from chrome/test/unit/head_crtestutils.js */ + +// This file assumes chrome-harness.js is loaded in the global scope. +/* import-globals-from ../../../../testing/mochitest/chrome-harness.js */ + +const NS_CHROME_MANIFESTS_FILE_LIST = "ChromeML"; +const XUL_CACHE_PREF = "nglayout.debug.disable_xul_cache"; + +var gChromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService( + Ci.nsIXULChromeRegistry +); + +// Create the temporary file in the profile, instead of in TmpD, because +// we know the mochitest harness kills off the profile when it's done. +function copyToTemporaryFile(f) { + let tmpd = Services.dirsvc.get("ProfD", Ci.nsIFile); + let tmpf = tmpd.clone(); + tmpf.append("temp.manifest"); + tmpf.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); + tmpf.remove(false); + f.copyTo(tmpd, tmpf.leafName); + return tmpf; +} + +function* dirIter(directory) { + var testsDir = Services.io + .newURI(directory) + .QueryInterface(Ci.nsIFileURL).file; + + let en = testsDir.directoryEntries; + while (en.hasMoreElements()) { + yield en.nextFile; + } +} + +function getParent(path) { + let lastSlash = path.lastIndexOf("/"); + if (lastSlash == -1) { + lastSlash = path.lastIndexOf("\\"); + if (lastSlash == -1) { + return ""; + } + return "/" + path.substring(0, lastSlash).replace(/\\/g, "/"); + } + return path.substring(0, lastSlash); +} + +function copyDirToTempProfile(path, subdirname) { + if (subdirname === undefined) { + subdirname = "mochikit-tmp"; + } + + let tmpdir = Services.dirsvc.get("ProfD", Ci.nsIFile); + tmpdir.append(subdirname); + tmpdir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o777); + + let rootDir = getParent(path); + if (rootDir == "") { + return tmpdir; + } + + // The SimpleTest directory is hidden + var files = Array.from(dirIter("file://" + rootDir)); + for (let f in files) { + files[f].copyTo(tmpdir, ""); + } + return tmpdir; +} + +function convertChromeURI(chromeURI) { + let uri = Services.io.newURI(chromeURI); + return gChromeReg.convertChromeURL(uri); +} + +function chromeURIToFile(chromeURI) { + var jar = getJar(chromeURI); + if (jar) { + var tmpDir = extractJarToTmp(jar); + let parts = chromeURI.split("/"); + if (parts[parts.length - 1] != "") { + tmpDir.append(parts[parts.length - 1]); + } + return tmpDir; + } + + return convertChromeURI(chromeURI).QueryInterface(Ci.nsIFileURL).file; +} + +// Register a chrome manifest temporarily and return a function which un-does +// the registrarion when no longer needed. +function createManifestTemporarily(tempDir, manifestText) { + Services.prefs.setBoolPref(XUL_CACHE_PREF, true); + + tempDir.append("temp.manifest"); + + let foStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance( + Ci.nsIFileOutputStream + ); + foStream.init(tempDir, 0x02 | 0x08 | 0x20, 0o664, 0); // write, create, truncate + foStream.write(manifestText, manifestText.length); + foStream.close(); + let tempfile = copyToTemporaryFile(tempDir); + + Components.manager + .QueryInterface(Ci.nsIComponentRegistrar) + .autoRegister(tempfile); + + return function () { + tempfile.fileSize = 0; // truncate the manifest + gChromeReg.checkForNewChrome(); + Services.prefs.clearUserPref(XUL_CACHE_PREF); + }; +} + +// Register a chrome manifest temporarily and return a function which un-does +// the registrarion when no longer needed. +function registerManifestTemporarily(manifestURI) { + Services.prefs.setBoolPref(XUL_CACHE_PREF, true); + + let file = chromeURIToFile(manifestURI); + + let tempfile = copyToTemporaryFile(file); + Components.manager + .QueryInterface(Ci.nsIComponentRegistrar) + .autoRegister(tempfile); + + return function () { + tempfile.fileSize = 0; // truncate the manifest + gChromeReg.checkForNewChrome(); + Services.prefs.clearUserPref(XUL_CACHE_PREF); + }; +} + +function registerManifestPermanently(manifestURI) { + var chromepath = chromeURIToFile(manifestURI); + + Components.manager + .QueryInterface(Ci.nsIComponentRegistrar) + .autoRegister(chromepath); + return chromepath; +} diff --git a/toolkit/content/tests/chrome/bug263683_window.xhtml b/toolkit/content/tests/chrome/bug263683_window.xhtml new file mode 100644 index 0000000000..d2ce55a717 --- /dev/null +++ b/toolkit/content/tests/chrome/bug263683_window.xhtml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug304188_window.xhtml b/toolkit/content/tests/chrome/bug304188_window.xhtml new file mode 100644 index 0000000000..69e7ff6d10 --- /dev/null +++ b/toolkit/content/tests/chrome/bug304188_window.xhtml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug331215_window.xhtml b/toolkit/content/tests/chrome/bug331215_window.xhtml new file mode 100644 index 0000000000..fd0bef76e7 --- /dev/null +++ b/toolkit/content/tests/chrome/bug331215_window.xhtml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug360437_window.xhtml b/toolkit/content/tests/chrome/bug360437_window.xhtml new file mode 100644 index 0000000000..9b361cebce --- /dev/null +++ b/toolkit/content/tests/chrome/bug360437_window.xhtml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug366992_window.xhtml b/toolkit/content/tests/chrome/bug366992_window.xhtml new file mode 100644 index 0000000000..698d26b43a --- /dev/null +++ b/toolkit/content/tests/chrome/bug366992_window.xhtml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug409624_window.xhtml b/toolkit/content/tests/chrome/bug409624_window.xhtml new file mode 100644 index 0000000000..2efa55688b --- /dev/null +++ b/toolkit/content/tests/chrome/bug409624_window.xhtml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug429723_window.xhtml b/toolkit/content/tests/chrome/bug429723_window.xhtml new file mode 100644 index 0000000000..a3f20483f4 --- /dev/null +++ b/toolkit/content/tests/chrome/bug429723_window.xhtml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug451540_window.xhtml b/toolkit/content/tests/chrome/bug451540_window.xhtml new file mode 100644 index 0000000000..64bb3e033a --- /dev/null +++ b/toolkit/content/tests/chrome/bug451540_window.xhtml @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug624329_window.xhtml b/toolkit/content/tests/chrome/bug624329_window.xhtml new file mode 100644 index 0000000000..8cef32e4e5 --- /dev/null +++ b/toolkit/content/tests/chrome/bug624329_window.xhtml @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/chrome.ini b/toolkit/content/tests/chrome/chrome.ini new file mode 100644 index 0000000000..b9f4291505 --- /dev/null +++ b/toolkit/content/tests/chrome/chrome.ini @@ -0,0 +1,221 @@ +[DEFAULT] +skip-if = os == 'android' +support-files = + ../widgets/popup_shared.js + ../widgets/tree_shared.js + RegisterUnregisterChrome.js + bug263683_window.xhtml + bug304188_window.xhtml + bug331215_window.xhtml + bug360437_window.xhtml + bug366992_window.xhtml + bug409624_window.xhtml + bug429723_window.xhtml + bug624329_window.xhtml + dialog_button.xhtml + dialog_dialogfocus.xhtml + dialog_dialogfocus2.xhtml + file_empty.xhtml + file_edit_contextmenu.xhtml + file_about_networking_wsh.py + file_autocomplete_with_composition.js + file_editor_with_autocomplete.js + findbar_entireword_window.xhtml + findbar_events_window.xhtml + findbar_window.xhtml + frame_popup_anchor.xhtml + frame_popupremoving_frame.xhtml + frame_subframe_origin_subframe1.xhtml + frame_subframe_origin_subframe2.xhtml + popup_trigger.js + sample_entireword_latin1.html + window_browser_drop.xhtml + window_keys.xhtml + window_largemenu.xhtml + window_panel.xhtml + window_panel_anchoradjust.xhtml + window_popup_anchor.xhtml + window_popup_anchoratrect.xhtml + window_popup_attribute.xhtml + window_popup_button.xhtml + window_popup_preventdefault_chrome.xhtml + window_preferences.xhtml + window_preferences2.xhtml + window_preferences3.xhtml + window_preferences_commandretarget.xhtml + window_preferences_disabled.xhtml + window_screenPosSize.xhtml + window_showcaret.xhtml + window_subframe_origin.xhtml + window_tooltip.xhtml + xul_selectcontrol.js +prefs = + gfx.font_rendering.fallback.async=false + widget.non-native-theme.enabled=false + +[test_about_networking.html] +[test_arrowpanel.xhtml] +skip-if = + os == "win" && verify + debug && os == "win" && bits == 32 # Bug 1546256 + win10_2004 # Bug 1727507 + win10_2009 # Bug 1727507 + win11_2009 # Bug 1797751 +[test_autocomplete2.xhtml] +[test_autocomplete3.xhtml] +[test_autocomplete4.xhtml] +[test_autocomplete5.xhtml] +[test_autocomplete_emphasis.xhtml] +[test_autocomplete_with_composition_on_input.html] +[test_autocomplete_placehold_last_complete.xhtml] +[test_browser_drop.xhtml] +[test_bug263683.xhtml] +skip-if = debug && (os == 'win' || os == 'linux') +[test_bug304188.xhtml] +skip-if = true +[test_bug331215.xhtml] +skip-if = true # Bug 1339326 #Bug 1582327 +[test_bug360220.xhtml] +[test_bug360437.xhtml] +skip-if = true # Bug 1264604 # Bug 1784826 +[test_bug365773.xhtml] +[test_bug366992.xhtml] +[test_bug382990.xhtml] +[test_bug409624.xhtml] +[test_bug418874.xhtml] +[test_bug429723.xhtml] +[test_bug451540.xhtml] +support-files = bug451540_window.xhtml +[test_bug457632.xhtml] +[test_bug460942.xhtml] +[test_bug471776.xhtml] +[test_bug509732.xhtml] +[test_bug557987.xhtml] +[test_bug562554.xhtml] +[test_bug624329.xhtml] +fail-if = (os == 'linux' && os_version == '18.04') # Bug 1600194 +[test_bug792324.xhtml] +[test_bug1048178.xhtml] +skip-if = + toolkit == "cocoa" +[test_button.xhtml] +[test_closemenu_attribute.xhtml] +[test_contextmenu_list.xhtml] +[test_contextmenu_rtl.xhtml] +[test_custom_element_base.xhtml] +[test_custom_element_delay_connection.xhtml] +[test_custom_element_parts.html] +[test_deck.xhtml] +[test_dialog_button.xhtml] +[test_dialogfocus.xhtml] +[test_edit_contextmenu.html] +[test_editor_for_input_with_autocomplete.html] +[test_findbar.xhtml] +skip-if = os == 'mac' && os_version == '10.15' # macosx1014/15 due to 1550078 +[test_findbar_entireword.xhtml] +[test_findbar_events.xhtml] +[test_frames.xhtml] +[test_hiddenitems.xhtml] +[test_hiddenpaging.xhtml] +[test_keys.xhtml] +[test_labelcontrol.xhtml] +[test_largemenu.html] +skip-if = os == 'linux' && !debug # Bug 1207174 +[test_maximized_persist.xhtml] +support-files = + window_maximized_persist.xhtml + file_maximized_persist.js +[test_maximized_persist_with_no_titlebar.xhtml] +support-files = + window_maximized_persist_with_no_titlebar.xhtml + file_maximized_persist.js +[test_navigate_persist.html] +support-files = window_navigate_persist.html +[test_menu.xhtml] +[test_menu_activateitem.xhtml] +[test_menu_mouse_menuactive.xhtml] +[test_menu_withcapture.xhtml] +[test_menu_hide.xhtml] +[test_menuchecks.xhtml] +[test_menuitem_blink.xhtml] +[test_menuitem_commands.xhtml] +[test_menulist.xhtml] +[test_menulist_keynav.xhtml] +[test_menulist_null_value.xhtml] +[test_menulist_paging.xhtml] +[test_menulist_position.xhtml] +[test_menulist_in_popup.xhtml] +[test_mousescroll.xhtml] +[test_mozinputbox_dictionary.xhtml] +[test_named_deck.html] +[test_notificationbox.xhtml] +skip-if = (os == 'linux' && debug) || (os == 'win') # Bug 1429649 +[test_panel.xhtml] +skip-if = os == 'mac' && os_version == '10.15' # macosx1014 due to 1550078 +[test_panel_anchoradjust.xhtml] +[test_panel_open.xhtml] +[test_panelfrommenu.xhtml] +[test_popup_anchor.xhtml] +[test_popup_anchoratrect.xhtml] +skip-if = os == 'linux' # 1167694 +[test_popup_attribute.xhtml] +skip-if = (os == 'linux' && asan) || (os == 'mac' && debug) # Bug 1281360, 1582610 +[test_popup_button.xhtml] +skip-if = (os == 'linux' && asan) || (os == 'mac' && debug) # Bug 1281360, 1582610 +[test_popup_coords.xhtml] +[test_popup_keys.xhtml] +[test_popup_moveToAnchor.xhtml] +[test_popup_preventdefault.xhtml] +[test_popup_preventdefault_chrome.xhtml] +[test_popup_recreate.xhtml] +[test_popup_scaled.xhtml] +[test_popup_tree.xhtml] +[test_popuphidden.xhtml] +[test_popupincontent.xhtml] +skip-if = (verify && (os == 'win')) +[test_popupremoving.xhtml] +[test_popupremoving_frame.xhtml] +[test_position.xhtml] +[test_preferences.xhtml] +[test_preferences_beforeaccept.xhtml] +support-files = window_preferences_beforeaccept.xhtml +[test_preferences_onsyncfrompreference.xhtml] +support-files = window_preferences_onsyncfrompreference.xhtml +[test_props.xhtml] +[test_radio.xhtml] +[test_richlistbox.xhtml] +[test_screenPersistence.xhtml] +[test_scrollbar.xhtml] +[test_showcaret.xhtml] +[test_subframe_origin.xhtml] +[test_tabbox.xhtml] +[test_tabindex.xhtml] +[test_textbox_search.xhtml] +[test_tooltip.xhtml] +skip-if = (os == 'mac' || os == 'win') # Bug 1141245, frequent timeouts on OSX 10.14, Windows +[test_tooltip_noautohide.xhtml] +[test_tree.xhtml] +[test_tree_hier.xhtml] +[test_tree_scroll.xhtml] +support-files = + !/gfx/layers/apz/test/mochitest/apz_test_utils.js + !/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +[test_tree_single.xhtml] +[test_tree_view.xhtml] +[test_window_intrinsic_size.xhtml] +support-files = window_intrinsic_size.xhtml +# test_panel_focus.xhtml won't work if the Full Keyboard Access preference is set to +# textboxes and lists only, so skip this test on Mac +[test_panel_focus.xhtml] +support-files = window_panel_focus.xhtml +skip-if = toolkit == "cocoa" +[test_panel_hover_menu.xhtml] +[test_chromemargin.xhtml] +support-files = window_chromemargin.xhtml +skip-if = toolkit == "cocoa" +[test_autocomplete_mac_caret.xhtml] +skip-if = toolkit != "cocoa" +[test_cursorsnap.xhtml] +disabled = +#skip-if = os != "win" +support-files = window_cursorsnap_dialog.xhtml window_cursorsnap_wizard.xhtml diff --git a/toolkit/content/tests/chrome/dialog_button.xhtml b/toolkit/content/tests/chrome/dialog_button.xhtml new file mode 100644 index 0000000000..64bf916fff --- /dev/null +++ b/toolkit/content/tests/chrome/dialog_button.xhtml @@ -0,0 +1,9 @@ + + + + + + diff --git a/toolkit/content/tests/chrome/dialog_dialogfocus.xhtml b/toolkit/content/tests/chrome/dialog_dialogfocus.xhtml new file mode 100644 index 0000000000..bcd303b52f --- /dev/null +++ b/toolkit/content/tests/chrome/dialog_dialogfocus.xhtml @@ -0,0 +1,62 @@ + + + + + + + diff --git a/toolkit/content/tests/chrome/dialog_dialogfocus2.xhtml b/toolkit/content/tests/chrome/dialog_dialogfocus2.xhtml new file mode 100644 index 0000000000..da4b3dbdfa --- /dev/null +++ b/toolkit/content/tests/chrome/dialog_dialogfocus2.xhtml @@ -0,0 +1,8 @@ + + + + + + diff --git a/toolkit/content/tests/chrome/file_about_networking_wsh.py b/toolkit/content/tests/chrome/file_about_networking_wsh.py new file mode 100644 index 0000000000..57bd353c21 --- /dev/null +++ b/toolkit/content/tests/chrome/file_about_networking_wsh.py @@ -0,0 +1,10 @@ +from mod_pywebsocket import msgutil + + +def web_socket_do_extra_handshake(request): + pass + + +def web_socket_transfer_data(request): + while not request.client_terminated: + msgutil.receive_message(request) diff --git a/toolkit/content/tests/chrome/file_autocomplete_with_composition.js b/toolkit/content/tests/chrome/file_autocomplete_with_composition.js new file mode 100644 index 0000000000..86619a95d1 --- /dev/null +++ b/toolkit/content/tests/chrome/file_autocomplete_with_composition.js @@ -0,0 +1,714 @@ +// nsDoTestsForAutoCompleteWithComposition tests autocomplete with composition. +// Users must include SimpleTest.js and EventUtils.js. + +function waitForCondition(condition, nextTest) { + var tries = 0; + var interval = setInterval(function () { + if (condition() || tries >= 30) { + moveOn(); + } + tries++; + }, 100); + var moveOn = function () { + clearInterval(interval); + nextTest(); + }; +} + +function nsDoTestsForAutoCompleteWithComposition( + aDescription, + aWindow, + aTarget, + aAutoCompleteController, + aIsFunc, + aGetTargetValueFunc, + aOnFinishFunc +) { + this._description = aDescription; + this._window = aWindow; + this._target = aTarget; + this._controller = aAutoCompleteController; + + this._is = aIsFunc; + this._getTargetValue = aGetTargetValueFunc; + this._onFinish = aOnFinishFunc; + + this._target.focus(); + + this._DefaultCompleteDefaultIndex = + this._controller.input.completeDefaultIndex; + + this._doTests(); +} + +nsDoTestsForAutoCompleteWithComposition.prototype = { + _window: null, + _target: null, + _controller: null, + _DefaultCompleteDefaultIndex: false, + _description: "", + + _is: null, + _getTargetValue() { + return "not initialized"; + }, + _onFinish: null, + + _doTests() { + if (++this._testingIndex == this._tests.length) { + this._controller.input.completeDefaultIndex = + this._DefaultCompleteDefaultIndex; + this._onFinish(); + return; + } + + var test = this._tests[this._testingIndex]; + if ( + this._controller.input.completeDefaultIndex != test.completeDefaultIndex + ) { + this._controller.input.completeDefaultIndex = test.completeDefaultIndex; + } + test.execute(this._window); + + if (test.popup) { + waitForCondition( + () => this._controller.input.popupOpen, + this._checkResult.bind(this) + ); + } else { + waitForCondition(() => { + this._controller.searchStatus >= + Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH; + }, this._checkResult.bind(this)); + } + }, + + _checkResult() { + var test = this._tests[this._testingIndex]; + this._is( + this._getTargetValue(), + test.value, + this._description + ", " + test.description + ": value" + ); + this._is( + this._controller.searchString, + test.searchString, + this._description + ", " + test.description + ": searchString" + ); + this._is( + this._controller.input.popupOpen, + test.popup, + this._description + ", " + test.description + ": popupOpen" + ); + this._doTests(); + }, + + _testingIndex: -1, + _tests: [ + // Simple composition when popup hasn't been shown. + // The autocomplete popup should not be shown during composition, but + // after compositionend, the popup should be shown. + { + description: "compositionstart shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "M", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "M" }, + }, + aWindow + ); + }, + popup: false, + value: "M", + searchString: "", + }, + { + description: "modifying composition string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "Mo", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "o" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "", + }, + { + description: "compositionend should open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Enter" } }, + aWindow + ); + }, + popup: true, + value: "Mo", + searchString: "Mo", + }, + // If composition starts when popup is shown, the compositionstart event + // should cause closing the popup. + { + description: "compositionstart should close the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "z", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "z" }, + }, + aWindow + ); + }, + popup: false, + value: "Moz", + searchString: "Mo", + }, + { + description: "modifying composition string shouldn't reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "zi", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "i" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozi", + searchString: "Mo", + }, + { + description: + "compositionend should research the result and open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Enter" } }, + aWindow + ); + }, + popup: true, + value: "Mozi", + searchString: "Mozi", + }, + // If composition is cancelled, the value shouldn't be changed. + { + description: "compositionstart should reclose the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "l", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "l" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozil", + searchString: "Mozi", + }, + { + description: "modifying composition string shouldn't reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "ll", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "l" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozill", + searchString: "Mozi", + }, + { + description: + "modifying composition string to empty string shouldn't reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { string: "", clauses: [{ length: 0, attr: 0 }] }, + caret: { start: 0, length: 0 }, + key: { key: "KEY_Backspace" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozi", + searchString: "Mozi", + }, + { + description: "cancled compositionend should reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommit", data: "", key: { key: "KEY_Escape" } }, + aWindow + ); + }, + popup: true, + value: "Mozi", + searchString: "Mozi", + }, + // But if composition replaces some characters and canceled, the search + // string should be the latest value. + { + description: + "compositionstart with selected string should close the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow); + synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow); + synthesizeCompositionChange( + { + composition: { + string: "z", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "z" }, + }, + aWindow + ); + }, + popup: false, + value: "Moz", + searchString: "Mozi", + }, + { + description: "modifying composition string shouldn't reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "zi", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "i" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozi", + searchString: "Mozi", + }, + { + description: + "modifying composition string to empty string shouldn't reopen the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { string: "", clauses: [{ length: 0, attr: 0 }] }, + caret: { start: 0, length: 0 }, + key: { key: "KEY_Backspace" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "Mozi", + }, + { + description: + "canceled compositionend should search the result with the latest value", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Escape" } }, + aWindow + ); + }, + popup: true, + value: "Mo", + searchString: "Mo", + }, + // If all characters are removed, the popup should be closed. + { + description: + "the value becomes empty by backspace, the popup should be closed", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + }, + popup: false, + value: "", + searchString: "", + }, + // composition which is canceled shouldn't cause opening the popup. + { + description: "compositionstart shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "M", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "M" }, + }, + aWindow + ); + }, + popup: false, + value: "M", + searchString: "", + }, + { + description: "modifying composition string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "Mo", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "o" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "", + }, + { + description: + "modifying composition string to empty string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { string: "", clauses: [{ length: 0, attr: 0 }] }, + caret: { start: 0, length: 0 }, + key: { key: "KEY_Backspace" }, + }, + aWindow + ); + }, + popup: false, + value: "", + searchString: "", + }, + { + description: + "canceled compositionend shouldn't open the popup if it was closed", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Escape" } }, + aWindow + ); + }, + popup: false, + value: "", + searchString: "", + }, + // Down key should open the popup even if the editor is empty. + { + description: "DOWN key should open the popup even if the value is empty", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("KEY_ArrowDown", {}, aWindow); + }, + popup: true, + value: "", + searchString: "", + }, + // If popup is open at starting composition, the popup should be reopened + // after composition anyway. + { + description: "compositionstart shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "M", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "M" }, + }, + aWindow + ); + }, + popup: false, + value: "M", + searchString: "", + }, + { + description: "modifying composition string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "Mo", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "o" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "", + }, + { + description: + "modifying composition string to empty string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { string: "", clauses: [{ length: 0, attr: 0 }] }, + caret: { start: 0, length: 0 }, + key: { key: "KEY_Backspace" }, + }, + aWindow + ); + }, + popup: false, + value: "", + searchString: "", + }, + { + description: + "canceled compositionend should open the popup if it was opened", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Escape" } }, + aWindow + ); + }, + popup: true, + value: "", + searchString: "", + }, + // Type normally, and hit escape, the popup should be closed. + { + description: "ESCAPE should close the popup after typing something", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("M", {}, aWindow); + synthesizeKey("o", {}, aWindow); + synthesizeKey("KEY_Escape", {}, aWindow); + }, + popup: false, + value: "Mo", + searchString: "Mo", + }, + // Even if the popup is closed, composition which is canceled should open + // the popup if the value isn't empty. + // XXX This might not be good behavior, but anyway, this is minor issue... + { + description: "compositionstart shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "z", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "z" }, + }, + aWindow + ); + }, + popup: false, + value: "Moz", + searchString: "Mo", + }, + { + description: "modifying composition string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "zi", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "i" }, + }, + aWindow + ); + }, + popup: false, + value: "Mozi", + searchString: "Mo", + }, + { + description: + "modifying composition string to empty string shouldn't open the popup", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { string: "", clauses: [{ length: 0, attr: 0 }] }, + caret: { start: 0, length: 0 }, + key: { key: "KEY_Backspace" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "Mo", + }, + { + description: + "canceled compositionend shouldn't open the popup if the popup was closed", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Escape" } }, + aWindow + ); + }, + popup: true, + value: "Mo", + searchString: "Mo", + }, + // House keeping... + { + description: "house keeping for next tests", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + }, + popup: false, + value: "", + searchString: "", + }, + // Testing for nsIAutoCompleteInput.completeDefaultIndex being true. + { + description: + "compositionstart shouldn't open the popup (completeDefaultIndex is true)", + completeDefaultIndex: true, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "M", + clauses: [{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 1, length: 0 }, + key: { key: "M" }, + }, + aWindow + ); + }, + popup: false, + value: "M", + searchString: "", + }, + { + description: + "modifying composition string shouldn't open the popup (completeDefaultIndex is true)", + completeDefaultIndex: true, + execute(aWindow) { + synthesizeCompositionChange( + { + composition: { + string: "Mo", + clauses: [{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }], + }, + caret: { start: 2, length: 0 }, + key: { key: "o" }, + }, + aWindow + ); + }, + popup: false, + value: "Mo", + searchString: "", + }, + { + description: + "compositionend should open the popup (completeDefaultIndex is true)", + completeDefaultIndex: true, + execute(aWindow) { + synthesizeComposition( + { type: "compositioncommitasis", key: { key: "KEY_Enter" } }, + aWindow + ); + }, + popup: true, + value: "Mozilla", + searchString: "Mo", + }, + // House keeping... + { + description: "house keeping for next tests", + completeDefaultIndex: false, + execute(aWindow) { + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + synthesizeKey("KEY_Backspace", {}, aWindow); + }, + popup: false, + value: "", + searchString: "", + }, + ], +}; diff --git a/toolkit/content/tests/chrome/file_edit_contextmenu.xhtml b/toolkit/content/tests/chrome/file_edit_contextmenu.xhtml new file mode 100644 index 0000000000..e4d1a79040 --- /dev/null +++ b/toolkit/content/tests/chrome/file_edit_contextmenu.xhtml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/findbar_events_window.xhtml b/toolkit/content/tests/chrome/findbar_events_window.xhtml new file mode 100644 index 0000000000..424f7f762e --- /dev/null +++ b/toolkit/content/tests/chrome/findbar_events_window.xhtml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/findbar_window.xhtml b/toolkit/content/tests/chrome/findbar_window.xhtml new file mode 100644 index 0000000000..979f3eec1d --- /dev/null +++ b/toolkit/content/tests/chrome/findbar_window.xhtml @@ -0,0 +1,788 @@ + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/frame_popup_anchor.xhtml b/toolkit/content/tests/chrome/frame_popup_anchor.xhtml new file mode 100644 index 0000000000..934cea6faf --- /dev/null +++ b/toolkit/content/tests/chrome/frame_popup_anchor.xhtml @@ -0,0 +1,84 @@ + + + + + + + + diff --git a/toolkit/content/tests/chrome/frame_popupremoving_frame.xhtml b/toolkit/content/tests/chrome/frame_popupremoving_frame.xhtml new file mode 100644 index 0000000000..e8f00ce7a9 --- /dev/null +++ b/toolkit/content/tests/chrome/frame_popupremoving_frame.xhtml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xhtml b/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xhtml new file mode 100644 index 0000000000..f68a06d85d --- /dev/null +++ b/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xhtml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xhtml b/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xhtml new file mode 100644 index 0000000000..338877ff96 --- /dev/null +++ b/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xhtml @@ -0,0 +1,37 @@ + + + + + + + diff --git a/toolkit/content/tests/chrome/popup_trigger.js b/toolkit/content/tests/chrome/popup_trigger.js new file mode 100644 index 0000000000..357da29053 --- /dev/null +++ b/toolkit/content/tests/chrome/popup_trigger.js @@ -0,0 +1,1208 @@ +/* import-globals-from ../widgets/popup_shared.js */ + +var gMenuPopup = null; +var gTrigger = null; +var gIsMenu = false; +var gScreenX = -1, + gScreenY = -1; +var gCachedEvent = null; +var gCachedEvent2 = null; + +function cacheEvent(modifiers) { + var cachedEvent = null; + + var mouseFn = function (event) { + cachedEvent = event; + }; + + window.addEventListener("mousedown", mouseFn); + synthesizeMouse(document.documentElement, 0, 0, modifiers); + window.removeEventListener("mousedown", mouseFn); + + return cachedEvent; +} + +function runTests() { + if (screen.height < 768) { + ok( + false, + "popup tests are likely to fail for screen heights less than 768 pixels" + ); + } + + gMenuPopup = document.getElementById("thepopup"); + gTrigger = document.getElementById("trigger"); + + gIsMenu = gTrigger.hasMenu(); + + // a hacky way to get the screen position of the document. Cache the event + // so that we can use it in calls to openPopup. + gCachedEvent = cacheEvent({ shiftKey: true }); + gScreenX = gCachedEvent.screenX; + gScreenY = gCachedEvent.screenY; + gCachedEvent2 = cacheEvent({ + altKey: true, + ctrlKey: true, + shiftKey: true, + metaKey: true, + }); + + startPopupTests(popupTests); +} + +var popupTests = [ + { + testname: "mouse click on trigger", + events: ["popupshowing thepopup", "popupshown thepopup"], + test() { + // for menus, no trigger will be set. For non-menus using the popup + // attribute, the trigger will be set to the node with the popup attribute + gExpectedTriggerNode = gIsMenu ? "notset" : gTrigger; + synthesizeMouse(gTrigger, 4, 4, {}); + }, + async result(testname) { + gExpectedTriggerNode = null; + // menus are the anchor but non-menus are opened at screen coordinates + is( + gMenuPopup.anchorNode, + gIsMenu ? gTrigger : null, + testname + " anchorNode" + ); + // menus are opened internally, but non-menus have a mouse event which + // triggered them + is( + gMenuPopup.triggerNode, + gIsMenu ? null : gTrigger, + testname + " triggerNode" + ); + + // Popup may have wrong initial size in non e10s mode tests, because + // layout is not yet ready for popup content lazy population on + // popupshowing event. + await new Promise(r => + requestAnimationFrame(() => requestAnimationFrame(r)) + ); + + // this will be used in some tests to ensure the size doesn't change + var popuprect = gMenuPopup.getBoundingClientRect(); + gPopupWidth = Math.round(popuprect.width); + gPopupHeight = Math.round(popuprect.height); + + checkActive(gMenuPopup, "", testname); + checkOpen("trigger", testname); + // if a menu, the popup should be opened underneath the menu in the + // 'after_start' position, otherwise it is opened at the mouse position + if (gIsMenu) { + compareEdge(gTrigger, gMenuPopup, "after_start", 0, 0, testname); + } + }, + }, + { + // check that pressing cursor down while there is no selection + // highlights the first item + testname: "cursor down no selection", + events: ["DOMMenuItemActive item1"], + test() { + synthesizeKey("KEY_ArrowDown"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // check that pressing cursor up wraps and highlights the last item + testname: "cursor up wrap", + events() { + // No wrapping on menus on Mac + return platformIsMac() + ? [] + : ["DOMMenuItemInactive item1", "DOMMenuItemActive last"]; + }, + test() { + synthesizeKey("KEY_ArrowUp"); + }, + result(testname) { + checkActive(gMenuPopup, platformIsMac() ? "item1" : "last", testname); + }, + }, + { + // check that pressing cursor down wraps and highlights the first item + testname: "cursor down wrap", + condition() { + return !platformIsMac(); + }, + events: ["DOMMenuItemInactive last", "DOMMenuItemActive item1"], + test() { + synthesizeKey("KEY_ArrowDown"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // check that pressing cursor down highlights the second item + testname: "cursor down", + events: ["DOMMenuItemInactive item1", "DOMMenuItemActive item2"], + test() { + synthesizeKey("KEY_ArrowDown"); + }, + result(testname) { + checkActive(gMenuPopup, "item2", testname); + }, + }, + { + // check that pressing cursor up highlights the second item + testname: "cursor up", + events: ["DOMMenuItemInactive item2", "DOMMenuItemActive item1"], + test() { + synthesizeKey("KEY_ArrowUp"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // cursor left should not do anything + testname: "cursor left", + test() { + synthesizeKey("KEY_ArrowLeft"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // cursor right should not do anything + testname: "cursor right", + test() { + synthesizeKey("KEY_ArrowRight"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // check cursor down when a disabled item exists in the menu + testname: "cursor down disabled", + events() { + // On Windows, disabled items are included when navigating, but on + // other platforms, disabled items are skipped over + if (navigator.platform.indexOf("Win") == 0) { + return ["DOMMenuItemInactive item1", "DOMMenuItemActive item2"]; + } + return ["DOMMenuItemInactive item1", "DOMMenuItemActive amenu"]; + }, + test() { + document.getElementById("item2").disabled = true; + synthesizeKey("KEY_ArrowDown"); + }, + }, + { + // check cursor up when a disabled item exists in the menu + testname: "cursor up disabled", + events() { + if (navigator.platform.indexOf("Win") == 0) { + return [ + "DOMMenuItemInactive item2", + "DOMMenuItemActive amenu", + "DOMMenuItemInactive amenu", + "DOMMenuItemActive item2", + "DOMMenuItemInactive item2", + "DOMMenuItemActive item1", + ]; + } + return ["DOMMenuItemInactive amenu", "DOMMenuItemActive item1"]; + }, + test() { + if (navigator.platform.indexOf("Win") == 0) { + synthesizeKey("KEY_ArrowDown"); + } + synthesizeKey("KEY_ArrowUp"); + if (navigator.platform.indexOf("Win") == 0) { + synthesizeKey("KEY_ArrowUp"); + } + }, + }, + { + testname: "mouse click outside", + events: [ + "popuphiding thepopup", + "popuphidden thepopup", + "DOMMenuItemInactive item1", + "DOMMenuInactive thepopup", + ], + test() { + gMenuPopup.hidePopup(); + // XXXndeakin event simulation fires events outside of the platform specific + // widget code so the popup capturing isn't handled. Thus, the menu won't + // rollup this way. + // synthesizeMouse(gTrigger, 0, -12, { }); + }, + result(testname, step) { + is(gMenuPopup.anchorNode, null, testname + " anchorNode"); + is(gMenuPopup.triggerNode, null, testname + " triggerNode"); + checkClosed("trigger", testname); + }, + }, + { + // these tests check to ensure that passing an anchor and position + // puts the popup in the right place + testname: "open popup anchored", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + "topleft topleft", + "topcenter topleft", + "topright topleft", + "leftcenter topright", + "rightcenter topright", + "bottomleft bottomleft", + "bottomcenter bottomleft", + "bottomright bottomleft", + "topleft bottomright", + "bottomcenter bottomright", + "rightcenter topright", + ], + test(testname, step) { + gExpectedTriggerNode = "notset"; + gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false); + }, + result(testname, step) { + // no triggerNode because it was opened without passing an event + gExpectedTriggerNode = null; + is(gMenuPopup.anchorNode, gTrigger, testname + " anchorNode"); + is(gMenuPopup.triggerNode, null, testname + " triggerNode"); + compareEdge(gTrigger, gMenuPopup, step, 0, 0, testname); + }, + }, + { + // these tests check the same but with a 10 pixel margin on the popup + testname: "open popup anchored with margin", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + "topleft topleft", + "topcenter topleft", + "topright topleft", + "leftcenter topright", + "rightcenter topright", + "bottomleft bottomleft", + "bottomcenter bottomleft", + "bottomright bottomleft", + "topleft bottomright", + "bottomcenter bottomright", + "rightcenter topright", + ], + test(testname, step) { + gMenuPopup.setAttribute("style", "margin: 10px;"); + gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false); + }, + result(testname, step) { + var rightmod = + step == "before_end" || + step == "after_end" || + step == "start_before" || + step == "start_after" || + step.match(/topright$/) || + step.match(/bottomright$/); + var bottommod = + step == "before_start" || + step == "before_end" || + step == "start_after" || + step == "end_after" || + step.match(/bottomleft$/) || + step.match(/bottomright$/); + compareEdge( + gTrigger, + gMenuPopup, + step, + rightmod ? -10 : 10, + bottommod ? -10 : 10, + testname + ); + gMenuPopup.removeAttribute("style"); + }, + }, + { + // these tests check the same but with a -8 pixel margin on the popup + testname: "open popup anchored with negative margin", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + ], + test(testname, step) { + gMenuPopup.setAttribute("style", "margin: -8px;"); + gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false); + }, + result(testname, step) { + var rightmod = + step == "before_end" || + step == "after_end" || + step == "start_before" || + step == "start_after"; + var bottommod = + step == "before_start" || + step == "before_end" || + step == "start_after" || + step == "end_after"; + compareEdge( + gTrigger, + gMenuPopup, + step, + rightmod ? 8 : -8, + bottommod ? 8 : -8, + testname + ); + gMenuPopup.removeAttribute("style"); + }, + }, + { + testname: "open popup with large positive margin", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + ], + test(testname, step) { + gMenuPopup.setAttribute("style", "margin: 1000px;"); + gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false); + }, + result(testname, step) { + var popuprect = gMenuPopup.getBoundingClientRect(); + // as there is more room on the 'end' or 'after' side, popups will always + // appear on the right or bottom corners, depending on which side they are + // allowed to be flipped by. + var expectedleft = + step == "before_end" || step == "after_end" + ? 0 + : Math.round(window.innerWidth - gPopupWidth); + var expectedtop = + step == "start_after" || step == "end_after" + ? 0 + : Math.round(window.innerHeight - gPopupHeight); + is( + Math.round(popuprect.left), + expectedleft, + testname + " x position " + step + ); + is( + Math.round(popuprect.top), + expectedtop, + testname + " y position " + step + ); + gMenuPopup.removeAttribute("style"); + }, + }, + { + testname: "open popup with large negative margin", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + ], + test(testname, step) { + gMenuPopup.setAttribute("style", "margin: -1000px;"); + gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false); + }, + result(testname, step) { + var popuprect = gMenuPopup.getBoundingClientRect(); + // using negative margins causes the reverse of positive margins, and + // popups will appear on the left or top corners. + var expectedleft = + step == "before_end" || step == "after_end" + ? Math.round(window.innerWidth - gPopupWidth) + : 0; + var expectedtop = + step == "start_after" || step == "end_after" + ? Math.round(window.innerHeight - gPopupHeight) + : 0; + is( + Math.round(popuprect.left), + expectedleft, + testname + " x position " + step + ); + is( + Math.round(popuprect.top), + expectedtop, + testname + " y position " + step + ); + gMenuPopup.removeAttribute("style"); + }, + }, + { + testname: "popup with unknown step", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test() { + gMenuPopup.openPopup(gTrigger, "other", 0, 0, false, false); + }, + result(testname) { + var triggerrect = gMenuPopup.getBoundingClientRect(); + var popuprect = gMenuPopup.getBoundingClientRect(); + is( + Math.round(popuprect.left), + triggerrect.left, + testname + " x position " + ); + is(Math.round(popuprect.top), triggerrect.top, testname + " y position "); + }, + }, + { + // these tests check to ensure that the position attribute can be used + // to set the position of a popup instead of passing it as an argument + testname: "open popup anchored with attribute", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + steps: [ + "before_start", + "before_end", + "after_start", + "after_end", + "start_before", + "start_after", + "end_before", + "end_after", + "after_pointer", + "overlap", + "topcenter topleft", + "topright bottomright", + "leftcenter topright", + ], + test(testname, step) { + gMenuPopup.setAttribute("position", step); + gMenuPopup.openPopup(gTrigger, "", 0, 0, false, false); + }, + result(testname, step) { + compareEdge(gTrigger, gMenuPopup, step, 0, 0, testname); + }, + }, + { + // this test checks to ensure that the attributes override flag to openPopup + // can be used to override the popup's position. This test also passes an + // event to openPopup to check the trigger node. + testname: "open popup anchored with override", + events: ["popupshowing thepopup 0010", "popupshown thepopup"], + test(testname, step) { + // attribute overrides the position passed in + gMenuPopup.setAttribute("position", "end_after"); + gExpectedTriggerNode = gCachedEvent.target; + gMenuPopup.openPopup( + gTrigger, + "before_start", + 0, + 0, + false, + true, + gCachedEvent + ); + }, + result(testname, step) { + gExpectedTriggerNode = null; + is(gMenuPopup.anchorNode, gTrigger, testname + " anchorNode"); + is( + gMenuPopup.triggerNode, + gCachedEvent.target, + testname + " triggerNode" + ); + compareEdge(gTrigger, gMenuPopup, "end_after", 0, 0, testname); + }, + }, + { + testname: "close popup with escape", + events: [ + "popuphiding thepopup", + "popuphidden thepopup", + "DOMMenuInactive thepopup", + ], + test(testname, step) { + synthesizeKey("KEY_Escape"); + checkClosed("trigger", testname); + }, + }, + { + // check that offsets may be supplied to the openPopup method + testname: "open popup anchored with offsets", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + // attribute is empty so does not override + gMenuPopup.setAttribute("position", ""); + gMenuPopup.openPopup(gTrigger, "before_start", 5, 10, true, true); + }, + result(testname, step) { + compareEdge(gTrigger, gMenuPopup, "before_start", 5, 10, testname); + }, + }, + { + // if no anchor is supplied to openPopup, it should be opened relative + // to the viewport. + testname: "open popup unanchored", + events: ["popupshowing thepopup", "popupshown thepopup"], + test(testname, step) { + gMenuPopup.openPopup(null, "after_start", 6, 8, false); + }, + result(testname, step) { + var rect = gMenuPopup.getBoundingClientRect(); + ok( + rect.left == 6 && rect.top == 8 && rect.right && rect.bottom, + testname + ); + }, + }, + { + testname: "activate menuitem with mouse", + events: [ + "DOMMenuInactive thepopup", + "command item3", + "popuphiding thepopup", + "popuphidden thepopup", + ], + test(testname, step) { + var item3 = document.getElementById("item3"); + synthesizeMouse(item3, 4, 4, {}); + }, + result(testname, step) { + checkClosed("trigger", testname); + }, + }, + { + testname: "close popup", + condition() { + return false; + }, + events: [ + "popuphiding thepopup", + "popuphidden thepopup", + "DOMMenuInactive thepopup", + ], + test(testname, step) { + gMenuPopup.hidePopup(); + }, + }, + { + testname: "open popup at screen", + events: ["popupshowing thepopup", "popupshown thepopup"], + test(testname, step) { + gExpectedTriggerNode = "notset"; + gMenuPopup.openPopupAtScreen(gScreenX + 24, gScreenY + 20, false); + }, + result(testname, step) { + gExpectedTriggerNode = null; + is(gMenuPopup.anchorNode, null, testname + " anchorNode"); + is(gMenuPopup.triggerNode, null, testname + " triggerNode"); + var rect = gMenuPopup.getBoundingClientRect(); + is(rect.left, 24, testname + " left"); + is(rect.top, 20, testname + " top"); + ok(rect.right, testname + " right is " + rect.right); + ok(rect.bottom, testname + " bottom is " + rect.bottom); + }, + }, + { + // check that pressing a menuitem's accelerator selects it. Note that + // the menuitem with the M accesskey overrides the earlier menuitem that + // begins with M. + testname: "menuitem accelerator", + events: [ + "DOMMenuItemActive amenu", + "DOMMenuItemInactive amenu", + "DOMMenuInactive thepopup", + "command amenu", + "popuphiding thepopup", + "popuphidden thepopup", + ], + test() { + sendString("M"); + }, + result(testname) { + checkClosed("trigger", testname); + }, + }, + { + testname: "open context popup at screen", + events: ["popupshowing thepopup 0010", "popupshown thepopup"], + test(testname, step) { + gExpectedTriggerNode = gCachedEvent.target; + gMenuPopup.openPopupAtScreen( + gScreenX + 8, + gScreenY + 16, + true, + gCachedEvent + ); + }, + result(testname, step) { + gExpectedTriggerNode = null; + is(gMenuPopup.anchorNode, null, testname + " anchorNode"); + is( + gMenuPopup.triggerNode, + gCachedEvent.target, + testname + " triggerNode" + ); + + var openX = 8; + var openY = 16; + var rect = gMenuPopup.getBoundingClientRect(); + is(rect.left, openX + (platformIsMac() ? 1 : 2), testname + " left"); + is(rect.top, openY + (platformIsMac() ? -6 : 2), testname + " top"); + ok(rect.right, testname + " right is " + rect.right); + ok(rect.bottom, testname + " bottom is " + rect.bottom); + }, + }, + { + // pressing a letter that doesn't correspond to an accelerator, but does + // correspond to the first letter in a menu's label. The menu should not + // close because there is more than one item corresponding to that letter + testname: "menuitem with non accelerator", + events: ["DOMMenuItemActive one"], + test() { + sendString("O"); + }, + result(testname) { + checkOpen("trigger", testname); + checkActive(gMenuPopup, "one", testname); + }, + }, + { + // pressing the letter again should select the next one that starts with + // that letter + testname: "menuitem with non accelerator again", + events: ["DOMMenuItemInactive one", "DOMMenuItemActive submenu"], + test() { + sendString("O"); + }, + result(testname) { + // 'submenu' is a menu but it should not be open + checkOpen("trigger", testname); + checkClosed("submenu", testname); + checkActive(gMenuPopup, "submenu", testname); + }, + }, + { + // open the submenu with the cursor right key + testname: "open submenu with cursor right", + events: [ + "popupshowing submenupopup", + "DOMMenuItemActive submenuitem", + "popupshown submenupopup", + ], + test() { + synthesizeKey("KEY_ArrowRight"); + }, + result(testname) { + checkOpen("trigger", testname); + checkOpen("submenu", testname); + checkActive(gMenuPopup, "submenu", testname); + checkActive( + document.getElementById("submenupopup"), + "submenuitem", + testname + ); + }, + }, + { + // close the submenu with the cursor left key + testname: "close submenu with cursor left", + events: [ + "popuphiding submenupopup", + "popuphidden submenupopup", + "DOMMenuItemInactive submenuitem", + "DOMMenuInactive submenupopup", + ], + test() { + synthesizeKey("KEY_ArrowLeft"); + }, + result(testname) { + checkOpen("trigger", testname); + checkClosed("submenu", testname); + checkActive(gMenuPopup, "submenu", testname); + checkActive(document.getElementById("submenupopup"), "", testname); + }, + }, + { + // open the submenu with the enter key + testname: "open submenu with enter", + events: [ + "popupshowing submenupopup", + "DOMMenuItemActive submenuitem", + "popupshown submenupopup", + ], + test() { + synthesizeKey("KEY_Enter"); + }, + result(testname) { + checkOpen("trigger", testname); + checkOpen("submenu", testname); + checkActive(gMenuPopup, "submenu", testname); + checkActive( + document.getElementById("submenupopup"), + "submenuitem", + testname + ); + }, + }, + { + // close the submenu with the escape key + testname: "close submenu with escape", + events: [ + "popuphiding submenupopup", + "popuphidden submenupopup", + "DOMMenuItemInactive submenuitem", + "DOMMenuInactive submenupopup", + ], + test() { + synthesizeKey("KEY_Escape"); + }, + result(testname) { + checkOpen("trigger", testname); + checkClosed("submenu", testname); + checkActive(gMenuPopup, "submenu", testname); + checkActive(document.getElementById("submenupopup"), "", testname); + }, + }, + { + // pressing the letter again when the next item is disabled should still + // select the disabled item on Windows, but select the next item on other + // platforms + testname: "menuitem with non accelerator disabled", + events() { + if (navigator.platform.indexOf("Win") == 0) { + return [ + "DOMMenuItemInactive submenu", + "DOMMenuItemActive other", + "DOMMenuItemInactive other", + "DOMMenuItemActive item1", + ]; + } + return [ + "DOMMenuItemInactive submenu", + "DOMMenuItemActive last", + "DOMMenuItemInactive last", + "DOMMenuItemActive item1", + ]; + }, + test() { + sendString("OF"); + }, + result(testname) { + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // pressing a letter that doesn't correspond to an accelerator nor the + // first letter of a menu. This should have no effect. + testname: "menuitem with keypress no accelerator found", + test() { + sendString("G"); + }, + result(testname) { + checkOpen("trigger", testname); + checkActive(gMenuPopup, "item1", testname); + }, + }, + { + // when only one menuitem starting with that letter exists, it should be + // selected and the menu closed + testname: "menuitem with non accelerator single", + events: [ + "DOMMenuItemInactive item1", + "DOMMenuItemActive amenu", + "DOMMenuItemInactive amenu", + "DOMMenuInactive thepopup", + "command amenu", + "popuphiding thepopup", + "popuphidden thepopup", + ], + test() { + sendString("M"); + }, + result(testname) { + checkClosed("trigger", testname); + checkActive(gMenuPopup, "", testname); + }, + }, + { + testname: "open context popup at screen with all modifiers set", + events: ["popupshowing thepopup 1111", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.openPopupAtScreen( + gScreenX + 8, + gScreenY + 16, + true, + gCachedEvent2 + ); + }, + }, + { + testname: "open popup with open property", + events: ["popupshowing thepopup", "popupshown thepopup"], + test(testname, step) { + openMenu(gTrigger); + }, + result(testname, step) { + checkOpen("trigger", testname); + if (gIsMenu) { + compareEdge(gTrigger, gMenuPopup, "after_start", 0, 0, testname); + } + }, + }, + { + testname: "open submenu with open property", + events: [ + "popupshowing submenupopup", + "DOMMenuItemActive submenu", + "popupshown submenupopup", + ], + test(testname, step) { + openMenu(document.getElementById("submenu")); + }, + result(testname, step) { + checkOpen("trigger", testname); + checkOpen("submenu", testname); + // XXXndeakin + // getBoundingClientRect doesn't seem to working right for submenus + // so disable this test for now + // compareEdge(document.getElementById("submenu"), + // document.getElementById("submenupopup"), "end_before", 0, 0, testname); + }, + }, + { + testname: "hidePopup hides entire chain", + events: [ + "popuphiding submenupopup", + "popuphidden submenupopup", + "popuphiding thepopup", + "popuphidden thepopup", + "DOMMenuInactive submenupopup", + "DOMMenuItemInactive submenu", + "DOMMenuInactive thepopup", + ], + test() { + gMenuPopup.hidePopup(); + }, + result(testname, step) { + checkClosed("trigger", testname); + checkClosed("submenu", testname); + }, + }, + { + testname: "open submenu with open property without parent open", + test(testname, step) { + openMenu(document.getElementById("submenu")); + }, + result(testname, step) { + checkClosed("trigger", testname); + checkClosed("submenu", testname); + }, + }, + { + testname: "open popup with open property and position", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + test(testname, step) { + gMenuPopup.setAttribute("position", "before_start"); + openMenu(gTrigger); + }, + result(testname, step) { + compareEdge(gTrigger, gMenuPopup, "before_start", 0, 0, testname); + }, + }, + { + testname: "close popup with open property", + condition() { + return gIsMenu; + }, + events: [ + "popuphiding thepopup", + "popuphidden thepopup", + "DOMMenuInactive thepopup", + ], + test(testname, step) { + closeMenu(gTrigger, gMenuPopup); + }, + result(testname, step) { + checkClosed("trigger", testname); + }, + }, + { + testname: "open popup with open property, position, anchor and alignment", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.setAttribute("position", "start_after"); + gMenuPopup.setAttribute("popupanchor", "topright"); + gMenuPopup.setAttribute("popupalign", "bottomright"); + openMenu(gTrigger); + }, + result(testname, step) { + compareEdge(gTrigger, gMenuPopup, "start_after", 0, 0, testname); + }, + }, + { + testname: "open popup with open property, anchor and alignment", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.removeAttribute("position"); + gMenuPopup.setAttribute("popupanchor", "bottomright"); + gMenuPopup.setAttribute("popupalign", "topright"); + openMenu(gTrigger); + }, + result(testname, step) { + compareEdge(gTrigger, gMenuPopup, "after_end", 0, 0, testname); + gMenuPopup.removeAttribute("popupanchor"); + gMenuPopup.removeAttribute("popupalign"); + }, + }, + { + testname: "focus and cursor down on trigger", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gTrigger.focus(); + synthesizeKey("KEY_ArrowDown", { altKey: !platformIsMac() }); + }, + result(testname, step) { + checkOpen("trigger", testname); + checkActive(gMenuPopup, "", testname); + }, + }, + { + testname: "focus and cursor up on trigger", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + test(testname, step) { + gTrigger.focus(); + synthesizeKey("KEY_ArrowUp", { altKey: !platformIsMac() }); + }, + result(testname, step) { + checkOpen("trigger", testname); + checkActive(gMenuPopup, "", testname); + }, + }, + { + testname: "select and enter on menuitem", + condition() { + return gIsMenu; + }, + events: [ + "DOMMenuItemActive item1", + "DOMMenuItemInactive item1", + "DOMMenuInactive thepopup", + "command item1", + "popuphiding thepopup", + "popuphidden thepopup", + ], + test(testname, step) { + synthesizeKey("KEY_ArrowDown"); + synthesizeKey("KEY_Enter"); + }, + result(testname, step) { + checkClosed("trigger", testname); + }, + }, + { + testname: "focus trigger and key to open", + condition() { + return gIsMenu; + }, + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gTrigger.focus(); + synthesizeKey(platformIsMac() ? " " : "KEY_F4"); + }, + result(testname, step) { + checkOpen("trigger", testname); + checkActive(gMenuPopup, "", testname); + }, + }, + { + // the menu should only open when the meta or alt key is not pressed + testname: "focus trigger and key wrong modifier", + condition() { + return gIsMenu; + }, + test(testname, step) { + gTrigger.focus(); + if (platformIsMac()) { + synthesizeKey("KEY_F4", { altKey: true }); + } else { + synthesizeKey("", { metaKey: true }); + } + }, + result(testname, step) { + checkClosed("trigger", testname); + }, + }, + { + testname: "mouse click on disabled menu", + condition() { + return gIsMenu; + }, + test(testname, step) { + gTrigger.setAttribute("disabled", "true"); + synthesizeMouse(gTrigger, 4, 4, {}); + }, + result(testname, step) { + checkClosed("trigger", testname); + gTrigger.removeAttribute("disabled"); + }, + }, + { + // openPopup using object as position argument + testname: "openPopup with object argument", + events: ["popupshowing thepopup 0000", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.openPopup(gTrigger, { position: "before_start", x: 5, y: 7 }); + checkOpen("trigger", testname); + }, + result(testname, step) { + var triggerrect = gTrigger.getBoundingClientRect(); + var popuprect = gMenuPopup.getBoundingClientRect(); + is( + Math.round(popuprect.left), + Math.round(triggerrect.left + 5), + testname + " x position " + ); + is( + Math.round(popuprect.bottom), + Math.round(triggerrect.top + 7), + testname + " y position " + ); + }, + }, + { + testname: "openPopup with object argument with event", + events: ["popupshowing thepopup 1000", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.openPopup(gTrigger, { + position: "after_start", + x: 0, + y: 0, + triggerEvent: new MouseEvent("mousedown", { altKey: true }), + }); + checkOpen("trigger", testname); + }, + }, + { + testname: "openPopup with no arguments", + events: ["popupshowing thepopup", "popupshown thepopup"], + autohide: "thepopup", + test(testname, step) { + gMenuPopup.openPopup(); + }, + result(testname, step) { + let isMenu = gTrigger.type == "menu"; + // With no arguments, open in default menu position + var triggerrect = gTrigger.getBoundingClientRect(); + var popuprect = gMenuPopup.getBoundingClientRect(); + is( + Math.round(popuprect.left), + isMenu ? Math.round(triggerrect.left) : 0, + testname + " x position " + ); + is( + Math.round(popuprect.top), + isMenu ? Math.round(triggerrect.bottom) : 0, + testname + " y position " + ); + }, + }, + { + // openPopup should open the menu synchronously, however popupshown + // is fired asynchronously + testname: "openPopup synchronous", + events: [ + "popupshowing thepopup", + "popupshowing submenupopup", + "popupshown thepopup", + "DOMMenuItemActive submenu", + "popupshown submenupopup", + ], + test(testname, step) { + gMenuPopup.openPopup(gTrigger, "after_start", 0, 0, false, true); + document + .getElementById("submenupopup") + .openPopup(gTrigger, "end_before", 0, 0, false, true); + checkOpen("trigger", testname); + checkOpen("submenu", testname); + }, + }, + { + // remove the content nodes for the popup + testname: "remove content", + test(testname, step) { + var submenupopup = document.getElementById("submenupopup"); + submenupopup.remove(); + var popup = document.getElementById("thepopup"); + popup.remove(); + }, + }, +]; + +function platformIsMac() { + return navigator.platform.indexOf("Mac") > -1; +} diff --git a/toolkit/content/tests/chrome/sample_entireword_latin1.html b/toolkit/content/tests/chrome/sample_entireword_latin1.html new file mode 100644 index 0000000000..b2d66fa3c4 --- /dev/null +++ b/toolkit/content/tests/chrome/sample_entireword_latin1.html @@ -0,0 +1,11 @@ + + + Latin entire-word find test page + + +

The twins of Mammon quarrelled. Their warring plunged the world into a new darkness, and the beast abhorred the darkness. So it began to move swiftly, and grew more powerful, and went forth and multiplied. And the beasts brought fire and light to the darkness.

+

from The Book of Mozilla, 15:1

+ + diff --git a/toolkit/content/tests/chrome/test_about_networking.html b/toolkit/content/tests/chrome/test_about_networking.html new file mode 100644 index 0000000000..5465c07751 --- /dev/null +++ b/toolkit/content/tests/chrome/test_about_networking.html @@ -0,0 +1,54 @@ + + + + + + Test for Bug + + + + + +Mozilla Bug +

+ +
+
+ + diff --git a/toolkit/content/tests/chrome/test_arrowpanel.xhtml b/toolkit/content/tests/chrome/test_arrowpanel.xhtml new file mode 100644 index 0000000000..cd8d312e1d --- /dev/null +++ b/toolkit/content/tests/chrome/test_arrowpanel.xhtml @@ -0,0 +1,332 @@ + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/test_autocomplete2.xhtml b/toolkit/content/tests/chrome/test_autocomplete2.xhtml new file mode 100644 index 0000000000..844305c321 --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete2.xhtml @@ -0,0 +1,189 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete3.xhtml b/toolkit/content/tests/chrome/test_autocomplete3.xhtml new file mode 100644 index 0000000000..a1b9ef84ea --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete3.xhtml @@ -0,0 +1,200 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete4.xhtml b/toolkit/content/tests/chrome/test_autocomplete4.xhtml new file mode 100644 index 0000000000..bb16194e55 --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete4.xhtml @@ -0,0 +1,280 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete5.xhtml b/toolkit/content/tests/chrome/test_autocomplete5.xhtml new file mode 100644 index 0000000000..7c252f355e --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete5.xhtml @@ -0,0 +1,164 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete_emphasis.xhtml b/toolkit/content/tests/chrome/test_autocomplete_emphasis.xhtml new file mode 100644 index 0000000000..20eb96323f --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete_emphasis.xhtml @@ -0,0 +1,180 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml new file mode 100644 index 0000000000..b49f8a1d5e --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml @@ -0,0 +1,80 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xhtml b/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xhtml new file mode 100644 index 0000000000..33fca83c32 --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xhtml @@ -0,0 +1,303 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html new file mode 100644 index 0000000000..d906a96b49 --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html @@ -0,0 +1,65 @@ + + + + autocomplete with composition tests on HTML input element + + + + + + +

+ +
+ +
+ +
+
+ +
+
+
+ + diff --git a/toolkit/content/tests/chrome/test_browser_drop.xhtml b/toolkit/content/tests/chrome/test_browser_drop.xhtml new file mode 100644 index 0000000000..3b0f0fdb2b --- /dev/null +++ b/toolkit/content/tests/chrome/test_browser_drop.xhtml @@ -0,0 +1,35 @@ + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_bug1048178.xhtml b/toolkit/content/tests/chrome/test_bug1048178.xhtml new file mode 100644 index 0000000000..d9a34c1da3 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug1048178.xhtml @@ -0,0 +1,83 @@ + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug263683.xhtml b/toolkit/content/tests/chrome/test_bug263683.xhtml new file mode 100644 index 0000000000..64c7df08ac --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug263683.xhtml @@ -0,0 +1,39 @@ + + + + + + + + + + + Mozilla Bug 263683 + + +

+ +
+    
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug304188.xhtml b/toolkit/content/tests/chrome/test_bug304188.xhtml new file mode 100644 index 0000000000..1047528d20 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug304188.xhtml @@ -0,0 +1,37 @@ + + + + + + + + + +Mozilla Bug 304188 +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug331215.xhtml b/toolkit/content/tests/chrome/test_bug331215.xhtml new file mode 100644 index 0000000000..22560089c1 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug331215.xhtml @@ -0,0 +1,38 @@ + + + + + + + + + +Mozilla Bug 331215 +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug360220.xhtml b/toolkit/content/tests/chrome/test_bug360220.xhtml new file mode 100644 index 0000000000..a942e0acd6 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug360220.xhtml @@ -0,0 +1,61 @@ + + + + + + + + + +Mozilla Bug 360220 +

+ +
+
+ + + + + + + + + + +
diff --git a/toolkit/content/tests/chrome/test_bug360437.xhtml b/toolkit/content/tests/chrome/test_bug360437.xhtml new file mode 100644 index 0000000000..dc592e4141 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug360437.xhtml @@ -0,0 +1,40 @@ + + + + + + + + + +Mozilla Bug 360437 +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug365773.xhtml b/toolkit/content/tests/chrome/test_bug365773.xhtml new file mode 100644 index 0000000000..e85a590608 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug365773.xhtml @@ -0,0 +1,67 @@ + + + + + + + + + +Mozilla Bug 365773 +

+ + + +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug366992.xhtml b/toolkit/content/tests/chrome/test_bug366992.xhtml new file mode 100644 index 0000000000..9b178f1abe --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug366992.xhtml @@ -0,0 +1,40 @@ + + + + + + + + + +Mozilla Bug 366992 +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug382990.xhtml b/toolkit/content/tests/chrome/test_bug382990.xhtml new file mode 100644 index 0000000000..1f937ac1b6 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug382990.xhtml @@ -0,0 +1,44 @@ + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug409624.xhtml b/toolkit/content/tests/chrome/test_bug409624.xhtml new file mode 100644 index 0000000000..6aa5f2ded9 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug409624.xhtml @@ -0,0 +1,38 @@ + + + + + + + + + + + Mozilla Bug 409624 + + +

+ +
+    
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug418874.xhtml b/toolkit/content/tests/chrome/test_bug418874.xhtml new file mode 100644 index 0000000000..d91289f11b --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug418874.xhtml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + +

+

+ +
+    
+ + + + + +
diff --git a/toolkit/content/tests/chrome/test_bug429723.xhtml b/toolkit/content/tests/chrome/test_bug429723.xhtml new file mode 100644 index 0000000000..865f0d66f8 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug429723.xhtml @@ -0,0 +1,38 @@ + + + + + + + + + + +Mozilla Bug 429723 +

+ +
+
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug451540.xhtml b/toolkit/content/tests/chrome/test_bug451540.xhtml new file mode 100644 index 0000000000..debcadfe05 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug451540.xhtml @@ -0,0 +1,39 @@ + + + + + + + + + + + Mozilla Bug 451540 + + +

+ +
+    
+ + + + +
diff --git a/toolkit/content/tests/chrome/test_bug457632.xhtml b/toolkit/content/tests/chrome/test_bug457632.xhtml new file mode 100644 index 0000000000..7f94eaef09 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug457632.xhtml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug460942.xhtml b/toolkit/content/tests/chrome/test_bug460942.xhtml new file mode 100644 index 0000000000..53f33302be --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug460942.xhtml @@ -0,0 +1,42 @@ + + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug471776.xhtml b/toolkit/content/tests/chrome/test_bug471776.xhtml new file mode 100644 index 0000000000..dcd45bfd77 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug471776.xhtml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + +

+

+ +
+    
+ + + + + +
diff --git a/toolkit/content/tests/chrome/test_bug509732.xhtml b/toolkit/content/tests/chrome/test_bug509732.xhtml new file mode 100644 index 0000000000..c886a05fd1 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug509732.xhtml @@ -0,0 +1,53 @@ + + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug557987.xhtml b/toolkit/content/tests/chrome/test_bug557987.xhtml new file mode 100644 index 0000000000..6af1b13700 --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug557987.xhtml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/test_bug562554.xhtml b/toolkit/content/tests/chrome/test_bug562554.xhtml new file mode 100644 index 0000000000..a822bf59dd --- /dev/null +++ b/toolkit/content/tests/chrome/test_bug562554.xhtml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + +

+

+ +
+
+ + +
diff --git a/toolkit/content/tests/chrome/test_contextmenu_list.xhtml b/toolkit/content/tests/chrome/test_contextmenu_list.xhtml new file mode 100644 index 0000000000..d5d2b1a10b --- /dev/null +++ b/toolkit/content/tests/chrome/test_contextmenu_list.xhtml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + +