From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/chrome/RegisterUnregisterChrome.js | 141 +++ .../content/tests/chrome/bug263683_window.xhtml | 206 ++++ .../content/tests/chrome/bug304188_window.xhtml | 94 ++ .../content/tests/chrome/bug331215_window.xhtml | 99 ++ .../content/tests/chrome/bug360437_window.xhtml | 129 +++ .../content/tests/chrome/bug366992_window.xhtml | 74 ++ .../content/tests/chrome/bug409624_window.xhtml | 98 ++ .../content/tests/chrome/bug429723_window.xhtml | 94 ++ .../content/tests/chrome/bug451540_window.xhtml | 255 +++++ .../content/tests/chrome/bug624329_window.xhtml | 22 + toolkit/content/tests/chrome/chrome.toml | 360 ++++++ 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 | 274 +++++ .../tests/chrome/findbar_events_window.xhtml | 195 ++++ toolkit/content/tests/chrome/findbar_window.xhtml | 792 +++++++++++++ .../content/tests/chrome/frame_popup_anchor.xhtml | 84 ++ .../chrome/frame_subframe_origin_subframe1.xhtml | 41 + .../chrome/frame_subframe_origin_subframe2.xhtml | 37 + toolkit/content/tests/chrome/popup_trigger.js | 1210 ++++++++++++++++++++ .../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 | 67 ++ .../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 | 169 +++ 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 | 83 ++ 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 | 76 ++ .../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 | 118 ++ .../content/tests/chrome/test_mousescroll.xhtml | 291 +++++ .../tests/chrome/test_mozinputbox_dictionary.xhtml | 100 ++ toolkit/content/tests/chrome/test_named_deck.html | 251 ++++ .../tests/chrome/test_navigate_persist.html | 87 ++ .../tests/chrome/test_notificationbox.xhtml | 731 ++++++++++++ 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 | 167 +++ .../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 | 86 ++ .../content/tests/chrome/test_popupincontent.xhtml | 137 +++ .../content/tests/chrome/test_popupremoving.xhtml | 180 +++ 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 | 249 ++++ .../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 | 205 ++++ .../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 | 126 ++ .../content/tests/chrome/window_preferences.xhtml | 70 ++ .../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 | 40 + .../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 +++++++++++ 177 files changed, 22434 insertions(+) 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.toml 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_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_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 (limited to 'toolkit/content/tests/chrome') 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..b124361fd7 --- /dev/null +++ b/toolkit/content/tests/chrome/bug263683_window.xhtml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug304188_window.xhtml b/toolkit/content/tests/chrome/bug304188_window.xhtml new file mode 100644 index 0000000000..11343f2ace --- /dev/null +++ b/toolkit/content/tests/chrome/bug304188_window.xhtml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug331215_window.xhtml b/toolkit/content/tests/chrome/bug331215_window.xhtml new file mode 100644 index 0000000000..20c08dbd66 --- /dev/null +++ b/toolkit/content/tests/chrome/bug331215_window.xhtml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug360437_window.xhtml b/toolkit/content/tests/chrome/bug360437_window.xhtml new file mode 100644 index 0000000000..dd5e336555 --- /dev/null +++ b/toolkit/content/tests/chrome/bug360437_window.xhtml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + 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..88033ba794 --- /dev/null +++ b/toolkit/content/tests/chrome/bug409624_window.xhtml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug429723_window.xhtml b/toolkit/content/tests/chrome/bug429723_window.xhtml new file mode 100644 index 0000000000..52e743239b --- /dev/null +++ b/toolkit/content/tests/chrome/bug429723_window.xhtml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/bug451540_window.xhtml b/toolkit/content/tests/chrome/bug451540_window.xhtml new file mode 100644 index 0000000000..f8b8900ac6 --- /dev/null +++ b/toolkit/content/tests/chrome/bug451540_window.xhtml @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + 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.toml b/toolkit/content/tests/chrome/chrome.toml new file mode 100644 index 0000000000..70fa12c4b6 --- /dev/null +++ b/toolkit/content/tests/chrome/chrome.toml @@ -0,0 +1,360 @@ +[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_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", + "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_mac_caret.xhtml"] +run-if = ["os == 'mac'"] + +["test_autocomplete_placehold_last_complete.xhtml"] + +["test_autocomplete_with_composition_on_input.html"] +skip-if = [ + "apple_catalina" # Bug 1784825 +] +["test_browser_drop.xhtml"] + +["test_bug1048178.xhtml"] +skip-if = ["apple_catalina"] + +["test_bug263683.xhtml"] +skip-if = [ + "debug && os == 'linux'", + "debug && os == 'win'", +] + +["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_button.xhtml"] + +["test_chromemargin.xhtml"] +support-files = "window_chromemargin.xhtml" +skip-if = ["apple_catalina"] + +["test_closemenu_attribute.xhtml"] + +["test_contextmenu_list.xhtml"] + +["test_contextmenu_rtl.xhtml"] + +["test_cursorsnap.xhtml"] +disabled = true +#skip-if = os != 'win' +support-files = [ + "window_cursorsnap_dialog.xhtml", + "window_cursorsnap_wizard.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 = ["apple_catalina"] # 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_menu.xhtml"] + +["test_menu_activateitem.xhtml"] + +["test_menu_hide.xhtml"] + +["test_menu_mouse_menuactive.xhtml"] + +["test_menu_withcapture.xhtml"] + +["test_menuchecks.xhtml"] + +["test_menuitem_blink.xhtml"] + +["test_menuitem_commands.xhtml"] + +["test_menulist.xhtml"] + +["test_menulist_in_popup.xhtml"] + +["test_menulist_keynav.xhtml"] + +["test_menulist_null_value.xhtml"] + +["test_menulist_paging.xhtml"] + +["test_menulist_position.xhtml"] + +["test_mousescroll.xhtml"] + +["test_mozinputbox_dictionary.xhtml"] + +["test_named_deck.html"] + +["test_navigate_persist.html"] +support-files = ["window_navigate_persist.html"] + +["test_notificationbox.xhtml"] +skip-if = [ + "os == 'linux' && debug", # Bug 1429649 + "os == 'win'", # Bug 1429649 +] + +["test_panel.xhtml"] +skip-if = ["apple_catalina"] # macosx1014 due to 1550078 + +["test_panel_anchoradjust.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 = ["apple_catalina"] + +["test_panel_hover_menu.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' && os_version == '18.04' && asan", # Bug 1582610 + "apple_catalina && debug", # Bug 1281360 +] + +["test_popup_button.xhtml"] +skip-if = [ + "os == 'linux' && os_version == '18.04' && asan", # Bug 1582610 + "apple_catalina && debug", # Bug 1281360 +] + +["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_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 = [ + "apple_catalina", # Bug 1141245, frequent timeouts on OSX 10.14, Windows + "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"] 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..bc02ef6bcc --- /dev/null +++ b/toolkit/content/tests/chrome/findbar_events_window.xhtml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/findbar_window.xhtml b/toolkit/content/tests/chrome/findbar_window.xhtml new file mode 100644 index 0000000000..76bf1cae13 --- /dev/null +++ b/toolkit/content/tests/chrome/findbar_window.xhtml @@ -0,0 +1,792 @@ + + + + + + + + + + + + + + + + + + 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_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..003af044e5 --- /dev/null +++ b/toolkit/content/tests/chrome/popup_trigger.js @@ -0,0 +1,1210 @@ +/* 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", + "bottomcenter topcenter", + "rightcenter leftcenter", + ], + 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..fbcd44e830 --- /dev/null +++ b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html @@ -0,0 +1,67 @@ + + + + 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..12267c1dec --- /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..7e340322b2 --- /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 @@ + + + + + + + + + + + + + + +