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 --- .../geckoview/src/androidTest/assets/moz.build | 78 ++++++ .../androidTest/assets/web_extensions/.eslintrc.js | 14 + .../assets/web_extensions/actions/background.js | 190 +++++++++++++ .../actions/button/beasts-32-light.png | Bin 0 -> 1395 bytes .../web_extensions/actions/button/beasts-32.png | Bin 0 -> 1093 bytes .../web_extensions/actions/button/expected.png | Bin 0 -> 1074 bytes .../web_extensions/actions/button/geo-19.png | Bin 0 -> 225 bytes .../web_extensions/actions/button/geo-38.png | Bin 0 -> 225 bytes .../assets/web_extensions/actions/button/icon.svg | 1 + .../assets/web_extensions/actions/content.js | 4 + .../assets/web_extensions/actions/manifest.json | 43 +++ .../actions/test-open-popup-browser-action.html | 14 + .../actions/test-open-popup-browser-action.js | 7 + .../actions/test-open-popup-page-action.html | 14 + .../actions/test-open-popup-page-action.js | 7 + .../actions/test-popup-messaging.html | 9 + .../web_extensions/actions/test-popup-messaging.js | 24 ++ .../assets/web_extensions/actions/test-popup.html | 9 + .../assets/web_extensions/actions/test-popup.js | 3 + .../assets/web_extensions/borderify-missing-id.xpi | Bin 0 -> 1827 bytes .../assets/web_extensions/borderify-unsigned.xpi | Bin 0 -> 1882 bytes .../assets/web_extensions/borderify-unsigned.zip | Bin 0 -> 1882 bytes .../assets/web_extensions/borderify.xpi | Bin 0 -> 9221 bytes .../assets/web_extensions/borderify/borderify.js | 1 + .../web_extensions/borderify/icons/border-48.png | Bin 0 -> 225 bytes .../assets/web_extensions/borderify/icons/icon.svg | 1 + .../assets/web_extensions/borderify/manifest.json | 23 ++ .../browsing-data-built-in/background.js | 44 +++ .../browsing-data-built-in/manifest.json | 15 + .../web_extensions/browsing-data/background.js | 8 + .../web_extensions/browsing-data/manifest.json | 15 + .../download-flags-false/download.js | 3 + .../download-flags-false/manifest.json | 15 + .../web_extensions/download-flags-true/download.js | 16 ++ .../download-flags-true/manifest.json | 15 + .../web_extensions/download-onChanged/download.js | 18 ++ .../download-onChanged/manifest.json | 15 + .../assets/web_extensions/dummy-incompatible.xpi | Bin 0 -> 521 bytes .../androidTest/assets/web_extensions/dummy.xpi | Bin 0 -> 544 bytes .../assets/web_extensions/dummy/dummy.js | 1 + .../assets/web_extensions/dummy/manifest.json | 21 ++ .../extension-page-restore/manifest.json | 11 + .../extension-page-restore/tab-script.js | 5 + .../web_extensions/extension-page-restore/tab.html | 10 + .../extension-page-update/background-script.js | 7 + .../extension-page-update/manifest.json | 21 ++ .../extension-page-update/tab-script.js | 2 + .../web_extensions/extension-page-update/tab.html | 10 + .../web_extensions/extension-page-update/tabs.js | 1 + .../assets/web_extensions/langpack_signed.xpi | Bin 0 -> 4452 bytes .../web_extensions/messaging-content/manifest.json | 22 ++ .../web_extensions/messaging-content/messaging.js | 29 ++ .../web_extensions/messaging-iframe/manifest.json | 23 ++ .../web_extensions/messaging-iframe/messaging.js | 11 + .../assets/web_extensions/messaging/background.js | 28 ++ .../web_extensions/messaging/icons/border-48.png | Bin 0 -> 225 bytes .../assets/web_extensions/messaging/manifest.json | 18 ++ .../web_extensions/notification-test/background.js | 6 + .../web_extensions/notification-test/manifest.json | 15 + .../web_extensions/openoptionspage-1/background.js | 1 + .../web_extensions/openoptionspage-1/manifest.json | 20 ++ .../web_extensions/openoptionspage-2/background.js | 1 + .../web_extensions/openoptionspage-2/manifest.json | 20 ++ .../web_extensions/page-history/manifest.json | 11 + .../assets/web_extensions/page-history/page.html | 9 + .../clickToRequestPermission.html | 11 + .../permission-request/manifest.json | 13 + .../permission-request/request-permission.js | 11 + .../redirect-to-android-resource/background.js | 39 +++ .../redirect-to-android-resource/manifest.json | 25 ++ .../web-accessible-script.js | 3 + .../tabs-activate-remove-2/background.js | 16 ++ .../tabs-activate-remove-2/manifest.json | 15 + .../tabs-activate-remove/background.js | 16 ++ .../tabs-activate-remove/manifest.json | 15 + .../web_extensions/tabs-create-2/background.js | 4 + .../web_extensions/tabs-create-2/manifest.json | 15 + .../tabs-create-remove/background.js | 3 + .../tabs-create-remove/manifest.json | 15 + .../web_extensions/tabs-create/background.js | 1 + .../web_extensions/tabs-create/manifest.json | 15 + .../web_extensions/tabs-remove/background.js | 3 + .../web_extensions/tabs-remove/manifest.json | 15 + .../test-support/TestSupportChild.sys.mjs | 83 ++++++ .../test-support/TestSupportProcessChild.sys.mjs | 22 ++ .../web_extensions/test-support/background.js | 127 +++++++++ .../web_extensions/test-support/manifest.json | 42 +++ .../assets/web_extensions/test-support/test-api.js | 256 +++++++++++++++++ .../web_extensions/test-support/test-schema.json | 308 +++++++++++++++++++++ .../web_extensions/test-support/test-support.js | 60 ++++ .../assets/web_extensions/update-1/borderify.js | 1 + .../assets/web_extensions/update-1/manifest.json | 18 ++ .../assets/web_extensions/update-2/borderify.js | 1 + .../assets/web_extensions/update-2/manifest.json | 17 ++ .../web_extensions/update-postpone-1/background.js | 3 + .../web_extensions/update-postpone-1/borderify.js | 1 + .../web_extensions/update-postpone-1/manifest.json | 21 ++ .../web_extensions/update-postpone-2/borderify.js | 1 + .../web_extensions/update-postpone-2/manifest.json | 17 ++ .../update-with-perms-1/borderify.js | 1 + .../update-with-perms-1/manifest.json | 18 ++ .../update-with-perms-2/borderify.js | 1 + .../update-with-perms-2/manifest.json | 18 ++ .../www/accessibility/test-aria-comboboxes.html | 11 + .../assets/www/accessibility/test-checkbox.html | 12 + .../assets/www/accessibility/test-clipboard.html | 9 + .../assets/www/accessibility/test-collection.html | 21 ++ .../assets/www/accessibility/test-expandable.html | 13 + .../assets/www/accessibility/test-headings.html | 11 + .../assets/www/accessibility/test-links.html | 12 + .../www/accessibility/test-live-region-atomic.html | 12 + .../accessibility/test-live-region-descendant.html | 9 + .../test-live-region-image-labeled-by.html | 15 + .../www/accessibility/test-live-region-image.html | 15 + .../assets/www/accessibility/test-live-region.html | 9 + .../www/accessibility/test-local-iframe.html | 21 ++ .../test-move-caret-accessibility-focus.html | 9 + .../assets/www/accessibility/test-mutation.html | 9 + .../assets/www/accessibility/test-range.html | 23 ++ .../www/accessibility/test-remote-iframe.html | 24 ++ .../assets/www/accessibility/test-scroll.html | 10 + .../assets/www/accessibility/test-selectable.html | 22 ++ .../www/accessibility/test-text-entry-node.html | 11 + .../assets/www/accessibility/test-tree.html | 10 + .../src/androidTest/assets/www/address_form.html | 21 ++ .../src/androidTest/assets/www/audio/owl.mp3 | Bin 0 -> 67430 bytes .../src/androidTest/assets/www/autoplay.html | 11 + .../src/androidTest/assets/www/badVideoPath.html | 11 + .../src/androidTest/assets/www/beforeunload.html | 15 + .../src/androidTest/assets/www/cc_form.html | 22 ++ .../src/androidTest/assets/www/clickToReload.html | 10 + .../src/androidTest/assets/www/clipboard_read.html | 22 ++ .../src/androidTest/assets/www/color_grid.html | 40 +++ .../assets/www/color_orange_background.html | 29 ++ .../src/androidTest/assets/www/colors.html | 23 ++ .../androidTest/assets/www/context_menu_audio.html | 20 ++ .../assets/www/context_menu_blob_buffered.html | 44 +++ .../assets/www/context_menu_blob_full.html | 22 ++ .../androidTest/assets/www/context_menu_image.html | 10 + .../assets/www/context_menu_image_nested.html | 14 + .../androidTest/assets/www/context_menu_link.html | 15 + .../androidTest/assets/www/context_menu_video.html | 12 + .../src/androidTest/assets/www/data_uri.html | 14 + .../geckoview/src/androidTest/assets/www/dnd.html | 27 ++ .../src/androidTest/assets/www/download.html | 18 ++ .../assets/www/fedcm_accounts_endpoint.json | 12 + .../androidTest/assets/www/fedcm_idp_manifest.json | 18 ++ .../androidTest/assets/www/fedcm_idp_metadata.json | 4 + .../assets/www/fedcm_idtokens_endpoint.json | 3 + .../src/androidTest/assets/www/fedcm_rp.html | 8 + .../src/androidTest/assets/www/fixedbottom.html | 36 +++ .../src/androidTest/assets/www/fixedpercent.html | 25 ++ .../src/androidTest/assets/www/fixedvh.html | 25 ++ .../src/androidTest/assets/www/form_blank.html | 20 ++ .../src/androidTest/assets/www/forms.html | 34 +++ .../src/androidTest/assets/www/forms2.html | 17 ++ .../src/androidTest/assets/www/forms2_iframe.html | 16 ++ .../src/androidTest/assets/www/forms3.html | 14 + .../src/androidTest/assets/www/forms4.html | 14 + .../src/androidTest/assets/www/forms5.html | 24 ++ .../androidTest/assets/www/forms_autocomplete.html | 16 ++ .../assets/www/forms_autocomplete_iframe.html | 15 + .../src/androidTest/assets/www/forms_id_value.html | 12 + .../src/androidTest/assets/www/forms_iframe.html | 58 ++++ .../src/androidTest/assets/www/forms_xorigin.html | 77 ++++++ .../src/androidTest/assets/www/fullscreen.html | 9 + .../assets/www/getusermedia_xorigin_container.html | 58 ++++ .../assets/www/getusermedia_xorigin_iframe.html | 39 +++ .../src/androidTest/assets/www/hello.html | 10 + .../src/androidTest/assets/www/hello2.html | 9 + .../src/androidTest/assets/www/helloPDFWorld.pdf | Bin 0 -> 10414 bytes .../src/androidTest/assets/www/hsts_header.sjs | 6 + .../src/androidTest/assets/www/hungScript.html | 16 ++ .../iframe_100_percent_height_no_scrollable.html | 60 ++++ .../www/iframe_100_percent_height_scrollable.html | 60 ++++ .../assets/www/iframe_98vh_no_scrollable.html | 55 ++++ .../assets/www/iframe_98vh_scrollable.html | 55 ++++ .../src/androidTest/assets/www/iframe_hello.html | 10 + .../androidTest/assets/www/iframe_http_only.html | 14 + .../assets/www/iframe_redirect_automation.html | 12 + .../assets/www/iframe_redirect_local.html | 10 + .../assets/www/iframe_unknown_protocol.html | 10 + .../src/androidTest/assets/www/images/test.gif | Bin 0 -> 23961 bytes .../src/androidTest/assets/www/inputs.html | 66 +++++ .../src/androidTest/assets/www/links.html | 28 ++ .../src/androidTest/assets/www/loremIpsum.html | 17 ++ .../androidTest/assets/www/manifest.webmanifest | 17 ++ .../assets/www/media_session_default1.html | 15 + .../androidTest/assets/www/media_session_dom1.html | 109 ++++++++ .../src/androidTest/assets/www/metatags.html | 19 ++ .../src/androidTest/assets/www/mouseToReload.html | 10 + .../geckoview/src/androidTest/assets/www/mp4.html | 11 + .../src/androidTest/assets/www/newSession.html | 22 ++ .../androidTest/assets/www/newSession_child.html | 9 + .../androidTest/assets/www/no-meta-viewport.html | 5 + .../geckoview/src/androidTest/assets/www/ogg.html | 11 + .../src/androidTest/assets/www/orange.pdf | Bin 0 -> 16829 bytes .../assets/www/overscroll-behavior-auto-none.html | 28 ++ .../assets/www/overscroll-behavior-auto.html | 28 ++ .../assets/www/overscroll-behavior-none-auto.html | 28 ++ .../www/overscroll-behavior-none-on-non-root.html | 37 +++ .../src/androidTest/assets/www/popup.html | 12 + .../assets/www/print_content_change.html | 37 +++ .../src/androidTest/assets/www/print_iframe.html | 39 +++ .../src/androidTest/assets/www/prompts.html | 31 +++ .../assets/www/pull-to-refresh-subframe.html | 82 ++++++ .../src/androidTest/assets/www/push/push.html | 10 + .../src/androidTest/assets/www/push/push.js | 44 +++ .../src/androidTest/assets/www/push/sw.js | 30 ++ ...ground-body-fully-covered-by-green-element.html | 23 ++ .../www/reflect_local_storage_into_title.html | 17 ++ .../src/androidTest/assets/www/resubmit.html | 12 + .../assets/www/root_100_percent_height.html | 37 +++ .../src/androidTest/assets/www/root_100vh.html | 36 +++ .../src/androidTest/assets/www/root_98vh.html | 36 +++ .../src/androidTest/assets/www/saveState.html | 18 ++ .../src/androidTest/assets/www/scroll-handoff.html | 40 +++ .../src/androidTest/assets/www/scroll.html | 59 ++++ .../src/androidTest/assets/www/select-listbox.html | 7 + .../androidTest/assets/www/select-multiple.html | 7 + .../src/androidTest/assets/www/select.html | 6 + .../assets/www/selectionAction_frame.html | 6 + .../assets/www/selectionAction_frame_xorigin.html | 47 ++++ .../androidTest/assets/www/showDynamicToolbar.html | 96 +++++++ .../src/androidTest/assets/www/simple_redirect.sjs | 4 + .../src/androidTest/assets/www/titleChange.html | 16 ++ .../assets/www/touch-action-wheel-listener.html | 33 +++ .../src/androidTest/assets/www/touch-action.html | 48 ++++ .../src/androidTest/assets/www/touch.html | 58 ++++ .../src/androidTest/assets/www/touch_xorigin.html | 16 ++ .../src/androidTest/assets/www/touchstart.html | 37 +++ .../src/androidTest/assets/www/tracemonkey.pdf | Bin 0 -> 178030 bytes .../src/androidTest/assets/www/trackers.html | 14 + .../assets/www/translations-tester-en.html | 62 +++++ .../assets/www/translations-tester-es.html | 83 ++++++ .../src/androidTest/assets/www/transparent.gif | Bin 0 -> 43 bytes .../androidTest/assets/www/update_manifest.json | 40 +++ .../src/androidTest/assets/www/videos/gizmo.webm | Bin 0 -> 159035 bytes .../src/androidTest/assets/www/videos/short.mp4 | Bin 0 -> 13651 bytes .../src/androidTest/assets/www/videos/video.ogg | Bin 0 -> 285310 bytes .../src/androidTest/assets/www/viewport.html | 19 ++ .../geckoview/src/androidTest/assets/www/webm.html | 11 + .../androidTest/assets/www/worker/open_window.html | 10 + .../androidTest/assets/www/worker/open_window.js | 15 + .../assets/www/worker/open_window_target.html | 9 + .../assets/www/worker/service-worker.js | 15 + 246 files changed, 5411 insertions(+) create mode 100644 mobile/android/geckoview/src/androidTest/assets/moz.build create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/.eslintrc.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32-light.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/expected.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-19.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-38.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/icon.svg create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/content.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-missing-id.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.zip create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/border-48.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/icon.svg create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/download.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/download.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/download.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy-incompatible.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/dummy.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab-script.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/background-script.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab-script.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tabs.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/langpack_signed.xpi create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/messaging.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/messaging.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/icons/border-48.png create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/page.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/clickToRequestPermission.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/request-permission.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/web-accessible-script.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportChild.sys.mjs create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportProcessChild.sys.mjs create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-schema.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-support.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/background.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/borderify.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-aria-comboboxes.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-checkbox.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-clipboard.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-collection.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-expandable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-headings.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-links.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-atomic.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-descendant.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image-labeled-by.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-local-iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-move-caret-accessibility-focus.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-mutation.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-range.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-remote-iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-scroll.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-selectable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-text-entry-node.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-tree.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/address_form.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/audio/owl.mp3 create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/autoplay.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/badVideoPath.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/beforeunload.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/cc_form.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/clickToReload.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/clipboard_read.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/color_grid.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/color_orange_background.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/colors.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_audio.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_buffered.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_full.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_image.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_image_nested.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_link.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/context_menu_video.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/data_uri.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/dnd.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/download.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fedcm_accounts_endpoint.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_metadata.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fedcm_idtokens_endpoint.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fedcm_rp.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fixedpercent.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fixedvh.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/form_blank.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms2.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms2_iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms3.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms4.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms5.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete_iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms_id_value.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/forms_xorigin.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/fullscreen.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_container.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/hello.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/hello2.html create mode 100755 mobile/android/geckoview/src/androidTest/assets/www/helloPDFWorld.pdf create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/hsts_header.sjs create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/hungScript.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_no_scrollable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_scrollable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_no_scrollable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_scrollable.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_hello.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_http_only.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_automation.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_local.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/iframe_unknown_protocol.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/images/test.gif create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/inputs.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/links.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/loremIpsum.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/manifest.webmanifest create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/media_session_default1.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/media_session_dom1.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/metatags.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/mouseToReload.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/mp4.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/newSession.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/newSession_child.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/no-meta-viewport.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/ogg.html create mode 100755 mobile/android/geckoview/src/androidTest/assets/www/orange.pdf create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto-none.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-auto.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-on-non-root.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/popup.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/print_content_change.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/print_iframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/prompts.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/pull-to-refresh-subframe.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/push/push.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/push/push.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/push/sw.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/red-background-body-fully-covered-by-green-element.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/reflect_local_storage_into_title.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/resubmit.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/root_100_percent_height.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/root_100vh.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/root_98vh.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/saveState.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/scroll-handoff.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/scroll.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/select-listbox.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/select-multiple.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/select.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame_xorigin.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/showDynamicToolbar.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/simple_redirect.sjs create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/titleChange.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/touch-action-wheel-listener.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/touch-action.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/touch.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/touch_xorigin.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/touchstart.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/tracemonkey.pdf create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/trackers.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/translations-tester-en.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/translations-tester-es.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/transparent.gif create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/update_manifest.json create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/videos/gizmo.webm create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/videos/short.mp4 create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/videos/video.ogg create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/viewport.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/webm.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.js create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/worker/open_window_target.html create mode 100644 mobile/android/geckoview/src/androidTest/assets/www/worker/service-worker.js (limited to 'mobile/android/geckoview/src/androidTest/assets') diff --git a/mobile/android/geckoview/src/androidTest/assets/moz.build b/mobile/android/geckoview/src/androidTest/assets/moz.build new file mode 100644 index 0000000000..12d6550f1c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/moz.build @@ -0,0 +1,78 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +addons = { + "browsing-data": [ + "background.js", + "manifest.json", + ], + "tabs-activate-remove": [ + "background.js", + "manifest.json", + ], + "tabs-activate-remove-2": [ + "background.js", + "manifest.json", + ], + "update-1": [ + "borderify.js", + "manifest.json", + ], + "update-2": [ + "borderify.js", + "manifest.json", + ], + "update-postpone-1": [ + "background.js", + "borderify.js", + "manifest.json", + ], + "update-postpone-2": [ + "borderify.js", + "manifest.json", + ], + "update-with-perms-1": [ + "borderify.js", + "manifest.json", + ], + "update-with-perms-2": [ + "borderify.js", + "manifest.json", + ], + "page-history": [ + "page.html", + "manifest.json", + ], + "download-flags-true": [ + "download.js", + "manifest.json", + ], + "download-flags-false": [ + "download.js", + "manifest.json", + ], + "download-onChanged": [ + "download.js", + "manifest.json", + ], + "permission-request": [ + "clickToRequestPermission.html", + "request-permission.js", + "manifest.json", + ], +} + +for addon, files in addons.items(): + indir = "web_extensions/%s" % addon + xpi = "%s.xpi" % indir + inputs = [indir] + for file in files: + inputs.append("%s/%s" % (indir, file)) + GeneratedFile( + xpi, script="/toolkit/mozapps/extensions/test/create_xpi.py", inputs=inputs + ) + + TEST_HARNESS_FILES.testing.mochitest.tests.junit += ["!%s" % xpi] diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/.eslintrc.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/.eslintrc.js new file mode 100644 index 0000000000..41c5ed8080 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/.eslintrc.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = { + env: { + webextensions: true, + }, + globals: { + ExtensionAPI: true, + // available to frameScripts + addMessageListener: false, + content: false, + sendAsyncMessage: false, + }, +}; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/background.js new file mode 100644 index 0000000000..dab0f5d897 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/background.js @@ -0,0 +1,190 @@ +const port = browser.runtime.connectNative("browser"); +port.onMessage.addListener(message => { + handleMessage(message, null); +}); + +browser.runtime.onMessage.addListener((message, sender) => { + handleMessage(message, sender.tab.id); +}); + +browser.pageAction.onClicked.addListener(tab => { + port.postMessage({ method: "onClicked", tabId: tab.id, type: "pageAction" }); +}); + +browser.browserAction.onClicked.addListener(tab => { + port.postMessage({ + method: "onClicked", + tabId: tab.id, + type: "browserAction", + }); +}); + +function handlePageActionMessage(message, tabId) { + switch (message.action) { + case "enable": + browser.pageAction.show(tabId); + break; + + case "disable": + browser.pageAction.hide(tabId); + break; + + case "setPopup": + browser.pageAction.setPopup({ + tabId, + popup: message.popup, + }); + break; + + case "setPopupCheckRestrictions": + browser.pageAction + .setPopup({ + tabId, + popup: message.popup, + }) + .then( + () => { + port.postMessage({ + resultFor: "setPopup", + type: "pageAction", + success: true, + }); + }, + err => { + port.postMessage({ + resultFor: "setPopup", + type: "pageAction", + success: false, + error: String(err), + }); + } + ); + break; + + case "setTitle": + browser.pageAction.setTitle({ + tabId, + title: message.title, + }); + break; + + case "setIcon": + browser.pageAction.setIcon({ + tabId, + imageData: message.imageData, + path: message.path, + }); + break; + + default: + throw new Error(`Page Action does not support ${message.action}`); + } +} + +function handleBrowserActionMessage(message, tabId) { + switch (message.action) { + case "enable": + browser.browserAction.enable(tabId); + break; + + case "disable": + browser.browserAction.disable(tabId); + break; + + case "setBadgeText": + browser.browserAction.setBadgeText({ + tabId, + text: message.text, + }); + break; + + case "setBadgeTextColor": + browser.browserAction.setBadgeTextColor({ + tabId, + color: message.color, + }); + break; + + case "setBadgeBackgroundColor": + browser.browserAction.setBadgeBackgroundColor({ + tabId, + color: message.color, + }); + break; + + case "setPopup": + browser.browserAction.setPopup({ + tabId, + popup: message.popup, + }); + break; + + case "setPopupCheckRestrictions": + browser.browserAction + .setPopup({ + tabId, + popup: message.popup, + }) + .then( + () => { + port.postMessage({ + resultFor: "setPopup", + type: "browserAction", + success: true, + }); + }, + err => { + port.postMessage({ + resultFor: "setPopup", + type: "browserAction", + success: false, + error: String(err), + }); + } + ); + break; + + case "setTitle": + browser.browserAction.setTitle({ + tabId, + title: message.title, + }); + break; + + case "setIcon": + browser.browserAction.setIcon({ + tabId, + imageData: message.imageData, + path: message.path, + }); + break; + + default: + throw new Error(`Browser Action does not support ${message.action}`); + } +} + +function handleMessage(message, tabId) { + switch (message.type) { + case "ping": + port.postMessage({ method: "pong" }); + return; + + case "load": + browser.tabs.update(tabId, { + url: message.url, + }); + return; + + case "browserAction": + handleBrowserActionMessage(message, tabId); + return; + + case "pageAction": + handlePageActionMessage(message, tabId); + return; + + default: + throw new Error(`Unsupported message type ${message.type}`); + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32-light.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32-light.png new file mode 100644 index 0000000000..dbed714c56 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32-light.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32.png new file mode 100644 index 0000000000..89863ccec7 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/beasts-32.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/expected.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/expected.png new file mode 100644 index 0000000000..aea2c19784 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/expected.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-19.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-19.png new file mode 100644 index 0000000000..90687de26d Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-19.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-38.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-38.png new file mode 100644 index 0000000000..90687de26d Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/geo-38.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/icon.svg b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/icon.svg new file mode 100644 index 0000000000..dd1fae7d15 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/button/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/content.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/content.js new file mode 100644 index 0000000000..eaa2467df0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/content.js @@ -0,0 +1,4 @@ +const port = browser.runtime.connectNative("browser"); +port.onMessage.addListener(message => { + browser.runtime.sendMessage(message); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/manifest.json new file mode 100644 index 0000000000..21ca7c7e07 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/manifest.json @@ -0,0 +1,43 @@ +{ + "manifest_version": 2, + "name": "actions", + "version": "1.0", + "description": "Defines Page and Browser actions", + "browser_specific_settings": { + "gecko": { + "id": "actions@tests.mozilla.org" + } + }, + "browser_action": { + "default_title": "Test action default", + "theme_icons": [ + { + "light": "button/beasts-32-light.png", + "dark": "button/beasts-32.png", + "size": 32 + } + ] + }, + "page_action": { + "default_title": "Test action default", + "default_icon": { + "19": "button/geo-19.png", + "38": "button/geo-38.png" + } + }, + "background": { + "scripts": ["background.js"] + }, + "content_scripts": [ + { + "matches": [""], + "js": ["content.js"] + } + ], + "permissions": [ + "tabs", + "geckoViewAddons", + "nativeMessaging", + "nativeMessagingFromContent" + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.html new file mode 100644 index 0000000000..dc388b8a7f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.html @@ -0,0 +1,14 @@ + + + + + + + +

Hello, world!

+ + + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.js new file mode 100644 index 0000000000..cde31235ac --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-browser-action.js @@ -0,0 +1,7 @@ +window.addEventListener("DOMContentLoaded", init); + +function init() { + document.body.addEventListener("click", event => { + browser.browserAction.openPopup(); + }); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.html new file mode 100644 index 0000000000..3fe42d0b2e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.html @@ -0,0 +1,14 @@ + + + + + + + +

Hello, world!

+ + + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.js new file mode 100644 index 0000000000..f16d96333f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-open-popup-page-action.js @@ -0,0 +1,7 @@ +window.addEventListener("DOMContentLoaded", init); + +function init() { + document.body.addEventListener("click", event => { + browser.pageAction.openPopup(); + }); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.html new file mode 100644 index 0000000000..f0fff977d8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.html @@ -0,0 +1,9 @@ + + + + + + +

HELLO

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.js new file mode 100644 index 0000000000..479f957564 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup-messaging.js @@ -0,0 +1,24 @@ +browser.runtime.sendNativeMessage("badNativeApi", "errorerrorerror"); + +async function runTest() { + const response = await browser.runtime.sendNativeMessage( + "browser", + "testPopupMessage" + ); + + browser.runtime.sendNativeMessage("browser", `response: ${response}`); + + const port = browser.runtime.connectNative("browser"); + port.onMessage.addListener(response => { + if (response.action === "disconnect") { + port.disconnect(); + return; + } + + port.postMessage(`response: ${response.message}`); + }); + + port.postMessage("testPopupPortMessage"); +} + +runTest(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.html new file mode 100644 index 0000000000..dd98313e59 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.html @@ -0,0 +1,9 @@ + + + + + + +

HELLO

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.js new file mode 100644 index 0000000000..47271e744c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/actions/test-popup.js @@ -0,0 +1,3 @@ +window.addEventListener("DOMContentLoaded", () => { + window.close(); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-missing-id.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-missing-id.xpi new file mode 100644 index 0000000000..19ce0d7f0f Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-missing-id.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.xpi new file mode 100644 index 0000000000..fd395d13df Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.zip b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.zip new file mode 100644 index 0000000000..fd395d13df Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify-unsigned.zip differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify.xpi new file mode 100644 index 0000000000..1ed97f1047 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/borderify.js new file mode 100644 index 0000000000..9c3728b381 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid red"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/border-48.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/border-48.png new file mode 100644 index 0000000000..90687de26d Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/border-48.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/icon.svg b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/icon.svg new file mode 100644 index 0000000000..dd1fae7d15 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/icons/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/manifest.json new file mode 100644 index 0000000000..4e3daf6708 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/borderify/manifest.json @@ -0,0 +1,23 @@ +{ + "manifest_version": 2, + "name": "Borderify", + "version": "1.0", + "description": "Adds a red border to all webpages matching example.com.", + "browser_specific_settings": { + "gecko": { + "id": "borderify@tests.mozilla.org" + } + }, + "icons": { + "48": "icons/border-48.png" + }, + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ], + "options_ui": { + "page": "dummy.html" + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/background.js new file mode 100644 index 0000000000..d0ae54b3dd --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/background.js @@ -0,0 +1,44 @@ +const port = browser.runtime.connectNative("browser"); + +async function apiCall(message) { + const { type, since, removalOptions, dataTypes } = message; + switch (type) { + case "clear-downloads": + await browser.browsingData.removeDownloads({ since }); + break; + case "clear-form-data": + await browser.browsingData.removeFormData({ since }); + break; + case "clear-history": + await browser.browsingData.removeHistory({ since }); + break; + case "clear-passwords": + await browser.browsingData.removePasswords({ since }); + break; + case "clear": + await browser.browsingData.remove(removalOptions, dataTypes); + break; + case "get-settings": + return browser.browsingData.settings(); + } + return null; +} + +port.onMessage.addListener(async message => { + const { uuid } = message; + try { + const result = await apiCall(message); + port.postMessage({ + type: "response", + result, + uuid, + }); + } catch (exception) { + const { message } = exception; + port.postMessage({ + type: "error", + error: message, + uuid, + }); + } +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/manifest.json new file mode 100644 index 0000000000..23df4d8338 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data-built-in/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "BrowsingData", + "browser_specific_settings": { + "gecko": { + "id": "browsing-data-settings@tests.mozilla.org" + } + }, + "version": "1.0", + "description": "Tests the browsingData API", + "background": { + "scripts": ["background.js"] + }, + "permissions": ["browsingData", "geckoViewAddons", "nativeMessaging"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/background.js new file mode 100644 index 0000000000..4597e3328b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/background.js @@ -0,0 +1,8 @@ +browser.browsingData.removeDownloads({ since: 10001 }); +browser.browsingData.removeFormData({ since: 10002 }); +browser.browsingData.removeHistory({ since: 10003 }); +browser.browsingData.removePasswords({ since: 10004 }); +browser.browsingData.remove( + { since: 10005 }, + { downloads: true, cookies: true } +); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/manifest.json new file mode 100644 index 0000000000..f7af03c25e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/browsing-data/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "BrowsingData", + "browser_specific_settings": { + "gecko": { + "id": "browsing-data@tests.mozilla.org" + } + }, + "version": "1.0", + "description": "Tests the browsingData API", + "background": { + "scripts": ["background.js"] + }, + "permissions": ["browsingData"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/download.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/download.js new file mode 100644 index 0000000000..68f51ea5d8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/download.js @@ -0,0 +1,3 @@ +browser.downloads.download({ + url: "http://localhost:4245/assets/www/images/test.gif", +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/manifest.json new file mode 100644 index 0000000000..77b1cb5179 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-false/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Download", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "download-flags-false@tests.mozilla.org" + } + }, + "description": "Downloads a file", + "background": { + "scripts": ["download.js"] + }, + "permissions": ["downloads"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/download.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/download.js new file mode 100644 index 0000000000..4bb06a5cbb --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/download.js @@ -0,0 +1,16 @@ +browser.downloads.download({ + url: "http://localhost:4245/assets/www/images/test.gif", + filename: "banana.gif", + method: "POST", + body: "postbody", + headers: [ + { + name: "User-Agent", + value: "Mozilla Firefox", + }, + ], + allowHttpErrors: true, + conflictAction: "overwrite", + saveAs: true, + incognito: true, +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/manifest.json new file mode 100644 index 0000000000..c0170dafd4 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-flags-true/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Download", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "download-flags-true@tests.mozilla.org" + } + }, + "description": "Downloads a file", + "background": { + "scripts": ["download.js"] + }, + "permissions": ["downloads"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/download.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/download.js new file mode 100644 index 0000000000..01cd377cef --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/download.js @@ -0,0 +1,18 @@ +async function test() { + browser.downloads.onChanged.addListener(async delta => { + const changes = { current: {}, previous: {} }; + changes.id = delta.id; + delete delta.id; + for (const prop in delta) { + changes.current[prop] = delta[prop].current; + changes.previous[prop] = delta[prop].previous; + } + await browser.runtime.sendNativeMessage("browser", changes); + }); + + await browser.downloads.download({ + url: "http://localhost:4245/assets/www/images/test.gif", + }); +} + +test(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/manifest.json new file mode 100644 index 0000000000..1c1ad4cc5e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/download-onChanged/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Download", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "download-onChanged@tests.mozilla.org" + } + }, + "description": "Downloads a file", + "background": { + "scripts": ["download.js"] + }, + "permissions": ["downloads", "geckoViewAddons", "nativeMessaging"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy-incompatible.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy-incompatible.xpi new file mode 100644 index 0000000000..93c5dbd3b2 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy-incompatible.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy.xpi new file mode 100644 index 0000000000..0e0f549ceb Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/dummy.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/dummy.js new file mode 100644 index 0000000000..2a49c0d665 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/dummy.js @@ -0,0 +1 @@ +console.log("Hi, I'm a dummy."); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/manifest.json new file mode 100644 index 0000000000..f1f9b93a91 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/dummy/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 2, + "name": "Dummy", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "dummy@tests.mozilla.org" + } + }, + "description": "Doesn't do anything.", + "options_ui": { + "open_in_tab": true, + "page": "options.html" + }, + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["dummy.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/manifest.json new file mode 100644 index 0000000000..0fcb48bc8f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/manifest.json @@ -0,0 +1,11 @@ +{ + "manifest_version": 2, + "name": "Test messages sent from extensions when restoring", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "extension-page-restoring@tests.mozilla.org" + } + }, + "permissions": ["geckoViewAddons", "nativeMessaging"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab-script.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab-script.js new file mode 100644 index 0000000000..66866bbd37 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab-script.js @@ -0,0 +1,5 @@ +browser.runtime.sendNativeMessage("browser1", "HELLO_FROM_PAGE_1"); +browser.runtime.sendNativeMessage("browser2", "HELLO_FROM_PAGE_2"); + +const port = browser.runtime.connectNative("browser1"); +port.postMessage("HELLO_FROM_PORT"); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab.html new file mode 100644 index 0000000000..d99a610c0c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-restore/tab.html @@ -0,0 +1,10 @@ + + + + + + +

Hello World!

+ + + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/background-script.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/background-script.js new file mode 100644 index 0000000000..43e2b44f96 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/background-script.js @@ -0,0 +1,7 @@ +browser.runtime.onMessage.addListener(notify); + +function notify(message) { + if (message.action == "showTab") { + browser.tabs.update({ url: "/tab.html" }); + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/manifest.json new file mode 100644 index 0000000000..c64115e07c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 2, + "name": "Mozilla Android Components - Tabs Update Test", + "version": "1.0", + "background": { + "scripts": ["background-script.js"] + }, + "browser_specific_settings": { + "gecko": { + "id": "extension-page-update@tests.mozilla.org" + } + }, + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["tabs.js"], + "run_at": "document_idle" + } + ], + "permissions": ["geckoViewAddons", "nativeMessaging", "tabs", ""] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab-script.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab-script.js new file mode 100644 index 0000000000..011f3bb301 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab-script.js @@ -0,0 +1,2 @@ +// Let's test privileged APIs +browser.runtime.sendNativeMessage("browser", "HELLO_FROM_PAGE"); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab.html new file mode 100644 index 0000000000..d99a610c0c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tab.html @@ -0,0 +1,10 @@ + + + + + + +

Hello World!

+ + + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tabs.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tabs.js new file mode 100644 index 0000000000..ef5fbf6ce3 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tabs.js @@ -0,0 +1 @@ +browser.runtime.sendMessage({ action: "showTab" }); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/langpack_signed.xpi b/mobile/android/geckoview/src/androidTest/assets/web_extensions/langpack_signed.xpi new file mode 100644 index 0000000000..f60d00348e Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/langpack_signed.xpi differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/manifest.json new file mode 100644 index 0000000000..9a687dafbe --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/manifest.json @@ -0,0 +1,22 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Test messaging between app and web extension", + "browser_specific_settings": { + "gecko": { + "id": "messaging-content@tests.mozilla.org" + } + }, + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["messaging.js"] + } + ], + "permissions": [ + "geckoViewAddons", + "nativeMessaging", + "nativeMessagingFromContent" + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/messaging.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/messaging.js new file mode 100644 index 0000000000..1c8323df53 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/messaging.js @@ -0,0 +1,29 @@ +// This message should not be handled +browser.runtime.sendNativeMessage("badNativeApi", "errorerrorerror"); + +async function runTest() { + const response = await browser.runtime.sendNativeMessage( + "browser", + "testContentBrowserMessage" + ); + + browser.runtime.sendNativeMessage("browser", `response: ${response}`); + + const port = browser.runtime.connectNative("browser"); + port.onMessage.addListener(response => { + if (response.action === "disconnect") { + port.disconnect(); + return; + } + + port.postMessage(`response: ${response.message}`); + }); + + port.onDisconnect.addListener(() => + browser.runtime.sendNativeMessage("browser", { type: "portDisconnected" }) + ); + + port.postMessage("testContentPortMessage"); +} + +runTest(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/manifest.json new file mode 100644 index 0000000000..f9039fd2e8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/manifest.json @@ -0,0 +1,23 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Test messaging between app and web extension", + "browser_specific_settings": { + "gecko": { + "id": "messaging-iframe@tests.mozilla.org" + } + }, + "content_scripts": [ + { + "matches": ["*://localhost/*"], + "js": ["messaging.js"], + "all_frames": true + } + ], + "permissions": [ + "geckoViewAddons", + "nativeMessaging", + "nativeMessagingFromContent" + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/messaging.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/messaging.js new file mode 100644 index 0000000000..eb4ad3d8f9 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/messaging.js @@ -0,0 +1,11 @@ +browser.runtime.sendNativeMessage("badNativeApi", "errorerrorerror"); + +async function runTest() { + await browser.runtime.sendNativeMessage( + "browser", + "testContentBrowserMessage" + ); + browser.runtime.connectNative("browser"); +} + +runTest(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/background.js new file mode 100644 index 0000000000..20deb53ae7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/background.js @@ -0,0 +1,28 @@ +browser.runtime.sendNativeMessage("badNativeApi", "errorerrorerror"); + +async function runTest() { + const response = await browser.runtime.sendNativeMessage( + "browser", + "testBackgroundBrowserMessage" + ); + + browser.runtime.sendNativeMessage("browser", `response: ${response}`); + + const port = browser.runtime.connectNative("browser"); + port.onMessage.addListener(response => { + if (response.action === "disconnect") { + port.disconnect(); + return; + } + + port.postMessage(`response: ${response.message}`); + }); + + port.onDisconnect.addListener(() => + browser.runtime.sendNativeMessage("browser", { type: "portDisconnected" }) + ); + + port.postMessage("testBackgroundPortMessage"); +} + +runTest(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/icons/border-48.png b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/icons/border-48.png new file mode 100644 index 0000000000..90687de26d Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/icons/border-48.png differ diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/manifest.json new file mode 100644 index 0000000000..d25b692f63 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/manifest.json @@ -0,0 +1,18 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Test messaging between app and web extension", + "icons": { + "48": "icons/border-48.png" + }, + "browser_specific_settings": { + "gecko": { + "id": "messaging@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["geckoViewAddons", "nativeMessaging"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/background.js new file mode 100644 index 0000000000..cdd3a7a523 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/background.js @@ -0,0 +1,6 @@ +browser.notifications.create("cake-notification", { + type: "basic", + title: "Time for cake!", + iconUrl: "https://example.com/img.svg", + message: "Something something cake", +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/manifest.json new file mode 100644 index 0000000000..963fb51e3f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/notification-test/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Notification test", + "version": "1.0", + "description": "Send a notification.", + "browser_specific_settings": { + "gecko": { + "id": "notification@example.com" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["notifications"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/background.js new file mode 100644 index 0000000000..1872c48d00 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/background.js @@ -0,0 +1 @@ +browser.runtime.openOptionsPage(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/manifest.json new file mode 100644 index 0000000000..487fb0fb3d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-1/manifest.json @@ -0,0 +1,20 @@ +{ + "manifest_version": 2, + "name": "openOptionsPage-1", + "version": "1.0", + "description": "Opens options page in a new tab.", + "browser_specific_settings": { + "gecko": { + "id": "openoptionspage1@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"], + "options_ui": { + "page": "options.html", + "browser_style": true, + "open_in_tab": true + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/background.js new file mode 100644 index 0000000000..1872c48d00 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/background.js @@ -0,0 +1 @@ +browser.runtime.openOptionsPage(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/manifest.json new file mode 100644 index 0000000000..3378050197 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/openoptionspage-2/manifest.json @@ -0,0 +1,20 @@ +{ + "manifest_version": 2, + "name": "openOptionsPage-2", + "version": "1.0", + "description": "Opens options page via delegate.", + "browser_specific_settings": { + "gecko": { + "id": "openoptionspage2@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"], + "options_ui": { + "page": "options.html", + "browser_style": true, + "open_in_tab": false + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/manifest.json new file mode 100644 index 0000000000..9d411c8dd6 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/manifest.json @@ -0,0 +1,11 @@ +{ + "manifest_version": 2, + "name": "Page History", + "version": "1.0", + "browser_specific_settings": { + "gecko": { + "id": "page-history@tests.mozilla.org" + } + }, + "description": "Can load a WebExtension Page." +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/page.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/page.html new file mode 100644 index 0000000000..b16a98f74b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/page-history/page.html @@ -0,0 +1,9 @@ + + + + + + +

Hello, World!

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/clickToRequestPermission.html b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/clickToRequestPermission.html new file mode 100644 index 0000000000..e6ddcb8c8d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/clickToRequestPermission.html @@ -0,0 +1,11 @@ + + + + Hello, world! + + + + +

Hello, world!

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/manifest.json new file mode 100644 index 0000000000..d2cd405cd1 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 2, + "name": "permissions", + "browser_specific_settings": { + "gecko": { + "id": "permissions@example.com" + } + }, + "version": "1.0", + "description": "Request optional extension permissions.", + "permissions": ["nativeMessaging", "geckoViewAddons"], + "optional_permissions": ["geolocation", "*://example.com/*"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/request-permission.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/request-permission.js new file mode 100644 index 0000000000..d50bff4126 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/permission-request/request-permission.js @@ -0,0 +1,11 @@ +window.onload = () => { + document.body.addEventListener("click", requestPermissions); + async function requestPermissions() { + const perms = { + permissions: ["geolocation"], + origins: ["*://example.com/*"], + }; + const response = await browser.permissions.request(perms); + browser.runtime.sendNativeMessage("browser", `${response}`); + } +}; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/background.js new file mode 100644 index 0000000000..fdf088a505 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/background.js @@ -0,0 +1,39 @@ +"use strict"; + +function setupRedirect(fromUrl, redirectUrl) { + browser.webRequest.onBeforeRequest.addListener( + details => { + console.log(`Extension redirects from ${fromUrl} to ${redirectUrl}`); + return { redirectUrl }; + }, + { urls: [fromUrl] }, + ["blocking"] + ); +} + +// Intercepts all script requests from androidTest/assets/www/trackers.html. +// Scripts are executed in order of appearance in the page and block the +// page's "load" event, so the test runner can just wait for the page to +// have loaded and then check the page content to verify that the requests +// were intercepted as expected. +setupRedirect( + "http://trackertest.org/tracker.js", + "data:text/javascript,document.body.textContent='start'" +); +setupRedirect( + "https://tracking.example.com/tracker.js", + browser.runtime.getURL("web-accessible-script.js") +); +setupRedirect( + "https://itisatracker.org/tracker.js", + `data:text/javascript,document.body.textContent+=',end'` +); + +// Work around bug 1300234 to ensure that the webRequest listener has been +// registered before we resume the test. API result doesn't matter, we just +// want to make a roundtrip. +var listenerReady = browser.webRequest.getSecurityInfo("").catch(() => {}); + +listenerReady.then(() => { + browser.runtime.sendNativeMessage("browser", "setupReadyStartTest"); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/manifest.json new file mode 100644 index 0000000000..71d811faa3 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/manifest.json @@ -0,0 +1,25 @@ +{ + "name": "redirect-to-android-resource", + "description": "Redirects script requests from trackers.html to moz-extension:-resource packaged in the APK (resource://android/...)", + "manifest_version": 2, + "version": "1", + "browser_specific_settings": { + "gecko": { + "id": "redirect-to-android-resource@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": [ + "geckoViewAddons", + "nativeMessaging", + "webRequest", + "webRequestBlocking", + "http://localhost/", + "http://trackertest.org/", + "https://tracking.example.com/", + "https://itisatracker.org/tracker.js" + ], + "web_accessible_resources": ["web-accessible-script.js"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/web-accessible-script.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/web-accessible-script.js new file mode 100644 index 0000000000..a26c4cc91c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/redirect-to-android-resource/web-accessible-script.js @@ -0,0 +1,3 @@ +"use strict"; + +document.body.textContent += ",extension-was-here"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/background.js new file mode 100644 index 0000000000..f8ecef0215 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/background.js @@ -0,0 +1,16 @@ +browser.tabs.onActivated.addListener(async tabChange => { + const activeTabs = await browser.tabs.query({ active: true }); + const currentWindow = await browser.tabs.query({ + currentWindow: true, + active: true, + }); + + if ( + activeTabs.length === 1 && + activeTabs[0].id == tabChange.tabId && + currentWindow.length === 1 && + currentWindow[0].id === tabChange.tabId + ) { + browser.tabs.remove(tabChange.tabId); + } +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/manifest.json new file mode 100644 index 0000000000..784215634d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove-2/manifest.json @@ -0,0 +1,15 @@ +{ + "browser_specific_settings": { + "gecko": { + "id": "set-tab-active-2@tests.mozilla.org" + } + }, + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Removes the activated Tab.", + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/background.js new file mode 100644 index 0000000000..f8ecef0215 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/background.js @@ -0,0 +1,16 @@ +browser.tabs.onActivated.addListener(async tabChange => { + const activeTabs = await browser.tabs.query({ active: true }); + const currentWindow = await browser.tabs.query({ + currentWindow: true, + active: true, + }); + + if ( + activeTabs.length === 1 && + activeTabs[0].id == tabChange.tabId && + currentWindow.length === 1 && + currentWindow[0].id === tabChange.tabId + ) { + browser.tabs.remove(tabChange.tabId); + } +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/manifest.json new file mode 100644 index 0000000000..03c3514bb0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-activate-remove/manifest.json @@ -0,0 +1,15 @@ +{ + "browser_specific_settings": { + "gecko": { + "id": "set-tab-active@tests.mozilla.org" + } + }, + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Removes the activated Tab.", + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/background.js new file mode 100644 index 0000000000..8182b6a4f8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/background.js @@ -0,0 +1,4 @@ +browser.tabs.create({ + url: "https://www.mozilla.org/en-US/", + cookieStoreId: "firefox-container-1", +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/manifest.json new file mode 100644 index 0000000000..2746155adf --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-2/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Creates a tab with a contextual identity.", + "browser_specific_settings": { + "gecko": { + "id": "tabs-create-2@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs", "cookies"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/background.js new file mode 100644 index 0000000000..a1f55a3a4f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/background.js @@ -0,0 +1,3 @@ +browser.tabs.create({}).then(tab => { + browser.tabs.remove(tab.id); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/manifest.json new file mode 100644 index 0000000000..10b2f454e7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create-remove/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Creates and removes a tab.", + "browser_specific_settings": { + "gecko": { + "id": "tabs-create-remove@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": [] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/background.js new file mode 100644 index 0000000000..6fbd381e61 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/background.js @@ -0,0 +1 @@ +browser.tabs.create({ url: "https://www.mozilla.org/en-US/" }); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/manifest.json new file mode 100644 index 0000000000..517ddd0189 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-create/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Creates a tab.", + "browser_specific_settings": { + "gecko": { + "id": "tabs-create@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/background.js new file mode 100644 index 0000000000..c6ec7aee33 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/background.js @@ -0,0 +1,3 @@ +browser.tabs.query({ url: "*://*/*?tabToClose" }).then(([tab]) => { + browser.tabs.remove(tab.id); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/manifest.json new file mode 100644 index 0000000000..559512eec5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/tabs-remove/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "messaging", + "version": "1.0", + "description": "Removes an existing tab.", + "browser_specific_settings": { + "gecko": { + "id": "tabs-remove@tests.mozilla.org" + } + }, + "background": { + "scripts": ["background.js"] + }, + "permissions": ["tabs"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportChild.sys.mjs b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportChild.sys.mjs new file mode 100644 index 0000000000..6dd3e8eed4 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportChild.sys.mjs @@ -0,0 +1,83 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { GeckoViewActorChild } from "resource://gre/modules/GeckoViewActorChild.sys.mjs"; + +export class TestSupportChild extends GeckoViewActorChild { + receiveMessage(aMsg) { + debug`receiveMessage: ${aMsg.name}`; + + switch (aMsg.name) { + case "FlushApzRepaints": + return new Promise(resolve => { + const repaintDone = () => { + debug`APZ flush done`; + Services.obs.removeObserver(repaintDone, "apz-repaints-flushed"); + resolve(); + }; + Services.obs.addObserver(repaintDone, "apz-repaints-flushed"); + if (this.contentWindow.windowUtils.flushApzRepaints()) { + debug`Flushed APZ repaints, waiting for callback...`; + } else { + debug`Flushing APZ repaints was a no-op, triggering callback directly...`; + repaintDone(); + } + }); + case "PromiseAllPaintsDone": + return new Promise(resolve => { + const window = this.contentWindow; + const utils = window.windowUtils; + + function waitForPaints() { + // Wait until paint suppression has ended + if (utils.paintingSuppressed) { + dump`waiting for paint suppression to end...`; + window.setTimeout(waitForPaints, 0); + return; + } + + if (utils.isMozAfterPaintPending) { + dump`waiting for paint...`; + window.addEventListener("MozAfterPaint", waitForPaints, { + once: true, + }); + return; + } + resolve(); + } + waitForPaints(); + }); + case "GetLinkColor": { + const { selector } = aMsg.data; + const element = this.document.querySelector(selector); + if (!element) { + throw new Error("No element for " + selector); + } + const color = + this.contentWindow.windowUtils.getVisitedDependentComputedStyle( + element, + "", + "color" + ); + return color; + } + case "SetResolutionAndScaleTo": { + return new Promise(resolve => { + const window = this.contentWindow; + const { resolution } = aMsg.data; + window.visualViewport.addEventListener("resize", () => resolve(), { + once: true, + }); + window.windowUtils.setResolutionAndScaleTo(resolution); + }); + } + case "WaitForContentTransformsReceived": { + return this.contentWindow.docShell.browserChild.contentTransformsReceived(); + } + } + return null; + } +} + +const { debug } = TestSupportChild.initLogging("GeckoViewTestSupport"); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportProcessChild.sys.mjs b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportProcessChild.sys.mjs new file mode 100644 index 0000000000..0684ef0967 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/TestSupportProcessChild.sys.mjs @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { GeckoViewUtils } from "resource://gre/modules/GeckoViewUtils.sys.mjs"; + +const ProcessTools = Cc["@mozilla.org/processtools-service;1"].getService( + Ci.nsIProcessToolsService +); + +export class TestSupportProcessChild extends JSProcessActorChild { + receiveMessage(aMsg) { + debug`receiveMessage: ${aMsg.name}`; + + switch (aMsg.name) { + case "KillContentProcess": + ProcessTools.kill(Services.appinfo.processID); + } + } +} + +const { debug } = GeckoViewUtils.initLogging("TestSupportProcess[C]"); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/background.js new file mode 100644 index 0000000000..181764859a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/background.js @@ -0,0 +1,127 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const port = browser.runtime.connectNative("browser"); + +const APIS = { + AddHistogram({ id, value }) { + browser.test.addHistogram(id, value); + }, + Eval({ code }) { + // eslint-disable-next-line no-eval + return eval(`(async () => { + ${code} + })()`); + }, + SetScalar({ id, value }) { + browser.test.setScalar(id, value); + }, + GetRequestedLocales() { + return browser.test.getRequestedLocales(); + }, + GetLinkColor({ tab, selector }) { + return browser.test.getLinkColor(tab.id, selector); + }, + GetPidForTab({ tab }) { + return browser.test.getPidForTab(tab.id); + }, + WaitForContentTransformsReceived({ tab }) { + return browser.test.waitForContentTransformsReceived(tab.id); + }, + GetProfilePath() { + return browser.test.getProfilePath(); + }, + GetAllBrowserPids() { + return browser.test.getAllBrowserPids(); + }, + KillContentProcess({ pid }) { + return browser.test.killContentProcess(pid); + }, + GetPrefs({ prefs }) { + return browser.test.getPrefs(prefs); + }, + GetActive({ tab }) { + return browser.test.getActive(tab.id); + }, + RemoveAllCertOverrides() { + browser.test.removeAllCertOverrides(); + }, + RestorePrefs({ oldPrefs }) { + return browser.test.restorePrefs(oldPrefs); + }, + SetPrefs({ oldPrefs, newPrefs }) { + return browser.test.setPrefs(oldPrefs, newPrefs); + }, + SetResolutionAndScaleTo({ tab, resolution }) { + return browser.test.setResolutionAndScaleTo(tab.id, resolution); + }, + FlushApzRepaints({ tab }) { + return browser.test.flushApzRepaints(tab.id); + }, + PromiseAllPaintsDone({ tab }) { + return browser.test.promiseAllPaintsDone(tab.id); + }, + UsingGpuProcess() { + return browser.test.usingGpuProcess(); + }, + KillGpuProcess() { + return browser.test.killGpuProcess(); + }, + CrashGpuProcess() { + return browser.test.crashGpuProcess(); + }, + ClearHSTSState() { + return browser.test.clearHSTSState(); + }, + TriggerCookieBannerDetected({ tab }) { + return browser.test.triggerCookieBannerDetected(tab.id); + }, + TriggerCookieBannerHandled({ tab }) { + return browser.test.triggerCookieBannerHandled(tab.id); + }, + TriggerTranslationsOffer({ tab }) { + return browser.test.triggerTranslationsOffer(tab.id); + }, + TriggerLanguageStateChange({ tab, languageState }) { + return browser.test.triggerLanguageStateChange(tab.id, languageState); + }, +}; + +port.onMessage.addListener(async message => { + const impl = APIS[message.type]; + apiCall(message, impl); +}); + +browser.runtime.onConnect.addListener(contentPort => { + contentPort.onMessage.addListener(message => { + message.args.tab = contentPort.sender.tab; + + const impl = APIS[message.type]; + apiCall(message, impl); + }); +}); + +function apiCall(message, impl) { + const { id, args } = message; + try { + sendResponse(id, impl(args)); + } catch (error) { + sendResponse(id, Promise.reject(error)); + } +} + +function sendResponse(id, response) { + Promise.resolve(response).then( + value => sendSyncResponse(id, value), + reason => sendSyncResponse(id, null, reason) + ); +} + +function sendSyncResponse(id, response, exception) { + port.postMessage({ + id, + response: JSON.stringify(response), + exception: exception && exception.toString(), + }); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/manifest.json new file mode 100644 index 0000000000..fea5add0de --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/manifest.json @@ -0,0 +1,42 @@ +{ + "manifest_version": 2, + "name": "Test support", + "version": "1.0", + "description": "Helper script for GeckoView tests", + "browser_specific_settings": { + "gecko": { + "id": "test-support@tests.mozilla.org" + } + }, + "content_scripts": [ + { + "matches": [""], + "match_about_blank": true, + "js": ["test-support.js"], + "run_at": "document_start" + } + ], + "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';", + "background": { + "scripts": ["background.js"] + }, + "experiment_apis": { + "test": { + "schema": "test-schema.json", + "parent": { + "scopes": ["addon_parent"], + "script": "test-api.js", + "events": ["startup"], + "paths": [["test"]] + } + } + }, + "options_ui": { + "page": "dummy.html" + }, + "permissions": [ + "geckoViewAddons", + "nativeMessaging", + "nativeMessagingFromContent" + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js new file mode 100644 index 0000000000..1868d25c84 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js @@ -0,0 +1,256 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/* globals Services */ + +const { E10SUtils } = ChromeUtils.importESModule( + "resource://gre/modules/E10SUtils.sys.mjs" +); +const { Preferences } = ChromeUtils.importESModule( + "resource://gre/modules/Preferences.sys.mjs" +); + +// eslint-disable-next-line mozilla/reject-importGlobalProperties +Cu.importGlobalProperties(["PathUtils"]); + +this.test = class extends ExtensionAPI { + onStartup() { + ChromeUtils.registerWindowActor("TestSupport", { + child: { + esModuleURI: + "resource://android/assets/web_extensions/test-support/TestSupportChild.sys.mjs", + }, + allFrames: true, + }); + ChromeUtils.registerProcessActor("TestSupportProcess", { + child: { + esModuleURI: + "resource://android/assets/web_extensions/test-support/TestSupportProcessChild.sys.mjs", + }, + }); + } + + onShutdown(isAppShutdown) { + if (isAppShutdown) { + return; + } + ChromeUtils.unregisterWindowActor("TestSupport"); + ChromeUtils.unregisterProcessActor("TestSupportProcess"); + } + + getAPI(context) { + /** + * Helper function for getting window or process actors. + * + * @param tabId - id of the tab; required + * @param actorName - a string; the name of the actor + * Default: "TestSupport" which is our test framework actor + * (you can still pass the second parameter when getting the TestSupport actor, for readability) + * + * @returns actor + */ + function getActorForTab(tabId, actorName = "TestSupport") { + const tab = context.extension.tabManager.get(tabId); + const { browsingContext } = tab.browser; + return browsingContext.currentWindowGlobal.getActor(actorName); + } + + return { + test: { + /* Set prefs and returns set of saved prefs */ + async setPrefs(oldPrefs, newPrefs) { + // Save old prefs + Object.assign( + oldPrefs, + ...Object.keys(newPrefs) + .filter(key => !(key in oldPrefs)) + .map(key => ({ [key]: Preferences.get(key, null) })) + ); + + // Set new prefs + Preferences.set(newPrefs); + return oldPrefs; + }, + + /* Restore prefs to old value. */ + async restorePrefs(oldPrefs) { + for (const [name, value] of Object.entries(oldPrefs)) { + if (value === null) { + Preferences.reset(name); + } else { + Preferences.set(name, value); + } + } + }, + + /* Get pref values. */ + async getPrefs(prefs) { + return Preferences.get(prefs); + }, + + /* Gets link color for a given selector. */ + async getLinkColor(tabId, selector) { + return getActorForTab(tabId, "TestSupport").sendQuery( + "GetLinkColor", + { selector } + ); + }, + + async getRequestedLocales() { + return Services.locale.requestedLocales; + }, + + async getPidForTab(tabId) { + const tab = context.extension.tabManager.get(tabId); + const pids = E10SUtils.getBrowserPids(tab.browser); + return pids[0]; + }, + + async waitForContentTransformsReceived(tabId) { + return getActorForTab(tabId).sendQuery( + "WaitForContentTransformsReceived" + ); + }, + + async getAllBrowserPids() { + const pids = []; + const processes = ChromeUtils.getAllDOMProcesses(); + for (const process of processes) { + if (process.remoteType && process.remoteType.startsWith("web")) { + pids.push(process.osPid); + } + } + return pids; + }, + + async killContentProcess(pid) { + const procs = ChromeUtils.getAllDOMProcesses(); + for (const proc of procs) { + if (pid === proc.osPid) { + proc + .getActor("TestSupportProcess") + .sendAsyncMessage("KillContentProcess"); + } + } + }, + + async addHistogram(id, value) { + return Services.telemetry.getHistogramById(id).add(value); + }, + + removeAllCertOverrides() { + const overrideService = Cc[ + "@mozilla.org/security/certoverride;1" + ].getService(Ci.nsICertOverrideService); + overrideService.clearAllOverrides(); + }, + + async setScalar(id, value) { + return Services.telemetry.scalarSet(id, value); + }, + + async setResolutionAndScaleTo(tabId, resolution) { + return getActorForTab(tabId, "TestSupport").sendQuery( + "SetResolutionAndScaleTo", + { + resolution, + } + ); + }, + + async getActive(tabId) { + const tab = context.extension.tabManager.get(tabId); + return tab.browser.docShellIsActive; + }, + + async getProfilePath() { + return PathUtils.profileDir; + }, + + async flushApzRepaints(tabId) { + // TODO: Note that `waitUntilApzStable` in apz_test_utils.js does + // flush APZ repaints in the parent process (i.e. calling + // nsIDOMWindowUtils.flushApzRepaints for the parent process) before + // flushApzRepaints is called for the target content document, if we + // still meet intermittent failures, we might want to do it here as + // well. + await getActorForTab(tabId, "TestSupport").sendQuery( + "FlushApzRepaints" + ); + }, + + async promiseAllPaintsDone(tabId) { + await getActorForTab(tabId, "TestSupport").sendQuery( + "PromiseAllPaintsDone" + ); + }, + + async usingGpuProcess() { + const gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService( + Ci.nsIGfxInfo + ); + return gfxInfo.usingGPUProcess; + }, + + async killGpuProcess() { + const gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService( + Ci.nsIGfxInfo + ); + return gfxInfo.killGPUProcessForTests(); + }, + + async crashGpuProcess() { + const gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService( + Ci.nsIGfxInfo + ); + return gfxInfo.crashGPUProcessForTests(); + }, + + async clearHSTSState() { + const sss = Cc["@mozilla.org/ssservice;1"].getService( + Ci.nsISiteSecurityService + ); + return sss.clearAll(); + }, + + async triggerCookieBannerDetected(tabId) { + const actor = getActorForTab(tabId, "CookieBanner"); + return actor.receiveMessage({ + name: "CookieBanner::DetectedBanner", + }); + }, + + async triggerCookieBannerHandled(tabId) { + const actor = getActorForTab(tabId, "CookieBanner"); + return actor.receiveMessage({ + name: "CookieBanner::HandledBanner", + }); + }, + + async triggerTranslationsOffer(tabId) { + const browser = context.extension.tabManager.get(tabId).browser; + const { CustomEvent } = browser.ownerGlobal; + return browser.dispatchEvent( + new CustomEvent("TranslationsParent:OfferTranslation", { + bubbles: true, + }) + ); + }, + + async triggerLanguageStateChange(tabId, languageState) { + const browser = context.extension.tabManager.get(tabId).browser; + const { CustomEvent } = browser.ownerGlobal; + return browser.dispatchEvent( + new CustomEvent("TranslationsParent:LanguageState", { + bubbles: true, + detail: languageState, + }) + ); + }, + }, + }; + } +}; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-schema.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-schema.json new file mode 100644 index 0000000000..94e4b3bd9b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-schema.json @@ -0,0 +1,308 @@ +[ + { + "namespace": "test", + "description": "Additional APIs for test support in GeckoView.", + "functions": [ + { + "name": "setPrefs", + "type": "function", + "async": true, + "description": "Set prefs and return a set of saved prefs", + "parameters": [ + { + "name": "oldPrefs", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "any" } + }, + { + "name": "newPrefs", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "any" } + } + ] + }, + { + "name": "restorePrefs", + "type": "function", + "async": true, + "description": "Restore prefs to old value", + "parameters": [ + { + "type": "any", + "name": "oldPrefs" + } + ] + }, + { + "name": "getPrefs", + "type": "function", + "async": true, + "description": "Get pref values.", + "parameters": [ + { + "name": "prefs", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "name": "getLinkColor", + "type": "function", + "async": true, + "description": "Get resolved color for the link resolved by a given selector.", + "parameters": [ + { + "type": "number", + "name": "tabId" + }, + { + "type": "string", + "name": "selector" + } + ] + }, + { + "name": "getRequestedLocales", + "type": "function", + "async": true, + "description": "Gets the requested locales.", + "parameters": [] + }, + { + "name": "addHistogram", + "type": "function", + "async": true, + "description": "Add a sample with the given value to the histogram with the given id.", + "parameters": [ + { + "type": "string", + "name": "id" + }, + { + "type": "any", + "name": "value" + } + ] + }, + { + "name": "removeAllCertOverrides", + "type": "function", + "async": true, + "description": "Revokes SSL certificate overrides.", + "parameters": [] + }, + { + "name": "setScalar", + "type": "function", + "async": true, + "description": "Set the given value to the scalar with the given id.", + "parameters": [ + { + "type": "string", + "name": "id" + }, + { + "type": "any", + "name": "value" + } + ] + }, + { + "name": "setResolutionAndScaleTo", + "type": "function", + "async": true, + "description": "Invokes nsIDOMWindowUtils.setResolutionAndScaleTo.", + "parameters": [ + { + "type": "number", + "name": "tabId" + }, + { + "type": "number", + "name": "resolution" + } + ] + }, + { + "name": "getActive", + "type": "function", + "async": true, + "description": "Returns true if the docShell is active for given tab.", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + { + "name": "getPidForTab", + "type": "function", + "async": true, + "description": "Gets the top-level pid belonging to tabId.", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + { + "name": "waitForContentTransformsReceived", + "type": "function", + "async": true, + "description": "If we want to test screen coordinates, we need to wait for the updated data which is what this function allows us to do", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + { + "name": "getAllBrowserPids", + "type": "function", + "async": true, + "description": "Gets the list of pids of the running browser processes", + "parameters": [] + }, + { + "name": "getProfilePath", + "type": "function", + "async": true, + "description": "Gets the path of the current profile", + "parameters": [] + }, + { + "name": "killContentProcess", + "type": "function", + "async": true, + "description": "Crash all content processes", + "parameters": [ + { + "type": "number", + "name": "pid" + } + ] + }, + { + "name": "flushApzRepaints", + "type": "function", + "async": true, + "description": "Invokes nsIDOMWindowUtils.flushApzRepaints for the document of the tabId.", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + { + "name": "promiseAllPaintsDone", + "type": "function", + "async": true, + "description": "A simplified version of promiseAllPaintsDone in paint_listeners.js.", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + { + "name": "usingGpuProcess", + "type": "function", + "async": true, + "description": "Returns true if Gecko is using a GPU process.", + "parameters": [] + }, + + { + "name": "killGpuProcess", + "type": "function", + "async": true, + "description": "Kills the GPU process cleanly without generating a crash report.", + "parameters": [] + }, + + { + "name": "crashGpuProcess", + "type": "function", + "async": true, + "description": "Causes the GPU process to crash.", + "parameters": [] + }, + + { + "name": "clearHSTSState", + "type": "function", + "async": true, + "description": "Clears the sites on the HSTS list.", + "parameters": [] + }, + + { + "name": "triggerCookieBannerDetected", + "type": "function", + "async": true, + "description": "Simulates a cookie banner detection", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + + { + "name": "triggerCookieBannerHandled", + "type": "function", + "async": true, + "description": "Simulates a cookie banner handling", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + + { + "name": "triggerTranslationsOffer", + "type": "function", + "async": true, + "description": "Simulates offering a translation.", + "parameters": [ + { + "type": "number", + "name": "tabId" + } + ] + }, + + { + "name": "triggerLanguageStateChange", + "type": "function", + "async": true, + "description": "Simulates expecting a translation.", + "parameters": [ + { + "type": "number", + "name": "tabId" + }, + { + "name": "languageState", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "any" } + } + ] + } + ] + } +] diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-support.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-support.js new file mode 100644 index 0000000000..18e047ca1a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-support.js @@ -0,0 +1,60 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +let backgroundPort = null; +let nativePort = null; + +function connectNativePort() { + if (nativePort) { + return; + } + + backgroundPort = browser.runtime.connect(); + nativePort = browser.runtime.connectNative("browser"); + + nativePort.onMessage.addListener(message => { + if (message.type) { + // This is a session-specific webExtensionApiCall. + // Forward to the background script. + backgroundPort.postMessage(message); + } else if (message.eval) { + try { + // Using eval here is the whole point of this WebExtension so we can + // safely ignore the eslint warning. + const response = window.eval(message.eval); // eslint-disable-line no-eval + sendResponse(message.id, response); + } catch (ex) { + sendSyncResponse(message.id, null, ex); + } + } + }); + + function sendResponse(id, response, exception) { + Promise.resolve(response).then( + value => sendSyncResponse(id, value), + reason => sendSyncResponse(id, null, reason) + ); + } + + function sendSyncResponse(id, response, exception) { + nativePort.postMessage({ + id, + response: JSON.stringify(response), + exception: exception && exception.toString(), + }); + } +} + +function disconnectNativePort() { + backgroundPort?.disconnect(); + nativePort?.disconnect(); + backgroundPort = null; + nativePort = null; +} + +window.addEventListener("pageshow", connectNativePort); +window.addEventListener("pagehide", disconnectNativePort); + +// If loading error page, pageshow mightn't fired. +connectNativePort(); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/borderify.js new file mode 100644 index 0000000000..9c3728b381 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid red"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/manifest.json new file mode 100644 index 0000000000..8e54cc4586 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-1/manifest.json @@ -0,0 +1,18 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update@example.com", + "update_url": "https://example.org/tests/junit/update_manifest.json" + } + }, + "version": "1.0", + "description": "Adds a red border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/borderify.js new file mode 100644 index 0000000000..3529928d82 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid blue"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/manifest.json new file mode 100644 index 0000000000..19570ea5e5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-2/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update@example.com" + } + }, + "version": "2.0", + "description": "Adds a blue border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/background.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/background.js new file mode 100644 index 0000000000..a301506ca7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/background.js @@ -0,0 +1,3 @@ +browser.runtime.onUpdateAvailable.addListener(details => { + // Do nothing, this is just here to prevent auto update. +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/borderify.js new file mode 100644 index 0000000000..9c3728b381 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid red"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/manifest.json new file mode 100644 index 0000000000..5011e1ea05 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-1/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update-postpone@example.com", + "update_url": "https://example.org/tests/junit/update_manifest.json" + } + }, + "background": { + "scripts": ["background.js"] + }, + "version": "1.0", + "description": "Adds a red border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/borderify.js new file mode 100644 index 0000000000..3529928d82 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid blue"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/manifest.json new file mode 100644 index 0000000000..720d9ef898 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-postpone-2/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update-postpone@example.com" + } + }, + "version": "2.0", + "description": "Adds a blue border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/borderify.js new file mode 100644 index 0000000000..9c3728b381 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid red"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/manifest.json new file mode 100644 index 0000000000..71b6a1eab9 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-1/manifest.json @@ -0,0 +1,18 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update-with-perms@example.com", + "update_url": "https://example.org/tests/junit/update_manifest.json" + } + }, + "version": "1.0", + "description": "Adds a red border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/borderify.js b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/borderify.js new file mode 100644 index 0000000000..3529928d82 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/borderify.js @@ -0,0 +1 @@ +document.body.style.border = "5px solid blue"; diff --git a/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/manifest.json b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/manifest.json new file mode 100644 index 0000000000..9571bdabb2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/update-with-perms-2/manifest.json @@ -0,0 +1,18 @@ +{ + "manifest_version": 2, + "name": "update", + "browser_specific_settings": { + "gecko": { + "id": "update-with-perms@example.com" + } + }, + "version": "2.0", + "description": "Adds a blue border to all webpages matching example.com.", + "content_scripts": [ + { + "matches": ["*://*.example.com/*"], + "js": ["borderify.js"] + } + ], + "permissions": ["tabs"] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-aria-comboboxes.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-aria-comboboxes.html new file mode 100644 index 0000000000..8816879c1a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-aria-comboboxes.html @@ -0,0 +1,11 @@ + + + + + +
+
+ +
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-checkbox.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-checkbox.html new file mode 100644 index 0000000000..a45cfed92b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-checkbox.html @@ -0,0 +1,12 @@ + + + + + + + +
description
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-clipboard.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-clipboard.html new file mode 100644 index 0000000000..c33b48f4e5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-clipboard.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-collection.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-collection.html new file mode 100644 index 0000000000..865594ae5b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-collection.html @@ -0,0 +1,21 @@ + + + + + + +
    +
  • One
  • +
  • Two
  • +
+
    +
  • + 1 +
      +
    • 1.1
    • +
    • 1.2
    • +
    +
  • +
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-expandable.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-expandable.html new file mode 100644 index 0000000000..8b416cf882 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-expandable.html @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-headings.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-headings.html new file mode 100644 index 0000000000..280bbd89d7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-headings.html @@ -0,0 +1,11 @@ + + + + + + preamble +

Fried cheese

with club sauce.

+

Popcorn shrimp

+

Chicken fingers

with spicy club sauce.

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-links.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-links.html new file mode 100644 index 0000000000..a108925dc1 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-links.html @@ -0,0 +1,12 @@ + + + + + + a with href + a with no attributes + a with name + a with onclick + span with role link + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-atomic.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-atomic.html new file mode 100644 index 0000000000..85f9f6ccd2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-atomic.html @@ -0,0 +1,12 @@ + + + + + + +
+ The time is +

3pm

+
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-descendant.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-descendant.html new file mode 100644 index 0000000000..82d88613f0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-descendant.html @@ -0,0 +1,9 @@ + + + + + + +

I will be shown

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image-labeled-by.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image-labeled-by.html new file mode 100644 index 0000000000..5b91f1f6c2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image-labeled-by.html @@ -0,0 +1,15 @@ + + + + + + + + Hello + Goodbye + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image.html new file mode 100644 index 0000000000..da05b33c9a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region-image.html @@ -0,0 +1,15 @@ + + + + + + +
+ This picture is + happy +
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region.html new file mode 100644 index 0000000000..c73fb91966 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-live-region.html @@ -0,0 +1,9 @@ + + + + + + +
+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-local-iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-local-iframe.html new file mode 100644 index 0000000000..0aff253395 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-local-iframe.html @@ -0,0 +1,21 @@ + + + + + + + + Some stuff + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-move-caret-accessibility-focus.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-move-caret-accessibility-focus.html new file mode 100644 index 0000000000..d9d1597991 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-move-caret-accessibility-focus.html @@ -0,0 +1,9 @@ + + + + + + +

Hello sweet, sweet world

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-mutation.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-mutation.html new file mode 100644 index 0000000000..5c9c68aca0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-mutation.html @@ -0,0 +1,9 @@ + + + + + + +

I will be shown

+ + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-range.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-range.html new file mode 100644 index 0000000000..70ef76e624 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-range.html @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-remote-iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-remote-iframe.html new file mode 100644 index 0000000000..7e3e5da1ca --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-remote-iframe.html @@ -0,0 +1,24 @@ + + + + + + + + Some stuff + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-scroll.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-scroll.html new file mode 100644 index 0000000000..912aab9143 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-scroll.html @@ -0,0 +1,10 @@ + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. +

+ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-selectable.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-selectable.html new file mode 100644 index 0000000000..f30951ff83 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-selectable.html @@ -0,0 +1,22 @@ + + + + + + +
    +
  • + 1 +
  • +
  • 2
  • +
+
  • + outside selectable +
  • + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-text-entry-node.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-text-entry-node.html new file mode 100644 index 0000000000..002efc9f14 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-text-entry-node.html @@ -0,0 +1,11 @@ + + + + + + + +
    description
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-tree.html b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-tree.html new file mode 100644 index 0000000000..81ab105c7d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/accessibility/test-tree.html @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/address_form.html b/mobile/android/geckoview/src/androidTest/assets/www/address_form.html new file mode 100644 index 0000000000..d247c5ce79 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/address_form.html @@ -0,0 +1,21 @@ + + + + Address form + + +
    + + + + + + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/audio/owl.mp3 b/mobile/android/geckoview/src/androidTest/assets/www/audio/owl.mp3 new file mode 100644 index 0000000000..9fafa32f93 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/audio/owl.mp3 differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/autoplay.html b/mobile/android/geckoview/src/androidTest/assets/www/autoplay.html new file mode 100644 index 0000000000..24cbf474bd --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/autoplay.html @@ -0,0 +1,11 @@ + + + + WEBM Video + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/badVideoPath.html b/mobile/android/geckoview/src/androidTest/assets/www/badVideoPath.html new file mode 100644 index 0000000000..d9b34843fd --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/badVideoPath.html @@ -0,0 +1,11 @@ + + + + Bad Video Path + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/beforeunload.html b/mobile/android/geckoview/src/androidTest/assets/www/beforeunload.html new file mode 100644 index 0000000000..d521afe532 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/beforeunload.html @@ -0,0 +1,15 @@ + + + + + + + Click Me + Click Me + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/cc_form.html b/mobile/android/geckoview/src/androidTest/assets/www/cc_form.html new file mode 100644 index 0000000000..7b3ea2a1bb --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/cc_form.html @@ -0,0 +1,22 @@ + + + + Form Autofill Test: Credit Card + + +
    + + + + + +
    + +
    + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/clickToReload.html b/mobile/android/geckoview/src/androidTest/assets/www/clickToReload.html new file mode 100644 index 0000000000..47bdceccee --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/clickToReload.html @@ -0,0 +1,10 @@ + + + + Hello, world! + + + +

    Hello, world!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/clipboard_read.html b/mobile/android/geckoview/src/androidTest/assets/www/clipboard_read.html new file mode 100644 index 0000000000..19a034a23d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/clipboard_read.html @@ -0,0 +1,22 @@ + + + + Hello, world! + + + +

    Hello, world!

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/color_grid.html b/mobile/android/geckoview/src/androidTest/assets/www/color_grid.html new file mode 100644 index 0000000000..ebc989acdb --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/color_grid.html @@ -0,0 +1,40 @@ + + + + + Color Grid + + + + +
    +
    +
    +
    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/color_orange_background.html b/mobile/android/geckoview/src/androidTest/assets/www/color_orange_background.html new file mode 100644 index 0000000000..8a682d79a7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/color_orange_background.html @@ -0,0 +1,29 @@ + + + + + Orange Print Background + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/colors.html b/mobile/android/geckoview/src/androidTest/assets/www/colors.html new file mode 100644 index 0000000000..b00da3ed9c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/colors.html @@ -0,0 +1,23 @@ + + + + Colours + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_audio.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_audio.html new file mode 100644 index 0000000000..b26323a13e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_audio.html @@ -0,0 +1,20 @@ + + + + + Context Menu Test Audio + + + +
    + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_buffered.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_buffered.html new file mode 100644 index 0000000000..9849747a41 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_buffered.html @@ -0,0 +1,44 @@ + + + + + Context Menu Test Blob Buffered + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_full.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_full.html new file mode 100644 index 0000000000..5ebc2bddba --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_blob_full.html @@ -0,0 +1,22 @@ + + + + + Context Menu Test Blob + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image.html new file mode 100644 index 0000000000..9564f94628 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image.html @@ -0,0 +1,10 @@ + + + + + Context Menu Test Image + + + Test Image + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image_nested.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image_nested.html new file mode 100644 index 0000000000..99563d66f5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_image_nested.html @@ -0,0 +1,14 @@ + + + + + Context Menu Test Nested Image + + +
    +
    + Test Image +
    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_link.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_link.html new file mode 100644 index 0000000000..e5b0d0d316 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_link.html @@ -0,0 +1,15 @@ + + + + + Context Menu Test Link + + + + Hello World + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/context_menu_video.html b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_video.html new file mode 100644 index 0000000000..bca8e46afe --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/context_menu_video.html @@ -0,0 +1,12 @@ + + + + + Context Menu Test Video + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/data_uri.html b/mobile/android/geckoview/src/androidTest/assets/www/data_uri.html new file mode 100644 index 0000000000..638e4c754c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/data_uri.html @@ -0,0 +1,14 @@ + + + + Link with a giant data URI + + + Open small link + Open large link + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/dnd.html b/mobile/android/geckoview/src/androidTest/assets/www/dnd.html new file mode 100644 index 0000000000..0dc36b4f9a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/dnd.html @@ -0,0 +1,27 @@ + + + + + + + + +
    +
    + drop +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/download.html b/mobile/android/geckoview/src/androidTest/assets/www/download.html new file mode 100644 index 0000000000..4f06323dc6 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/download.html @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fedcm_accounts_endpoint.json b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_accounts_endpoint.json new file mode 100644 index 0000000000..5a8f6eeb30 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_accounts_endpoint.json @@ -0,0 +1,12 @@ +{ + "accounts": [ + { + "id": "$RANDOM_ID", + "given_name": "", + "name": " ", + "email": "demo", + "picture": "http://localhost:4245/assets/www/images/test.gif", + "approved_clients": ["fedcm_rp.html"] + } + ] +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_manifest.json b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_manifest.json new file mode 100644 index 0000000000..bc66100e6a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_manifest.json @@ -0,0 +1,18 @@ +{ + "accounts_endpoint": "fedcm_accounts_endpoint.json", + "client_metadata_endpoint": "fedcm_idp_metadata.json", + "id_assertion_endpoint": "fedcm_idtokens_endpoint.json", + "id_token_endpoint": "fedcm_idtokens_endpoint.json", + "revocation_endpoint": "revocation_endpoint", + "branding": { + "background_color": "0x6200ee", + "color": "0xffffff", + "icons": [ + { + "url": "http://localhost:4245/assets/www/images/test.gif", + "size": 256 + } + ], + "name": "Demo IDP" + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_metadata.json b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_metadata.json new file mode 100644 index 0000000000..db9b9deaf8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idp_metadata.json @@ -0,0 +1,4 @@ +{ + "privacy_policy_url": "privacy_policy", + "terms_of_service_url": "terms_of_service" +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idtokens_endpoint.json b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idtokens_endpoint.json new file mode 100644 index 0000000000..ba6edfe281 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_idtokens_endpoint.json @@ -0,0 +1,3 @@ +{ + "token": "token" +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fedcm_rp.html b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_rp.html new file mode 100644 index 0000000000..4d1fddee7f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fedcm_rp.html @@ -0,0 +1,8 @@ + + + + Hello, world! + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html b/mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html new file mode 100644 index 0000000000..b802bb335b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html @@ -0,0 +1,36 @@ + + + + + Fixed bottom element + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fixedpercent.html b/mobile/android/geckoview/src/androidTest/assets/www/fixedpercent.html new file mode 100644 index 0000000000..587df00473 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fixedpercent.html @@ -0,0 +1,25 @@ + + + + +
    diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fixedvh.html b/mobile/android/geckoview/src/androidTest/assets/www/fixedvh.html new file mode 100644 index 0000000000..fd6661c2cd --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fixedvh.html @@ -0,0 +1,25 @@ + + + + +
    diff --git a/mobile/android/geckoview/src/androidTest/assets/www/form_blank.html b/mobile/android/geckoview/src/androidTest/assets/www/form_blank.html new file mode 100644 index 0000000000..918cc4cb7a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/form_blank.html @@ -0,0 +1,20 @@ + + + + + Forms + + + +
    + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms.html b/mobile/android/geckoview/src/androidTest/assets/www/forms.html new file mode 100644 index 0000000000..06c2ed64db --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms.html @@ -0,0 +1,34 @@ + + + + Forms + + + +
    + + + + + + +
    + + + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms2.html b/mobile/android/geckoview/src/androidTest/assets/www/forms2.html new file mode 100644 index 0000000000..06ab5ec448 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms2.html @@ -0,0 +1,17 @@ + + + + Forms2 + + +
    +
    + + + + +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms2_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/forms2_iframe.html new file mode 100644 index 0000000000..849fa43271 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms2_iframe.html @@ -0,0 +1,16 @@ + + + + Forms2 iframe + + +
    +
    + + + + +
    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms3.html b/mobile/android/geckoview/src/androidTest/assets/www/forms3.html new file mode 100644 index 0000000000..91bceb3943 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms3.html @@ -0,0 +1,14 @@ + + + + Forms + + + +
    + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms4.html b/mobile/android/geckoview/src/androidTest/assets/www/forms4.html new file mode 100644 index 0000000000..3650635396 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms4.html @@ -0,0 +1,14 @@ + + + + Forms + + + +
    + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms5.html b/mobile/android/geckoview/src/androidTest/assets/www/forms5.html new file mode 100644 index 0000000000..b9da67f343 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms5.html @@ -0,0 +1,24 @@ + + + + Forms + + + +
    + + + + + + +
    + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete.html new file mode 100644 index 0000000000..81401a1d27 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete.html @@ -0,0 +1,16 @@ + + + + Forms + + + +
    + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete_iframe.html new file mode 100644 index 0000000000..11137531ba --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_autocomplete_iframe.html @@ -0,0 +1,15 @@ + + + + Forms + + + +
    + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_id_value.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_id_value.html new file mode 100644 index 0000000000..522dbc1600 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_id_value.html @@ -0,0 +1,12 @@ + + + + Forms ID Value + + + +
    + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html new file mode 100644 index 0000000000..2c0ef7dff5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html @@ -0,0 +1,58 @@ + + + + + Forms iframe + + + +
    + + + + + + +
    + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_xorigin.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_xorigin.html new file mode 100644 index 0000000000..ebd86c59a1 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_xorigin.html @@ -0,0 +1,77 @@ + + + + + Forms + + + +
    + + + + + + +
    + + + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/fullscreen.html b/mobile/android/geckoview/src/androidTest/assets/www/fullscreen.html new file mode 100644 index 0000000000..f7d4feb3a4 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/fullscreen.html @@ -0,0 +1,9 @@ + + + + Fullscreen + + +
    Fullscreen Div
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_container.html b/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_container.html new file mode 100644 index 0000000000..2ba4a89b54 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_container.html @@ -0,0 +1,58 @@ + + + + GetUserMedia from cross-origin iframe: the container document + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_iframe.html new file mode 100644 index 0000000000..3649167c25 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/getusermedia_xorigin_iframe.html @@ -0,0 +1,39 @@ + + + + GetUserMedia from cross-origin iframe: the iframe document + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/hello.html b/mobile/android/geckoview/src/androidTest/assets/www/hello.html new file mode 100644 index 0000000000..5ebd20f929 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/hello.html @@ -0,0 +1,10 @@ + + + + Hello, world! + + + +

    Hello, world!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/hello2.html b/mobile/android/geckoview/src/androidTest/assets/www/hello2.html new file mode 100644 index 0000000000..d03c2d5521 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/hello2.html @@ -0,0 +1,9 @@ + + + + Hello, world! Again! + + +

    Hello, world! Again!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/helloPDFWorld.pdf b/mobile/android/geckoview/src/androidTest/assets/www/helloPDFWorld.pdf new file mode 100755 index 0000000000..0f429e1a90 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/helloPDFWorld.pdf differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/hsts_header.sjs b/mobile/android/geckoview/src/androidTest/assets/www/hsts_header.sjs new file mode 100644 index 0000000000..e53ad908fa --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/hsts_header.sjs @@ -0,0 +1,6 @@ +function handleRequest(request, response) { + response.setHeader( + "Strict-Transport-Security", + "max-age=60; includeSubDomains" + ); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/hungScript.html b/mobile/android/geckoview/src/androidTest/assets/www/hungScript.html new file mode 100644 index 0000000000..6b56f4e2e7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/hungScript.html @@ -0,0 +1,16 @@ + + + + Hung Script + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_no_scrollable.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_no_scrollable.html new file mode 100644 index 0000000000..3e7bd5cdd0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_no_scrollable.html @@ -0,0 +1,60 @@ + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_scrollable.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_scrollable.html new file mode 100644 index 0000000000..e7517c5f12 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_100_percent_height_scrollable.html @@ -0,0 +1,60 @@ + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_no_scrollable.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_no_scrollable.html new file mode 100644 index 0000000000..9766f41b7f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_no_scrollable.html @@ -0,0 +1,55 @@ + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_scrollable.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_scrollable.html new file mode 100644 index 0000000000..ca356958df --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_98vh_scrollable.html @@ -0,0 +1,55 @@ + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_hello.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_hello.html new file mode 100644 index 0000000000..ee4962a2b7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_hello.html @@ -0,0 +1,10 @@ + + + + Hello, world! + + +

    Hello, world! From Top Level.

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_http_only.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_http_only.html new file mode 100644 index 0000000000..8f94d6c86d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_http_only.html @@ -0,0 +1,14 @@ + + + + + + + Some stuff + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_automation.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_automation.html new file mode 100644 index 0000000000..c708687a3e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_automation.html @@ -0,0 +1,12 @@ + + + + + + + Some stuff + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_local.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_local.html new file mode 100644 index 0000000000..eb109536f0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_redirect_local.html @@ -0,0 +1,10 @@ + + + + + + + Some stuff + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/iframe_unknown_protocol.html b/mobile/android/geckoview/src/androidTest/assets/www/iframe_unknown_protocol.html new file mode 100644 index 0000000000..81fb616b60 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/iframe_unknown_protocol.html @@ -0,0 +1,10 @@ + + + + Hello, world! + + +

    Hello, world! From Top Level.

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/images/test.gif b/mobile/android/geckoview/src/androidTest/assets/www/images/test.gif new file mode 100644 index 0000000000..ba3b541c31 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/images/test.gif differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/inputs.html b/mobile/android/geckoview/src/androidTest/assets/www/inputs.html new file mode 100644 index 0000000000..554c6c8143 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/inputs.html @@ -0,0 +1,66 @@ + + + + Inputs + + + +
    lorem
    + + +
    sit
    + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/links.html b/mobile/android/geckoview/src/androidTest/assets/www/links.html new file mode 100644 index 0000000000..186426b0e2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/links.html @@ -0,0 +1,28 @@ + + + + Links + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/loremIpsum.html b/mobile/android/geckoview/src/androidTest/assets/www/loremIpsum.html new file mode 100644 index 0000000000..e772f605f0 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/loremIpsum.html @@ -0,0 +1,17 @@ + + + + Lorem ipsum + + +

    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat + cupidatat non proident, sunt in culpa qui officia deserunt mollit + anim id est laborum. +

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/manifest.webmanifest b/mobile/android/geckoview/src/androidTest/assets/www/manifest.webmanifest new file mode 100644 index 0000000000..5528465ba2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/manifest.webmanifest @@ -0,0 +1,17 @@ +{ + "name": "App", + "short_name": "app", + "start_url": "./start/index.html", + "display": "standalone", + "background_color": "#c0ffeeee", + "theme_color": "cadetblue", + "icons": [{ + "src": "images/test.gif", + "sizes": "192x192", + "type": "image/gif" + }], + "related_applications": [{ + "platform": "play", + "url": "https://play.google.com/store/apps/details?id=my.first.webapp" + }] +} \ No newline at end of file diff --git a/mobile/android/geckoview/src/androidTest/assets/www/media_session_default1.html b/mobile/android/geckoview/src/androidTest/assets/www/media_session_default1.html new file mode 100644 index 0000000000..3d6554012b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/media_session_default1.html @@ -0,0 +1,15 @@ + + + MediaSessionDefaultTest1 + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/media_session_dom1.html b/mobile/android/geckoview/src/androidTest/assets/www/media_session_dom1.html new file mode 100644 index 0000000000..8fa9584428 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/media_session_dom1.html @@ -0,0 +1,109 @@ + + + MediaSessionDOMTest1 + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/metatags.html b/mobile/android/geckoview/src/androidTest/assets/www/metatags.html new file mode 100644 index 0000000000..946c9faf27 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/metatags.html @@ -0,0 +1,19 @@ + + + + + MetaTags + + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/mouseToReload.html b/mobile/android/geckoview/src/androidTest/assets/www/mouseToReload.html new file mode 100644 index 0000000000..4ef3626119 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/mouseToReload.html @@ -0,0 +1,10 @@ + + + + Hello, world! + + + +

    Hello, world!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/mp4.html b/mobile/android/geckoview/src/androidTest/assets/www/mp4.html new file mode 100644 index 0000000000..09909fac69 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/mp4.html @@ -0,0 +1,11 @@ + + + + MP4 Video + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/newSession.html b/mobile/android/geckoview/src/androidTest/assets/www/newSession.html new file mode 100644 index 0000000000..b92657430c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/newSession.html @@ -0,0 +1,22 @@ + + + + Hello, world! + + + target="_blank" + rel="noopener" + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/newSession_child.html b/mobile/android/geckoview/src/androidTest/assets/www/newSession_child.html new file mode 100644 index 0000000000..28fd019804 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/newSession_child.html @@ -0,0 +1,9 @@ + + + + Hello, world! + + +

    I'm the child

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/no-meta-viewport.html b/mobile/android/geckoview/src/androidTest/assets/www/no-meta-viewport.html new file mode 100644 index 0000000000..8f1cb8fa80 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/no-meta-viewport.html @@ -0,0 +1,5 @@ + + + +

    Nothing here

    + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/ogg.html b/mobile/android/geckoview/src/androidTest/assets/www/ogg.html new file mode 100644 index 0000000000..dd478d3b3f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/ogg.html @@ -0,0 +1,11 @@ + + + + OGG Video + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/orange.pdf b/mobile/android/geckoview/src/androidTest/assets/www/orange.pdf new file mode 100755 index 0000000000..684582176a Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/orange.pdf differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto-none.html b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto-none.html new file mode 100644 index 0000000000..ff180f961a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto-none.html @@ -0,0 +1,28 @@ + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto.html b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto.html new file mode 100644 index 0000000000..6f2b3ee92a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-auto.html @@ -0,0 +1,28 @@ + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-auto.html b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-auto.html new file mode 100644 index 0000000000..ff6366ccda --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-auto.html @@ -0,0 +1,28 @@ + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-on-non-root.html b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-on-non-root.html new file mode 100644 index 0000000000..fbe2269c19 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/overscroll-behavior-none-on-non-root.html @@ -0,0 +1,37 @@ + + + + + + +
    +
    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/popup.html b/mobile/android/geckoview/src/androidTest/assets/www/popup.html new file mode 100644 index 0000000000..7e52870df5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/popup.html @@ -0,0 +1,12 @@ + + + + Hello, world! + + +

    Launching popup...

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/print_content_change.html b/mobile/android/geckoview/src/androidTest/assets/www/print_content_change.html new file mode 100644 index 0000000000..ae36a6c6b8 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/print_content_change.html @@ -0,0 +1,37 @@ + + + + + Orange Print Background Removal + + + + +
    + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/print_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/print_iframe.html new file mode 100644 index 0000000000..b7dd83f2a5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/print_iframe.html @@ -0,0 +1,39 @@ + + + + + Print iframes + + + + +
    + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/prompts.html b/mobile/android/geckoview/src/androidTest/assets/www/prompts.html new file mode 100644 index 0000000000..53e8f96b04 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/prompts.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/pull-to-refresh-subframe.html b/mobile/android/geckoview/src/androidTest/assets/www/pull-to-refresh-subframe.html new file mode 100644 index 0000000000..d1a421c0a3 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/pull-to-refresh-subframe.html @@ -0,0 +1,82 @@ + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/push/push.html b/mobile/android/geckoview/src/androidTest/assets/www/push/push.html new file mode 100644 index 0000000000..ccd091eaea --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/push/push.html @@ -0,0 +1,10 @@ + + + + Push API test + + +

    Hello, world!

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/push/push.js b/mobile/android/geckoview/src/androidTest/assets/www/push/push.js new file mode 100644 index 0000000000..d9322d11cc --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/push/push.js @@ -0,0 +1,44 @@ +window.doSubscribe = async function (applicationServerKey) { + const registration = await navigator.serviceWorker.register("./sw.js"); + const sub = await registration.pushManager.subscribe({ + applicationServerKey, + }); + return sub.toJSON(); +}; + +window.doGetSubscription = async function () { + const registration = await navigator.serviceWorker.register("./sw.js"); + const sub = await registration.pushManager.getSubscription(); + if (sub) { + return sub.toJSON(); + } + + return null; +}; + +window.doUnsubscribe = async function () { + const registration = await navigator.serviceWorker.register("./sw.js"); + const sub = await registration.pushManager.getSubscription(); + sub.unsubscribe(); + return {}; +}; + +window.doWaitForPushEvent = function () { + return new Promise(resolve => { + navigator.serviceWorker.addEventListener("message", function (e) { + if (e.data.type === "push") { + resolve(e.data.payload); + } + }); + }); +}; + +window.doWaitForSubscriptionChange = function () { + return new Promise(resolve => { + navigator.serviceWorker.addEventListener("message", function (e) { + if (e.data.type === "pushsubscriptionchange") { + resolve(e.data.type); + } + }); + }); +}; diff --git a/mobile/android/geckoview/src/androidTest/assets/www/push/sw.js b/mobile/android/geckoview/src/androidTest/assets/www/push/sw.js new file mode 100644 index 0000000000..2e51383205 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/push/sw.js @@ -0,0 +1,30 @@ +self.addEventListener("install", function () { + self.skipWaiting(); +}); + +self.addEventListener("activate", function (e) { + e.waitUntil(self.clients.claim()); +}); + +self.addEventListener("push", async function (e) { + const clients = await self.clients.matchAll(); + let text = ""; + if (e.data) { + text = e.data.text(); + } + clients.forEach(function (client) { + client.postMessage({ type: "push", payload: text }); + }); + + try { + const { title, body } = e.data.json(); + self.registration.showNotification(title, { body }); + } catch (e) {} +}); + +self.addEventListener("pushsubscriptionchange", async function (e) { + const clients = await self.clients.matchAll(); + clients.forEach(function (client) { + client.postMessage({ type: "pushsubscriptionchange" }); + }); +}); diff --git a/mobile/android/geckoview/src/androidTest/assets/www/red-background-body-fully-covered-by-green-element.html b/mobile/android/geckoview/src/androidTest/assets/www/red-background-body-fully-covered-by-green-element.html new file mode 100644 index 0000000000..ad6c96599e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/red-background-body-fully-covered-by-green-element.html @@ -0,0 +1,23 @@ + + + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/reflect_local_storage_into_title.html b/mobile/android/geckoview/src/androidTest/assets/www/reflect_local_storage_into_title.html new file mode 100644 index 0000000000..749678c668 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/reflect_local_storage_into_title.html @@ -0,0 +1,17 @@ + + + + no title + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/resubmit.html b/mobile/android/geckoview/src/androidTest/assets/www/resubmit.html new file mode 100644 index 0000000000..6155270f1b --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/resubmit.html @@ -0,0 +1,12 @@ + + + + + + +
    + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/root_100_percent_height.html b/mobile/android/geckoview/src/androidTest/assets/www/root_100_percent_height.html new file mode 100644 index 0000000000..e91c997bbb --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/root_100_percent_height.html @@ -0,0 +1,37 @@ + + + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/root_100vh.html b/mobile/android/geckoview/src/androidTest/assets/www/root_100vh.html new file mode 100644 index 0000000000..e6c7fef374 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/root_100vh.html @@ -0,0 +1,36 @@ + + + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/root_98vh.html b/mobile/android/geckoview/src/androidTest/assets/www/root_98vh.html new file mode 100644 index 0000000000..a654353d64 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/root_98vh.html @@ -0,0 +1,36 @@ + + + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/saveState.html b/mobile/android/geckoview/src/androidTest/assets/www/saveState.html new file mode 100644 index 0000000000..c85b528f01 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/saveState.html @@ -0,0 +1,18 @@ + + + + Hello, world! + + + + +
    + +
    +

    Hello, world!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/scroll-handoff.html b/mobile/android/geckoview/src/androidTest/assets/www/scroll-handoff.html new file mode 100644 index 0000000000..c8f0fe9e95 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/scroll-handoff.html @@ -0,0 +1,40 @@ + + + + + + +
    +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/scroll.html b/mobile/android/geckoview/src/androidTest/assets/www/scroll.html new file mode 100644 index 0000000000..e906e45686 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/scroll.html @@ -0,0 +1,59 @@ + + + + + + + +
    +
    +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/select-listbox.html b/mobile/android/geckoview/src/androidTest/assets/www/select-listbox.html new file mode 100644 index 0000000000..5832954d2e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/select-listbox.html @@ -0,0 +1,7 @@ + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/select-multiple.html b/mobile/android/geckoview/src/androidTest/assets/www/select-multiple.html new file mode 100644 index 0000000000..bb9470fffd --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/select-multiple.html @@ -0,0 +1,7 @@ + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/select.html b/mobile/android/geckoview/src/androidTest/assets/www/select.html new file mode 100644 index 0000000000..e8d28253d2 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/select.html @@ -0,0 +1,6 @@ + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame.html b/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame.html new file mode 100644 index 0000000000..132155c6a1 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame_xorigin.html b/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame_xorigin.html new file mode 100644 index 0000000000..87a4d6039e --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/selectionAction_frame_xorigin.html @@ -0,0 +1,47 @@ + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/showDynamicToolbar.html b/mobile/android/geckoview/src/androidTest/assets/www/showDynamicToolbar.html new file mode 100644 index 0000000000..f6b0dd340c --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/showDynamicToolbar.html @@ -0,0 +1,96 @@ + + + + + + showDynamicToolbar test content + + + +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    +

    Paragraph

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/simple_redirect.sjs b/mobile/android/geckoview/src/androidTest/assets/www/simple_redirect.sjs new file mode 100644 index 0000000000..43fec90b5a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/simple_redirect.sjs @@ -0,0 +1,4 @@ +function handleRequest(request, response) { + response.setStatusLine(request.httpVersion, 301, "Moved Permanently"); + response.setHeader("Location", request.queryString, false); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/titleChange.html b/mobile/android/geckoview/src/androidTest/assets/www/titleChange.html new file mode 100644 index 0000000000..51f8c936b6 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/titleChange.html @@ -0,0 +1,16 @@ + + + + +
    Title1
    + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/touch-action-wheel-listener.html b/mobile/android/geckoview/src/androidTest/assets/www/touch-action-wheel-listener.html new file mode 100644 index 0000000000..cfc9489d17 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/touch-action-wheel-listener.html @@ -0,0 +1,33 @@ + + + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/touch-action.html b/mobile/android/geckoview/src/androidTest/assets/www/touch-action.html new file mode 100644 index 0000000000..62266b6ef7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/touch-action.html @@ -0,0 +1,48 @@ + + + + + + +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/touch.html b/mobile/android/geckoview/src/androidTest/assets/www/touch.html new file mode 100644 index 0000000000..ba3bc098a9 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/touch.html @@ -0,0 +1,58 @@ + + + + + + + +
    +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/touch_xorigin.html b/mobile/android/geckoview/src/androidTest/assets/www/touch_xorigin.html new file mode 100644 index 0000000000..89f3762aef --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/touch_xorigin.html @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/touchstart.html b/mobile/android/geckoview/src/androidTest/assets/www/touchstart.html new file mode 100644 index 0000000000..9ee1f461a7 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/touchstart.html @@ -0,0 +1,37 @@ + + + + + + + +
    +
    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/tracemonkey.pdf b/mobile/android/geckoview/src/androidTest/assets/www/tracemonkey.pdf new file mode 100644 index 0000000000..4dcf129d65 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/tracemonkey.pdf differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/trackers.html b/mobile/android/geckoview/src/androidTest/assets/www/trackers.html new file mode 100644 index 0000000000..56ea43979a --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/trackers.html @@ -0,0 +1,14 @@ + + + + Trackers + + +

    Trackers

    + + + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-en.html b/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-en.html new file mode 100644 index 0000000000..3e5f8e6303 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-en.html @@ -0,0 +1,62 @@ + + + + + + Translations Test + + + +
    + +

    "The Wonderful Wizard of Oz" by L. Frank Baum

    +

    + The little girl, seeing she had lost one of her pretty shoes, grew + angry, and said to the Witch, “Give me back my shoe!” +

    +

    + “I will not,” retorted the Witch, “for it is now my shoe, and not + yours.” +

    +

    + “You are a wicked creature!” cried Dorothy. “You have no right to take + my shoe from me.” +

    +

    + “I shall keep it, just the same,” said the Witch, laughing at her, “and + someday I shall get the other one from you, too.” +

    +

    + This made Dorothy so very angry that she picked up the bucket of water + that stood near and dashed it over the Witch, wetting her from head to + foot. +

    +

    + Instantly the wicked woman gave a loud cry of fear, and then, as Dorothy + looked at her in wonder, the Witch began to shrink and fall away. +

    +

    + “See what you have done!” she screamed. “In a minute I shall melt away.” +

    +

    + “I’m very sorry, indeed,” said Dorothy, who was truly frightened to see + the Witch actually melting away like brown sugar before her very eyes. +

    +

    + “Didn’t you know water would be the end of me?” asked the Witch, in a + wailing, despairing voice. +

    +

    “Of course not,” answered Dorothy. “How should I?”

    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-es.html b/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-es.html new file mode 100644 index 0000000000..e9d39585ee --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/translations-tester-es.html @@ -0,0 +1,83 @@ + + + + + + Translations Test + + + +
    +
    + The following is an excerpt from Don Quijote de la Mancha, which is in + the public domain +
    +

    Don Quijote de La Mancha

    +

    Capítulo VIII.

    +

    + Del buen suceso que el valeroso don Quijote tuvo en la espantable y + jamás imaginada aventura de los molinos de viento, con otros sucesos + dignos de felice recordación +

    +

    + En esto, descubrieron treinta o cuarenta molinos de viento que hay en + aquel campo; y, así como don Quijote los vio, dijo a su escudero: +

    +

    + — La ventura va guiando nuestras cosas mejor de lo que acertáramos a + desear, porque ves allí, amigo Sancho Panza, donde se descubren treinta, + o pocos más, desaforados gigantes, con quien pienso hacer batalla y + quitarles a todos las vidas, con cuyos despojos comenzaremos a + enriquecer; que ésta es buena guerra, y es gran servicio de Dios quitar + tan mala simiente de sobre la faz de la tierra. +

    +

    — ¿Qué gigantes? —dijo Sancho Panza.

    +

    + — Aquellos que allí ves —respondió su amo— de los brazos largos, que los + suelen tener algunos de casi dos leguas. +

    +

    + — Mire vuestra merced —respondió Sancho— que aquellos que allí se + parecen no son gigantes, sino molinos de viento, y lo que en ellos + parecen brazos son las aspas, que, volteadas del viento, hacen andar la + piedra del molino. +

    +

    + — Bien parece —respondió don Quijote— que no estás cursado en esto de + las aventuras: ellos son gigantes; y si tienes miedo, quítate de ahí, y + ponte en oración en el espacio que yo voy a entrar con ellos en fiera y + desigual batalla. +

    +

    + Y, diciendo esto, dio de espuelas a su caballo Rocinante, sin atender a + las voces que su escudero Sancho le daba, advirtiéndole que, sin duda + alguna, eran molinos de viento, y no gigantes, aquellos que iba a + acometer. Pero él iba tan puesto en que eran gigantes, que ni oía las + voces de su escudero Sancho ni echaba de ver, aunque estaba ya bien + cerca, lo que eran; antes, iba diciendo en voces altas: +

    +

    + — Non fuyades, cobardes y viles criaturas, que un solo caballero es el + que os acomete. +

    +

    + Levantóse en esto un poco de viento y las grandes aspas comenzaron a + moverse, lo cual visto por don Quijote, dijo: +

    +

    + — Pues, aunque mováis más brazos que los del gigante Briareo, me lo + habéis de pagar. +

    +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/transparent.gif b/mobile/android/geckoview/src/androidTest/assets/www/transparent.gif new file mode 100644 index 0000000000..e565824aaf Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/transparent.gif differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/update_manifest.json b/mobile/android/geckoview/src/androidTest/assets/www/update_manifest.json new file mode 100644 index 0000000000..7b2de1f278 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/update_manifest.json @@ -0,0 +1,40 @@ +{ + "addons": { + "update@example.com": { + "updates": [ + { + "version": "1.0", + "update_link": "https://example.org/tests/junit/update-1.xpi" + }, + { + "version": "2.0", + "update_link": "https://example.org/tests/junit/update-2.xpi" + } + ] + }, + "update-postpone@example.com": { + "updates": [ + { + "version": "1.0", + "update_link": "https://example.org/tests/junit/update-postpone-1.xpi" + }, + { + "version": "2.0", + "update_link": "https://example.org/tests/junit/update-postpone-2.xpi" + } + ] + }, + "update-with-perms@example.com": { + "updates": [ + { + "version": "1.0", + "update_link": "https://example.org/tests/junit/update-with-perms-1.xpi" + }, + { + "version": "2.0", + "update_link": "https://example.org/tests/junit/update-with-perms-2.xpi" + } + ] + } + } +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/videos/gizmo.webm b/mobile/android/geckoview/src/androidTest/assets/www/videos/gizmo.webm new file mode 100644 index 0000000000..518531a93f Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/videos/gizmo.webm differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/videos/short.mp4 b/mobile/android/geckoview/src/androidTest/assets/www/videos/short.mp4 new file mode 100644 index 0000000000..a674b7eb68 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/videos/short.mp4 differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/videos/video.ogg b/mobile/android/geckoview/src/androidTest/assets/www/videos/video.ogg new file mode 100644 index 0000000000..ac7ece3519 Binary files /dev/null and b/mobile/android/geckoview/src/androidTest/assets/www/videos/video.ogg differ diff --git a/mobile/android/geckoview/src/androidTest/assets/www/viewport.html b/mobile/android/geckoview/src/androidTest/assets/www/viewport.html new file mode 100644 index 0000000000..a5dfa0f64f --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/viewport.html @@ -0,0 +1,19 @@ + + + + + + + +
    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/webm.html b/mobile/android/geckoview/src/androidTest/assets/www/webm.html new file mode 100644 index 0000000000..f329582575 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/webm.html @@ -0,0 +1,11 @@ + + + + WebM Video + + + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.html b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.html new file mode 100644 index 0000000000..d71eb0484d --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.html @@ -0,0 +1,10 @@ + + + + Open Window test + + +

    Hello, world!

    + + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.js b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.js new file mode 100644 index 0000000000..921cff5b09 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window.js @@ -0,0 +1,15 @@ +navigator.serviceWorker.register("./service-worker.js", { + scope: ".", +}); + +function showNotification() { + Notification.requestPermission(function (result) { + if (result === "granted") { + navigator.serviceWorker.ready.then(function (registration) { + registration.showNotification("Open Window Notification", { + body: "Hello", + }); + }); + } + }); +} diff --git a/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window_target.html b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window_target.html new file mode 100644 index 0000000000..14775aafac --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/worker/open_window_target.html @@ -0,0 +1,9 @@ + + + + Open Window test target + + +

    Hello, world!

    + + diff --git a/mobile/android/geckoview/src/androidTest/assets/www/worker/service-worker.js b/mobile/android/geckoview/src/androidTest/assets/www/worker/service-worker.js new file mode 100644 index 0000000000..e3fbbb6388 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/worker/service-worker.js @@ -0,0 +1,15 @@ +self.addEventListener("install", function () { + console.log("install"); + self.skipWaiting(); +}); + +self.addEventListener("activate", function (e) { + console.log("activate"); + e.waitUntil(self.clients.claim()); +}); + +self.onnotificationclick = function (event) { + console.log("onnotificationclick"); + self.clients.openWindow("open_window_target.html"); + event.notification.close(); +}; -- cgit v1.2.3