From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- devtools/server/tests/browser/animation-data.html | 115 ++ devtools/server/tests/browser/animation.html | 170 +++ .../browser/application-manifest-404-manifest.html | 10 + .../tests/browser/application-manifest-basic.html | 10 + .../browser/application-manifest-invalid-json.html | 11 + .../browser/application-manifest-no-manifest.html | 9 + .../browser/application-manifest-warnings.html | 10 + devtools/server/tests/browser/browser.ini | 151 +++ .../browser_accessibility_highlighter_infobar.js | 73 ++ ...browser_accessibility_infobar_audit_keyboard.js | 157 +++ ...owser_accessibility_infobar_audit_text_label.js | 164 +++ .../browser/browser_accessibility_infobar_show.js | 181 +++ .../browser_accessibility_keyboard_audit.js | 371 +++++++ .../tests/browser/browser_accessibility_node.js | 150 +++ .../browser/browser_accessibility_node_audit.js | 116 ++ .../browser/browser_accessibility_node_events.js | 197 ++++ ...accessibility_node_tabbing_order_highlighter.js | 92 ++ .../tests/browser/browser_accessibility_simple.js | 106 ++ .../browser/browser_accessibility_simulator.js | 88 ++ ...wser_accessibility_tabbing_order_highlighter.js | 101 ++ .../browser_accessibility_text_label_audit.js | 1138 +++++++++++++++++++ ...browser_accessibility_text_label_audit_frame.js | 48 + .../tests/browser/browser_accessibility_walker.js | 170 +++ .../browser/browser_accessibility_walker_audit.js | 155 +++ .../server/tests/browser/browser_actor_error.js | 94 ++ .../browser/browser_animation_actor-lifetime.js | 80 ++ .../browser/browser_animation_emitMutations.js | 72 ++ .../browser/browser_animation_getMultipleStates.js | 63 ++ .../tests/browser/browser_animation_getPlayers.js | 39 + .../browser_animation_getStateAfterFinished.js | 76 ++ .../browser_animation_getSubTreeAnimations.js | 46 + .../browser/browser_animation_keepFinished.js | 55 + .../browser/browser_animation_playPauseIframe.js | 70 ++ .../browser/browser_animation_playPauseSeveral.js | 67 ++ .../tests/browser/browser_animation_playerState.js | 159 +++ .../browser/browser_animation_reconstructState.js | 39 + .../browser_animation_refreshTransitions.js | 97 ++ .../browser/browser_animation_setCurrentTime.js | 47 + .../browser/browser_animation_setPlaybackRate.js | 49 + .../tests/browser/browser_animation_simple.js | 39 + .../browser/browser_animation_updatedState.js | 65 ++ .../tests/browser/browser_application_manifest.js | 87 ++ .../tests/browser/browser_canvasframe_helper_01.js | 170 +++ .../tests/browser/browser_canvasframe_helper_02.js | 53 + .../tests/browser/browser_canvasframe_helper_03.js | 129 +++ .../tests/browser/browser_canvasframe_helper_04.js | 142 +++ .../tests/browser/browser_canvasframe_helper_05.js | 134 +++ .../tests/browser/browser_canvasframe_helper_06.js | 116 ++ .../browser/browser_compatibility_cssIssues.js | 137 +++ .../server/tests/browser/browser_connectToFrame.js | 142 +++ .../tests/browser/browser_debugger_server.js | 198 ++++ .../server/tests/browser/browser_getProcess.js | 129 +++ .../tests/browser/browser_inspector-anonymous.js | 204 ++++ .../tests/browser/browser_inspector-iframe.js | 92 ++ .../tests/browser/browser_inspector-insert.js | 158 +++ .../browser/browser_inspector-isScrollable.js | 34 + .../browser_inspector-mutations-childlist.js | 282 +++++ .../tests/browser/browser_inspector-release.js | 54 + .../tests/browser/browser_inspector-remove.js | 102 ++ .../tests/browser/browser_inspector-retain.js | 157 +++ .../tests/browser/browser_inspector-search.js | 339 ++++++ .../tests/browser/browser_inspector-shadow.js | 231 ++++ .../tests/browser/browser_inspector-traversal.js | 349 ++++++ .../tests/browser/browser_inspector-utils.js | 25 + .../tests/browser/browser_layout_getGrids.js | 145 +++ .../server/tests/browser/browser_layout_simple.js | 31 + .../tests/browser/browser_memory_allocations_01.js | 106 ++ devtools/server/tests/browser/browser_perf-01.js | 57 + devtools/server/tests/browser/browser_perf-02.js | 37 + devtools/server/tests/browser/browser_perf-04.js | 53 + .../browser/browser_perf-getSupportedFeatures.js | 23 + .../browser_storage_cookies-duplicate-names.js | 134 +++ .../browser/browser_storage_dynamic_windows.js | 410 +++++++ .../tests/browser/browser_storage_listings.js | 743 +++++++++++++ .../tests/browser/browser_storage_updates.js | 343 ++++++ .../browser_style_utils_getFontPreviewData.js | 131 +++ .../tests/browser/browser_styles_getRuleText.js | 34 + .../browser/browser_stylesheets_getTextEmpty.js | 53 + .../tests/browser/director-script-target.html | 18 + .../server/tests/browser/doc_accessibility.html | 18 + .../tests/browser/doc_accessibility_audit.html | 10 + .../tests/browser/doc_accessibility_infobar.html | 12 + .../browser/doc_accessibility_keyboard_audit.html | 150 +++ .../doc_accessibility_text_label_audit.html | 463 ++++++++ .../doc_accessibility_text_label_audit_frame.html | 10 + devtools/server/tests/browser/doc_allocations.html | 23 + .../server/tests/browser/doc_compatibility.html | 28 + devtools/server/tests/browser/doc_force_cc.html | 32 + devtools/server/tests/browser/doc_force_gc.html | 31 + devtools/server/tests/browser/doc_iframe.html | 17 + devtools/server/tests/browser/doc_iframe2.html | 15 + .../server/tests/browser/doc_iframe_content.html | 14 + devtools/server/tests/browser/doc_innerHTML.html | 21 + devtools/server/tests/browser/error-actor.js | 25 + devtools/server/tests/browser/grid.html | 42 + devtools/server/tests/browser/head.js | 337 ++++++ devtools/server/tests/browser/inspector-helpers.js | 166 +++ .../tests/browser/inspector-isScrollable-data.html | 79 ++ .../tests/browser/inspector-search-data.html | 54 + .../server/tests/browser/inspector-shadow.html | 117 ++ .../tests/browser/inspector-traversal-data.html | 98 ++ .../tests/browser/storage-cookies-same-name.html | 29 + .../tests/browser/storage-dynamic-windows.html | 117 ++ devtools/server/tests/browser/storage-helpers.js | 57 + .../server/tests/browser/storage-listings.html | 123 +++ .../tests/browser/storage-secured-iframe.html | 94 ++ .../tests/browser/storage-unsecured-iframe.html | 28 + devtools/server/tests/browser/storage-updates.html | 47 + devtools/server/tests/browser/test-errors-actor.js | 72 ++ devtools/server/tests/browser/test-window.xhtml | 5 + .../chrome/Debugger.Source.prototype.element-2.js | 4 + .../chrome/Debugger.Source.prototype.element.html | 25 + .../chrome/Debugger.Source.prototype.element.js | 7 + devtools/server/tests/chrome/chrome.ini | 92 ++ ...ebugger.Source.prototype.introductionType.xhtml | 7 + devtools/server/tests/chrome/hello-actor.js | 28 + .../chrome/iframe1_makeGlobalObjectReference.html | 1 + .../chrome/iframe2_makeGlobalObjectReference.html | 1 + .../inactive-property-helper/align-content.mjs | 92 ++ .../inactive-property-helper/border-image.mjs | 162 +++ .../flex-grid-item-properties.mjs | 229 ++++ .../chrome/inactive-property-helper/float.mjs | 76 ++ .../tests/chrome/inactive-property-helper/gap.mjs | 133 +++ .../grid-container-properties.mjs | 43 + .../grid-with-absolute-properties.mjs | 71 ++ .../inactive-property-helper/margin-padding.mjs | 260 +++++ .../max-min-width-height.mjs | 366 +++++++ .../place-items-content.mjs | 159 +++ .../chrome/inactive-property-helper/positioned.mjs | 82 ++ .../inactive-property-helper/scroll-padding.mjs | 159 +++ .../chrome/inactive-property-helper/table.mjs | 28 + .../inactive-property-helper/text-overflow.mjs | 92 ++ .../inactive-property-helper/vertical-align.mjs | 56 + .../inactive-property-helper/width-height-ruby.mjs | 147 +++ .../chrome/inspector-delay-image-response.sjs | 46 + .../server/tests/chrome/inspector-eyedropper.html | 20 + devtools/server/tests/chrome/inspector-helpers.js | 133 +++ .../server/tests/chrome/inspector-search-data.html | 54 + .../server/tests/chrome/inspector-styles-data.css | 3 + .../server/tests/chrome/inspector-styles-data.html | 85 ++ .../server/tests/chrome/inspector-template.html | 17 + .../tests/chrome/inspector-traversal-data.html | 103 ++ .../tests/chrome/inspector_css-properties.html | 12 + .../tests/chrome/inspector_display-type.html | 17 + .../tests/chrome/inspector_getImageData.html | 23 + .../tests/chrome/inspector_getOffsetParent.html | 18 + devtools/server/tests/chrome/large-image.jpg | Bin 0 -> 793541 bytes devtools/server/tests/chrome/memory-helpers.js | 72 ++ .../tests/chrome/nonchrome_unsafeDereference.html | 10 + devtools/server/tests/chrome/small-image.gif | Bin 0 -> 510655 bytes .../tests/chrome/suspendTimeouts_content.html | 1 + .../server/tests/chrome/suspendTimeouts_content.js | 75 ++ .../server/tests/chrome/suspendTimeouts_worker.js | 12 + .../test_Debugger.Script.prototype.global.html | 48 + ...Debugger.Source.prototype.elementAttribute.html | 159 +++ ...bugger.Source.prototype.introductionScript.html | 96 ++ ...Debugger.Source.prototype.introductionType.html | 159 +++ .../tests/chrome/test_animation-type-longhand.html | 42 + .../tests/chrome/test_css-logic-media-queries.html | 57 + .../tests/chrome/test_css-logic-specificity.html | 82 ++ devtools/server/tests/chrome/test_css-logic.html | 73 ++ .../server/tests/chrome/test_css-properties.html | 72 ++ devtools/server/tests/chrome/test_device.html | 79 ++ .../test_executeInGlobal-outerized_this.html | 73 ++ .../chrome/test_highlighter_paused_debugger.html | 88 ++ .../tests/chrome/test_inspector-changeattrs.html | 90 ++ .../tests/chrome/test_inspector-changevalue.html | 68 ++ .../tests/chrome/test_inspector-display-type.html | 81 ++ .../chrome/test_inspector-duplicate-node.html | 61 ++ .../server/tests/chrome/test_inspector-hide.html | 71 ++ .../test_inspector-inactive-property-helper.html | 105 ++ .../chrome/test_inspector-mutations-attr.html | 169 +++ .../chrome/test_inspector-mutations-events.html | 187 ++++ .../chrome/test_inspector-mutations-value.html | 163 +++ .../tests/chrome/test_inspector-pick-color.html | 94 ++ .../chrome/test_inspector-pseudoclass-lock.html | 185 ++++ .../server/tests/chrome/test_inspector-reload.html | 90 ++ .../server/tests/chrome/test_inspector-resize.html | 69 ++ .../tests/chrome/test_inspector-resolve-url.html | 87 ++ .../chrome/test_inspector-scroll-into-view.html | 60 + .../tests/chrome/test_inspector-search-front.html | 163 +++ .../tests/chrome/test_inspector-template.html | 66 ++ .../test_inspector_getImageData-wait-for-load.html | 133 +++ .../tests/chrome/test_inspector_getImageData.html | 142 +++ .../chrome/test_inspector_getImageDataFromURL.html | 116 ++ .../chrome/test_inspector_getNodeFromActor.html | 84 ++ .../chrome/test_inspector_getOffsetParent.html | 129 +++ .../chrome/test_makeGlobalObjectReference.html | 96 ++ devtools/server/tests/chrome/test_memory.html | 39 + .../tests/chrome/test_memory_allocations_02.html | 80 ++ .../tests/chrome/test_memory_allocations_03.html | 80 ++ .../tests/chrome/test_memory_allocations_04.html | 62 ++ .../tests/chrome/test_memory_allocations_05.html | 93 ++ .../tests/chrome/test_memory_allocations_06.html | 51 + .../tests/chrome/test_memory_allocations_07.html | 58 + .../server/tests/chrome/test_memory_attach_01.html | 33 + .../server/tests/chrome/test_memory_attach_02.html | 44 + .../server/tests/chrome/test_memory_census.html | 35 + .../server/tests/chrome/test_memory_gc_01.html | 50 + .../server/tests/chrome/test_memory_gc_events.html | 44 + .../server/tests/chrome/test_overflowing-body.html | 42 + .../tests/chrome/test_overflowing-children.html | 131 +++ devtools/server/tests/chrome/test_preference.html | 128 +++ .../server/tests/chrome/test_styles-applied.html | 155 +++ .../server/tests/chrome/test_styles-computed.html | 130 +++ .../server/tests/chrome/test_styles-layout.html | 110 ++ .../server/tests/chrome/test_styles-matched.html | 110 ++ .../server/tests/chrome/test_styles-modify.html | 110 ++ devtools/server/tests/chrome/test_styles-svg.html | 61 ++ .../server/tests/chrome/test_suspendTimeouts.html | 20 + .../server/tests/chrome/test_suspendTimeouts.js | 139 +++ .../tests/chrome/test_unsafeDereference.html | 53 + .../tests/chrome/test_webconsole-node-grip.html | 66 ++ devtools/server/tests/chrome/webconsole-helpers.js | 54 + devtools/server/tests/xpcshell/.eslintrc.js | 9 + .../addons/web-extension-upgrade/manifest.json | 10 + .../xpcshell/addons/web-extension/manifest.json | 10 + .../xpcshell/addons/web-extension2/manifest.json | 10 + devtools/server/tests/xpcshell/completions.js | 23 + devtools/server/tests/xpcshell/head_dbg.js | 982 +++++++++++++++++ devtools/server/tests/xpcshell/hello-actor.js | 23 + .../tests/xpcshell/post_init_global_actors.js | 22 + .../xpcshell/post_init_target_scoped_actors.js | 22 + .../tests/xpcshell/pre_init_global_actors.js | 22 + .../xpcshell/pre_init_target_scoped_actors.js | 22 + .../tests/xpcshell/registertestactors-lazy.js | 43 + .../setBreakpoint-on-column-in-gcd-script.js | 7 + .../xpcshell/setBreakpoint-on-column-minified.js | 8 + ...oint-on-column-with-no-offsets-in-gcd-script.js | 7 + .../setBreakpoint-on-column-with-no-offsets.js | 5 + .../tests/xpcshell/setBreakpoint-on-column.js | 5 + .../setBreakpoint-on-line-in-gcd-script.js | 9 + .../setBreakpoint-on-line-with-multiple-offsets.js | 7 + ...tBreakpoint-on-line-with-multiple-statements.js | 5 + ...kpoint-on-line-with-no-offsets-in-gcd-script.js | 9 + .../setBreakpoint-on-line-with-no-offsets.js | 7 + .../server/tests/xpcshell/setBreakpoint-on-line.js | 7 + devtools/server/tests/xpcshell/source-03.js | 7 + .../xpcshell/source-map-data/sourcemapped.coffee | 6 + .../xpcshell/source-map-data/sourcemapped.map | 10 + devtools/server/tests/xpcshell/sourcemapped.js | 16 + devtools/server/tests/xpcshell/stepping-async.js | 31 + devtools/server/tests/xpcshell/stepping.js | 36 + .../test_MemoryActor_saveHeapSnapshot_01.js | 22 + .../test_MemoryActor_saveHeapSnapshot_02.js | 24 + .../test_MemoryActor_saveHeapSnapshot_03.js | 22 + devtools/server/tests/xpcshell/test_add_actors.js | 107 ++ .../tests/xpcshell/test_addon_debugging_connect.js | 158 +++ .../server/tests/xpcshell/test_addon_events.js | 60 + .../server/tests/xpcshell/test_addon_reload.js | 116 ++ .../server/tests/xpcshell/test_addons_actor.js | 55 + .../server/tests/xpcshell/test_animation_name.js | 93 ++ .../server/tests/xpcshell/test_animation_type.js | 72 ++ devtools/server/tests/xpcshell/test_attach.js | 28 + .../server/tests/xpcshell/test_blackboxing-01.js | 155 +++ .../server/tests/xpcshell/test_blackboxing-02.js | 95 ++ .../server/tests/xpcshell/test_blackboxing-03.js | 115 ++ .../server/tests/xpcshell/test_blackboxing-04.js | 70 ++ .../server/tests/xpcshell/test_blackboxing-05.js | 97 ++ .../server/tests/xpcshell/test_blackboxing-08.js | 52 + .../server/tests/xpcshell/test_breakpoint-01.js | 53 + .../server/tests/xpcshell/test_breakpoint-03.js | 74 ++ .../server/tests/xpcshell/test_breakpoint-04.js | 56 + .../server/tests/xpcshell/test_breakpoint-05.js | 62 ++ .../server/tests/xpcshell/test_breakpoint-06.js | 68 ++ .../server/tests/xpcshell/test_breakpoint-07.js | 65 ++ .../server/tests/xpcshell/test_breakpoint-08.js | 75 ++ .../server/tests/xpcshell/test_breakpoint-09.js | 72 ++ .../server/tests/xpcshell/test_breakpoint-10.js | 81 ++ .../server/tests/xpcshell/test_breakpoint-11.js | 77 ++ .../server/tests/xpcshell/test_breakpoint-12.js | 93 ++ .../server/tests/xpcshell/test_breakpoint-13.js | 78 ++ .../server/tests/xpcshell/test_breakpoint-14.js | 90 ++ .../server/tests/xpcshell/test_breakpoint-16.js | 70 ++ .../server/tests/xpcshell/test_breakpoint-17.js | 130 +++ .../server/tests/xpcshell/test_breakpoint-18.js | 60 + .../server/tests/xpcshell/test_breakpoint-19.js | 45 + .../server/tests/xpcshell/test_breakpoint-20.js | 109 ++ .../server/tests/xpcshell/test_breakpoint-21.js | 62 ++ .../server/tests/xpcshell/test_breakpoint-22.js | 60 + .../server/tests/xpcshell/test_breakpoint-23.js | 35 + .../server/tests/xpcshell/test_breakpoint-24.js | 239 ++++ .../server/tests/xpcshell/test_breakpoint-25.js | 79 ++ .../server/tests/xpcshell/test_breakpoint-26.js | 63 ++ .../tests/xpcshell/test_breakpoint-actor-map.js | 257 +++++ .../server/tests/xpcshell/test_client_request.js | 261 +++++ .../xpcshell/test_conditional_breakpoint-01.js | 54 + .../xpcshell/test_conditional_breakpoint-02.js | 52 + .../xpcshell/test_conditional_breakpoint-03.js | 60 + .../xpcshell/test_conditional_breakpoint-04.js | 53 + .../xpcshell/test_connection_closes_all_pools.js | 100 ++ .../server/tests/xpcshell/test_console_eval-01.js | 33 + .../server/tests/xpcshell/test_console_eval-02.js | 22 + devtools/server/tests/xpcshell/test_dbgactor.js | 46 + .../xpcshell/test_dbgclient_debuggerstatement.js | 39 + devtools/server/tests/xpcshell/test_dbgglobal.js | 86 ++ .../tests/xpcshell/test_extension_storage_actor.js | 1155 ++++++++++++++++++++ .../test_extension_storage_actor_upgrade.js | 142 +++ .../server/tests/xpcshell/test_format_command.js | 111 ++ .../server/tests/xpcshell/test_forwardingprefix.js | 226 ++++ .../server/tests/xpcshell/test_frameactor-01.js | 35 + .../server/tests/xpcshell/test_frameactor-02.js | 36 + .../server/tests/xpcshell/test_frameactor-03.js | 54 + .../server/tests/xpcshell/test_frameactor-04.js | 64 ++ .../server/tests/xpcshell/test_frameactor-05.js | 39 + .../tests/xpcshell/test_frameactor_wasm-01.js | 67 ++ .../tests/xpcshell/test_framearguments-01.js | 43 + .../server/tests/xpcshell/test_framebindings-01.js | 71 ++ .../server/tests/xpcshell/test_framebindings-02.js | 60 + .../server/tests/xpcshell/test_framebindings-03.js | 63 ++ .../server/tests/xpcshell/test_framebindings-04.js | 77 ++ .../server/tests/xpcshell/test_framebindings-05.js | 54 + .../server/tests/xpcshell/test_framebindings-06.js | 45 + .../server/tests/xpcshell/test_framebindings-07.js | 41 + .../server/tests/xpcshell/test_front_destroy.js | 42 + .../server/tests/xpcshell/test_functiongrips-01.js | 64 ++ devtools/server/tests/xpcshell/test_getRuleText.js | 143 +++ .../tests/xpcshell/test_getTextAtLineColumn.js | 35 + .../server/tests/xpcshell/test_getyoungestframe.js | 38 + .../xpcshell/test_ignore_caught_exceptions.js | 53 + .../test_ignore_no_interface_exceptions.js | 50 + devtools/server/tests/xpcshell/test_interrupt.js | 15 + .../tests/xpcshell/test_layout-reflows-observer.js | 311 ++++++ .../server/tests/xpcshell/test_listsources-01.js | 56 + .../server/tests/xpcshell/test_listsources-02.js | 36 + .../server/tests/xpcshell/test_listsources-03.js | 45 + devtools/server/tests/xpcshell/test_logpoint-01.js | 83 ++ devtools/server/tests/xpcshell/test_logpoint-02.js | 85 ++ devtools/server/tests/xpcshell/test_logpoint-03.js | 82 ++ .../tests/xpcshell/test_longstringgrips-01.js | 75 ++ .../server/tests/xpcshell/test_nativewrappers.js | 39 + devtools/server/tests/xpcshell/test_nesting-03.js | 50 + devtools/server/tests/xpcshell/test_nesting-04.js | 86 ++ .../server/tests/xpcshell/test_new_source-01.js | 24 + .../server/tests/xpcshell/test_new_source-02.js | 46 + .../server/tests/xpcshell/test_nodelistactor.js | 30 + .../server/tests/xpcshell/test_objectgrips-02.js | 44 + .../server/tests/xpcshell/test_objectgrips-03.js | 52 + .../server/tests/xpcshell/test_objectgrips-04.js | 54 + .../server/tests/xpcshell/test_objectgrips-05.js | 56 + .../server/tests/xpcshell/test_objectgrips-06.js | 56 + .../server/tests/xpcshell/test_objectgrips-07.js | 65 ++ .../server/tests/xpcshell/test_objectgrips-08.js | 61 ++ .../server/tests/xpcshell/test_objectgrips-14.js | 55 + .../server/tests/xpcshell/test_objectgrips-15.js | 53 + .../server/tests/xpcshell/test_objectgrips-16.js | 139 +++ .../server/tests/xpcshell/test_objectgrips-17.js | 320 ++++++ .../server/tests/xpcshell/test_objectgrips-18.js | 173 +++ .../server/tests/xpcshell/test_objectgrips-19.js | 75 ++ .../server/tests/xpcshell/test_objectgrips-20.js | 387 +++++++ .../server/tests/xpcshell/test_objectgrips-21.js | 398 +++++++ .../server/tests/xpcshell/test_objectgrips-22.js | 50 + .../server/tests/xpcshell/test_objectgrips-23.js | 45 + .../server/tests/xpcshell/test_objectgrips-24.js | 57 + .../server/tests/xpcshell/test_objectgrips-25.js | 131 +++ .../tests/xpcshell/test_objectgrips-fn-apply-01.js | 117 ++ .../tests/xpcshell/test_objectgrips-fn-apply-02.js | 56 + .../tests/xpcshell/test_objectgrips-fn-apply-03.js | 51 + .../xpcshell/test_objectgrips-nested-promise.js | 56 + .../xpcshell/test_objectgrips-nested-proxy.js | 51 + .../xpcshell/test_objectgrips-property-value-01.js | 148 +++ .../xpcshell/test_objectgrips-property-value-02.js | 53 + .../xpcshell/test_objectgrips-property-value-03.js | 63 ++ .../xpcshell/test_objectgrips-sparse-array.js | 40 + .../tests/xpcshell/test_pause_exceptions-01.js | 43 + .../tests/xpcshell/test_pause_exceptions-02.js | 40 + .../tests/xpcshell/test_pause_exceptions-03.js | 53 + .../tests/xpcshell/test_pause_exceptions-04.js | 93 ++ .../server/tests/xpcshell/test_pauselifetime-01.js | 54 + .../server/tests/xpcshell/test_pauselifetime-02.js | 57 + .../server/tests/xpcshell/test_pauselifetime-03.js | 64 ++ .../server/tests/xpcshell/test_pauselifetime-04.js | 40 + .../server/tests/xpcshell/test_promise_state-01.js | 44 + .../server/tests/xpcshell/test_promise_state-02.js | 59 + .../server/tests/xpcshell/test_promise_state-03.js | 58 + .../xpcshell/test_promises_run_to_completion.js | 132 +++ .../server/tests/xpcshell/test_register_actor.js | 94 ++ .../server/tests/xpcshell/test_requestTypes.js | 28 + .../server/tests/xpcshell/test_restartFrame-01.js | 118 ++ devtools/server/tests/xpcshell/test_safe-getter.js | 54 + .../tests/xpcshell/test_sessionDataHelpers.js | 79 ++ ...Breakpoint-at-the-beginning-of-a-minified-fn.js | 41 + ...st_setBreakpoint-at-the-end-of-a-minified-fn.js | 41 + .../test_setBreakpoint-on-column-in-gcd-script.js | 46 + .../tests/xpcshell/test_setBreakpoint-on-column.js | 36 + .../test_setBreakpoint-on-line-in-gcd-script.js | 45 + ..._setBreakpoint-on-line-with-multiple-offsets.js | 52 + ...tBreakpoint-on-line-with-multiple-statements.js | 38 + ...kpoint-on-line-with-no-offsets-in-gcd-script.js | 56 + .../test_setBreakpoint-on-line-with-no-offsets.js | 44 + .../tests/xpcshell/test_setBreakpoint-on-line.js | 36 + .../xpcshell/test_shapes_highlighter_helpers.js | 274 +++++ devtools/server/tests/xpcshell/test_source-01.js | 58 + devtools/server/tests/xpcshell/test_source-02.js | 64 ++ devtools/server/tests/xpcshell/test_source-03.js | 75 ++ devtools/server/tests/xpcshell/test_source-04.js | 74 ++ devtools/server/tests/xpcshell/test_stepping-01.js | 94 ++ devtools/server/tests/xpcshell/test_stepping-02.js | 57 + devtools/server/tests/xpcshell/test_stepping-03.js | 43 + devtools/server/tests/xpcshell/test_stepping-04.js | 50 + devtools/server/tests/xpcshell/test_stepping-05.js | 0 devtools/server/tests/xpcshell/test_stepping-06.js | 0 devtools/server/tests/xpcshell/test_stepping-07.js | 0 devtools/server/tests/xpcshell/test_stepping-08.js | 0 devtools/server/tests/xpcshell/test_stepping-09.js | 47 + devtools/server/tests/xpcshell/test_stepping-10.js | 52 + devtools/server/tests/xpcshell/test_stepping-11.js | 25 + devtools/server/tests/xpcshell/test_stepping-12.js | 162 +++ devtools/server/tests/xpcshell/test_stepping-13.js | 39 + devtools/server/tests/xpcshell/test_stepping-14.js | 52 + devtools/server/tests/xpcshell/test_stepping-15.js | 78 ++ devtools/server/tests/xpcshell/test_stepping-16.js | 81 ++ devtools/server/tests/xpcshell/test_stepping-17.js | 69 ++ devtools/server/tests/xpcshell/test_stepping-18.js | 100 ++ devtools/server/tests/xpcshell/test_stepping-19.js | 93 ++ .../test_stepping-with-skip-breakpoints.js | 84 ++ devtools/server/tests/xpcshell/test_symbolactor.js | 53 + devtools/server/tests/xpcshell/test_symbols-01.js | 50 + devtools/server/tests/xpcshell/test_symbols-02.js | 44 + .../tests/xpcshell/test_threadlifetime-01.js | 56 + .../tests/xpcshell/test_threadlifetime-02.js | 73 ++ .../tests/xpcshell/test_threadlifetime-04.js | 63 ++ .../tests/xpcshell/test_unsafeDereference.js | 130 +++ .../server/tests/xpcshell/test_wasm_source-01.js | 143 +++ .../server/tests/xpcshell/test_watchpoint-01.js | 197 ++++ .../server/tests/xpcshell/test_watchpoint-02.js | 223 ++++ .../server/tests/xpcshell/test_watchpoint-03.js | 72 ++ .../server/tests/xpcshell/test_watchpoint-04.js | 78 ++ .../server/tests/xpcshell/test_watchpoint-05.js | 113 ++ devtools/server/tests/xpcshell/test_webext_apis.js | 162 +++ .../tests/xpcshell/test_webextension_descriptor.js | 141 +++ .../tests/xpcshell/test_xpcshell_debugging.js | 90 ++ devtools/server/tests/xpcshell/testactors.js | 242 ++++ .../server/tests/xpcshell/webextension-helpers.js | 197 ++++ devtools/server/tests/xpcshell/xpcshell.ini | 249 +++++ .../tests/xpcshell/xpcshell_debugging_script.js | 11 + 436 files changed, 39662 insertions(+) create mode 100644 devtools/server/tests/browser/animation-data.html create mode 100644 devtools/server/tests/browser/animation.html create mode 100644 devtools/server/tests/browser/application-manifest-404-manifest.html create mode 100644 devtools/server/tests/browser/application-manifest-basic.html create mode 100644 devtools/server/tests/browser/application-manifest-invalid-json.html create mode 100644 devtools/server/tests/browser/application-manifest-no-manifest.html create mode 100644 devtools/server/tests/browser/application-manifest-warnings.html create mode 100644 devtools/server/tests/browser/browser.ini create mode 100644 devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js create mode 100644 devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js create mode 100644 devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js create mode 100644 devtools/server/tests/browser/browser_accessibility_infobar_show.js create mode 100644 devtools/server/tests/browser/browser_accessibility_keyboard_audit.js create mode 100644 devtools/server/tests/browser/browser_accessibility_node.js create mode 100644 devtools/server/tests/browser/browser_accessibility_node_audit.js create mode 100644 devtools/server/tests/browser/browser_accessibility_node_events.js create mode 100644 devtools/server/tests/browser/browser_accessibility_node_tabbing_order_highlighter.js create mode 100644 devtools/server/tests/browser/browser_accessibility_simple.js create mode 100644 devtools/server/tests/browser/browser_accessibility_simulator.js create mode 100644 devtools/server/tests/browser/browser_accessibility_tabbing_order_highlighter.js create mode 100644 devtools/server/tests/browser/browser_accessibility_text_label_audit.js create mode 100644 devtools/server/tests/browser/browser_accessibility_text_label_audit_frame.js create mode 100644 devtools/server/tests/browser/browser_accessibility_walker.js create mode 100644 devtools/server/tests/browser/browser_accessibility_walker_audit.js create mode 100644 devtools/server/tests/browser/browser_actor_error.js create mode 100644 devtools/server/tests/browser/browser_animation_actor-lifetime.js create mode 100644 devtools/server/tests/browser/browser_animation_emitMutations.js create mode 100644 devtools/server/tests/browser/browser_animation_getMultipleStates.js create mode 100644 devtools/server/tests/browser/browser_animation_getPlayers.js create mode 100644 devtools/server/tests/browser/browser_animation_getStateAfterFinished.js create mode 100644 devtools/server/tests/browser/browser_animation_getSubTreeAnimations.js create mode 100644 devtools/server/tests/browser/browser_animation_keepFinished.js create mode 100644 devtools/server/tests/browser/browser_animation_playPauseIframe.js create mode 100644 devtools/server/tests/browser/browser_animation_playPauseSeveral.js create mode 100644 devtools/server/tests/browser/browser_animation_playerState.js create mode 100644 devtools/server/tests/browser/browser_animation_reconstructState.js create mode 100644 devtools/server/tests/browser/browser_animation_refreshTransitions.js create mode 100644 devtools/server/tests/browser/browser_animation_setCurrentTime.js create mode 100644 devtools/server/tests/browser/browser_animation_setPlaybackRate.js create mode 100644 devtools/server/tests/browser/browser_animation_simple.js create mode 100644 devtools/server/tests/browser/browser_animation_updatedState.js create mode 100644 devtools/server/tests/browser/browser_application_manifest.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_01.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_02.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_03.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_04.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_05.js create mode 100644 devtools/server/tests/browser/browser_canvasframe_helper_06.js create mode 100644 devtools/server/tests/browser/browser_compatibility_cssIssues.js create mode 100644 devtools/server/tests/browser/browser_connectToFrame.js create mode 100644 devtools/server/tests/browser/browser_debugger_server.js create mode 100644 devtools/server/tests/browser/browser_getProcess.js create mode 100644 devtools/server/tests/browser/browser_inspector-anonymous.js create mode 100644 devtools/server/tests/browser/browser_inspector-iframe.js create mode 100644 devtools/server/tests/browser/browser_inspector-insert.js create mode 100644 devtools/server/tests/browser/browser_inspector-isScrollable.js create mode 100644 devtools/server/tests/browser/browser_inspector-mutations-childlist.js create mode 100644 devtools/server/tests/browser/browser_inspector-release.js create mode 100644 devtools/server/tests/browser/browser_inspector-remove.js create mode 100644 devtools/server/tests/browser/browser_inspector-retain.js create mode 100644 devtools/server/tests/browser/browser_inspector-search.js create mode 100644 devtools/server/tests/browser/browser_inspector-shadow.js create mode 100644 devtools/server/tests/browser/browser_inspector-traversal.js create mode 100644 devtools/server/tests/browser/browser_inspector-utils.js create mode 100644 devtools/server/tests/browser/browser_layout_getGrids.js create mode 100644 devtools/server/tests/browser/browser_layout_simple.js create mode 100644 devtools/server/tests/browser/browser_memory_allocations_01.js create mode 100644 devtools/server/tests/browser/browser_perf-01.js create mode 100644 devtools/server/tests/browser/browser_perf-02.js create mode 100644 devtools/server/tests/browser/browser_perf-04.js create mode 100644 devtools/server/tests/browser/browser_perf-getSupportedFeatures.js create mode 100644 devtools/server/tests/browser/browser_storage_cookies-duplicate-names.js create mode 100644 devtools/server/tests/browser/browser_storage_dynamic_windows.js create mode 100644 devtools/server/tests/browser/browser_storage_listings.js create mode 100644 devtools/server/tests/browser/browser_storage_updates.js create mode 100644 devtools/server/tests/browser/browser_style_utils_getFontPreviewData.js create mode 100644 devtools/server/tests/browser/browser_styles_getRuleText.js create mode 100644 devtools/server/tests/browser/browser_stylesheets_getTextEmpty.js create mode 100644 devtools/server/tests/browser/director-script-target.html create mode 100644 devtools/server/tests/browser/doc_accessibility.html create mode 100644 devtools/server/tests/browser/doc_accessibility_audit.html create mode 100644 devtools/server/tests/browser/doc_accessibility_infobar.html create mode 100644 devtools/server/tests/browser/doc_accessibility_keyboard_audit.html create mode 100644 devtools/server/tests/browser/doc_accessibility_text_label_audit.html create mode 100644 devtools/server/tests/browser/doc_accessibility_text_label_audit_frame.html create mode 100644 devtools/server/tests/browser/doc_allocations.html create mode 100644 devtools/server/tests/browser/doc_compatibility.html create mode 100644 devtools/server/tests/browser/doc_force_cc.html create mode 100644 devtools/server/tests/browser/doc_force_gc.html create mode 100644 devtools/server/tests/browser/doc_iframe.html create mode 100644 devtools/server/tests/browser/doc_iframe2.html create mode 100644 devtools/server/tests/browser/doc_iframe_content.html create mode 100644 devtools/server/tests/browser/doc_innerHTML.html create mode 100644 devtools/server/tests/browser/error-actor.js create mode 100644 devtools/server/tests/browser/grid.html create mode 100644 devtools/server/tests/browser/head.js create mode 100644 devtools/server/tests/browser/inspector-helpers.js create mode 100644 devtools/server/tests/browser/inspector-isScrollable-data.html create mode 100644 devtools/server/tests/browser/inspector-search-data.html create mode 100644 devtools/server/tests/browser/inspector-shadow.html create mode 100644 devtools/server/tests/browser/inspector-traversal-data.html create mode 100644 devtools/server/tests/browser/storage-cookies-same-name.html create mode 100644 devtools/server/tests/browser/storage-dynamic-windows.html create mode 100644 devtools/server/tests/browser/storage-helpers.js create mode 100644 devtools/server/tests/browser/storage-listings.html create mode 100644 devtools/server/tests/browser/storage-secured-iframe.html create mode 100644 devtools/server/tests/browser/storage-unsecured-iframe.html create mode 100644 devtools/server/tests/browser/storage-updates.html create mode 100644 devtools/server/tests/browser/test-errors-actor.js create mode 100644 devtools/server/tests/browser/test-window.xhtml create mode 100644 devtools/server/tests/chrome/Debugger.Source.prototype.element-2.js create mode 100644 devtools/server/tests/chrome/Debugger.Source.prototype.element.html create mode 100644 devtools/server/tests/chrome/Debugger.Source.prototype.element.js create mode 100644 devtools/server/tests/chrome/chrome.ini create mode 100644 devtools/server/tests/chrome/doc_Debugger.Source.prototype.introductionType.xhtml create mode 100644 devtools/server/tests/chrome/hello-actor.js create mode 100644 devtools/server/tests/chrome/iframe1_makeGlobalObjectReference.html create mode 100644 devtools/server/tests/chrome/iframe2_makeGlobalObjectReference.html create mode 100644 devtools/server/tests/chrome/inactive-property-helper/align-content.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/border-image.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/flex-grid-item-properties.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/float.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/gap.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/grid-container-properties.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/grid-with-absolute-properties.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/margin-padding.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/max-min-width-height.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/place-items-content.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/positioned.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/scroll-padding.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/table.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/text-overflow.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/vertical-align.mjs create mode 100644 devtools/server/tests/chrome/inactive-property-helper/width-height-ruby.mjs create mode 100644 devtools/server/tests/chrome/inspector-delay-image-response.sjs create mode 100644 devtools/server/tests/chrome/inspector-eyedropper.html create mode 100644 devtools/server/tests/chrome/inspector-helpers.js create mode 100644 devtools/server/tests/chrome/inspector-search-data.html create mode 100644 devtools/server/tests/chrome/inspector-styles-data.css create mode 100644 devtools/server/tests/chrome/inspector-styles-data.html create mode 100644 devtools/server/tests/chrome/inspector-template.html create mode 100644 devtools/server/tests/chrome/inspector-traversal-data.html create mode 100644 devtools/server/tests/chrome/inspector_css-properties.html create mode 100644 devtools/server/tests/chrome/inspector_display-type.html create mode 100644 devtools/server/tests/chrome/inspector_getImageData.html create mode 100644 devtools/server/tests/chrome/inspector_getOffsetParent.html create mode 100644 devtools/server/tests/chrome/large-image.jpg create mode 100644 devtools/server/tests/chrome/memory-helpers.js create mode 100644 devtools/server/tests/chrome/nonchrome_unsafeDereference.html create mode 100644 devtools/server/tests/chrome/small-image.gif create mode 100644 devtools/server/tests/chrome/suspendTimeouts_content.html create mode 100644 devtools/server/tests/chrome/suspendTimeouts_content.js create mode 100644 devtools/server/tests/chrome/suspendTimeouts_worker.js create mode 100644 devtools/server/tests/chrome/test_Debugger.Script.prototype.global.html create mode 100644 devtools/server/tests/chrome/test_Debugger.Source.prototype.elementAttribute.html create mode 100644 devtools/server/tests/chrome/test_Debugger.Source.prototype.introductionScript.html create mode 100644 devtools/server/tests/chrome/test_Debugger.Source.prototype.introductionType.html create mode 100644 devtools/server/tests/chrome/test_animation-type-longhand.html create mode 100644 devtools/server/tests/chrome/test_css-logic-media-queries.html create mode 100644 devtools/server/tests/chrome/test_css-logic-specificity.html create mode 100644 devtools/server/tests/chrome/test_css-logic.html create mode 100644 devtools/server/tests/chrome/test_css-properties.html create mode 100644 devtools/server/tests/chrome/test_device.html create mode 100644 devtools/server/tests/chrome/test_executeInGlobal-outerized_this.html create mode 100644 devtools/server/tests/chrome/test_highlighter_paused_debugger.html create mode 100644 devtools/server/tests/chrome/test_inspector-changeattrs.html create mode 100644 devtools/server/tests/chrome/test_inspector-changevalue.html create mode 100644 devtools/server/tests/chrome/test_inspector-display-type.html create mode 100644 devtools/server/tests/chrome/test_inspector-duplicate-node.html create mode 100644 devtools/server/tests/chrome/test_inspector-hide.html create mode 100644 devtools/server/tests/chrome/test_inspector-inactive-property-helper.html create mode 100644 devtools/server/tests/chrome/test_inspector-mutations-attr.html create mode 100644 devtools/server/tests/chrome/test_inspector-mutations-events.html create mode 100644 devtools/server/tests/chrome/test_inspector-mutations-value.html create mode 100644 devtools/server/tests/chrome/test_inspector-pick-color.html create mode 100644 devtools/server/tests/chrome/test_inspector-pseudoclass-lock.html create mode 100644 devtools/server/tests/chrome/test_inspector-reload.html create mode 100644 devtools/server/tests/chrome/test_inspector-resize.html create mode 100644 devtools/server/tests/chrome/test_inspector-resolve-url.html create mode 100644 devtools/server/tests/chrome/test_inspector-scroll-into-view.html create mode 100644 devtools/server/tests/chrome/test_inspector-search-front.html create mode 100644 devtools/server/tests/chrome/test_inspector-template.html create mode 100644 devtools/server/tests/chrome/test_inspector_getImageData-wait-for-load.html create mode 100644 devtools/server/tests/chrome/test_inspector_getImageData.html create mode 100644 devtools/server/tests/chrome/test_inspector_getImageDataFromURL.html create mode 100644 devtools/server/tests/chrome/test_inspector_getNodeFromActor.html create mode 100644 devtools/server/tests/chrome/test_inspector_getOffsetParent.html create mode 100644 devtools/server/tests/chrome/test_makeGlobalObjectReference.html create mode 100644 devtools/server/tests/chrome/test_memory.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_02.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_03.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_04.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_05.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_06.html create mode 100644 devtools/server/tests/chrome/test_memory_allocations_07.html create mode 100644 devtools/server/tests/chrome/test_memory_attach_01.html create mode 100644 devtools/server/tests/chrome/test_memory_attach_02.html create mode 100644 devtools/server/tests/chrome/test_memory_census.html create mode 100644 devtools/server/tests/chrome/test_memory_gc_01.html create mode 100644 devtools/server/tests/chrome/test_memory_gc_events.html create mode 100644 devtools/server/tests/chrome/test_overflowing-body.html create mode 100644 devtools/server/tests/chrome/test_overflowing-children.html create mode 100644 devtools/server/tests/chrome/test_preference.html create mode 100644 devtools/server/tests/chrome/test_styles-applied.html create mode 100644 devtools/server/tests/chrome/test_styles-computed.html create mode 100644 devtools/server/tests/chrome/test_styles-layout.html create mode 100644 devtools/server/tests/chrome/test_styles-matched.html create mode 100644 devtools/server/tests/chrome/test_styles-modify.html create mode 100644 devtools/server/tests/chrome/test_styles-svg.html create mode 100644 devtools/server/tests/chrome/test_suspendTimeouts.html create mode 100644 devtools/server/tests/chrome/test_suspendTimeouts.js create mode 100644 devtools/server/tests/chrome/test_unsafeDereference.html create mode 100644 devtools/server/tests/chrome/test_webconsole-node-grip.html create mode 100644 devtools/server/tests/chrome/webconsole-helpers.js create mode 100644 devtools/server/tests/xpcshell/.eslintrc.js create mode 100644 devtools/server/tests/xpcshell/addons/web-extension-upgrade/manifest.json create mode 100644 devtools/server/tests/xpcshell/addons/web-extension/manifest.json create mode 100644 devtools/server/tests/xpcshell/addons/web-extension2/manifest.json create mode 100644 devtools/server/tests/xpcshell/completions.js create mode 100644 devtools/server/tests/xpcshell/head_dbg.js create mode 100644 devtools/server/tests/xpcshell/hello-actor.js create mode 100644 devtools/server/tests/xpcshell/post_init_global_actors.js create mode 100644 devtools/server/tests/xpcshell/post_init_target_scoped_actors.js create mode 100644 devtools/server/tests/xpcshell/pre_init_global_actors.js create mode 100644 devtools/server/tests/xpcshell/pre_init_target_scoped_actors.js create mode 100644 devtools/server/tests/xpcshell/registertestactors-lazy.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-column-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-column-minified.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-column-with-no-offsets-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-column-with-no-offsets.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-column.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line-with-multiple-offsets.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line-with-multiple-statements.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line-with-no-offsets-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line-with-no-offsets.js create mode 100644 devtools/server/tests/xpcshell/setBreakpoint-on-line.js create mode 100644 devtools/server/tests/xpcshell/source-03.js create mode 100644 devtools/server/tests/xpcshell/source-map-data/sourcemapped.coffee create mode 100644 devtools/server/tests/xpcshell/source-map-data/sourcemapped.map create mode 100644 devtools/server/tests/xpcshell/sourcemapped.js create mode 100644 devtools/server/tests/xpcshell/stepping-async.js create mode 100644 devtools/server/tests/xpcshell/stepping.js create mode 100644 devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_01.js create mode 100644 devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_02.js create mode 100644 devtools/server/tests/xpcshell/test_MemoryActor_saveHeapSnapshot_03.js create mode 100644 devtools/server/tests/xpcshell/test_add_actors.js create mode 100644 devtools/server/tests/xpcshell/test_addon_debugging_connect.js create mode 100644 devtools/server/tests/xpcshell/test_addon_events.js create mode 100644 devtools/server/tests/xpcshell/test_addon_reload.js create mode 100644 devtools/server/tests/xpcshell/test_addons_actor.js create mode 100644 devtools/server/tests/xpcshell/test_animation_name.js create mode 100644 devtools/server/tests/xpcshell/test_animation_type.js create mode 100644 devtools/server/tests/xpcshell/test_attach.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-01.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-02.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-03.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-04.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-05.js create mode 100644 devtools/server/tests/xpcshell/test_blackboxing-08.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-01.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-03.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-04.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-05.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-06.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-07.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-08.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-09.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-10.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-11.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-12.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-13.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-14.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-16.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-17.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-18.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-19.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-20.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-21.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-22.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-23.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-24.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-25.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-26.js create mode 100644 devtools/server/tests/xpcshell/test_breakpoint-actor-map.js create mode 100644 devtools/server/tests/xpcshell/test_client_request.js create mode 100644 devtools/server/tests/xpcshell/test_conditional_breakpoint-01.js create mode 100644 devtools/server/tests/xpcshell/test_conditional_breakpoint-02.js create mode 100644 devtools/server/tests/xpcshell/test_conditional_breakpoint-03.js create mode 100644 devtools/server/tests/xpcshell/test_conditional_breakpoint-04.js create mode 100644 devtools/server/tests/xpcshell/test_connection_closes_all_pools.js create mode 100644 devtools/server/tests/xpcshell/test_console_eval-01.js create mode 100644 devtools/server/tests/xpcshell/test_console_eval-02.js create mode 100644 devtools/server/tests/xpcshell/test_dbgactor.js create mode 100644 devtools/server/tests/xpcshell/test_dbgclient_debuggerstatement.js create mode 100644 devtools/server/tests/xpcshell/test_dbgglobal.js create mode 100644 devtools/server/tests/xpcshell/test_extension_storage_actor.js create mode 100644 devtools/server/tests/xpcshell/test_extension_storage_actor_upgrade.js create mode 100644 devtools/server/tests/xpcshell/test_format_command.js create mode 100644 devtools/server/tests/xpcshell/test_forwardingprefix.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor-01.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor-02.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor-03.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor-04.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor-05.js create mode 100644 devtools/server/tests/xpcshell/test_frameactor_wasm-01.js create mode 100644 devtools/server/tests/xpcshell/test_framearguments-01.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-01.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-02.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-03.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-04.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-05.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-06.js create mode 100644 devtools/server/tests/xpcshell/test_framebindings-07.js create mode 100644 devtools/server/tests/xpcshell/test_front_destroy.js create mode 100644 devtools/server/tests/xpcshell/test_functiongrips-01.js create mode 100644 devtools/server/tests/xpcshell/test_getRuleText.js create mode 100644 devtools/server/tests/xpcshell/test_getTextAtLineColumn.js create mode 100644 devtools/server/tests/xpcshell/test_getyoungestframe.js create mode 100644 devtools/server/tests/xpcshell/test_ignore_caught_exceptions.js create mode 100644 devtools/server/tests/xpcshell/test_ignore_no_interface_exceptions.js create mode 100644 devtools/server/tests/xpcshell/test_interrupt.js create mode 100644 devtools/server/tests/xpcshell/test_layout-reflows-observer.js create mode 100644 devtools/server/tests/xpcshell/test_listsources-01.js create mode 100644 devtools/server/tests/xpcshell/test_listsources-02.js create mode 100644 devtools/server/tests/xpcshell/test_listsources-03.js create mode 100644 devtools/server/tests/xpcshell/test_logpoint-01.js create mode 100644 devtools/server/tests/xpcshell/test_logpoint-02.js create mode 100644 devtools/server/tests/xpcshell/test_logpoint-03.js create mode 100644 devtools/server/tests/xpcshell/test_longstringgrips-01.js create mode 100644 devtools/server/tests/xpcshell/test_nativewrappers.js create mode 100644 devtools/server/tests/xpcshell/test_nesting-03.js create mode 100644 devtools/server/tests/xpcshell/test_nesting-04.js create mode 100644 devtools/server/tests/xpcshell/test_new_source-01.js create mode 100644 devtools/server/tests/xpcshell/test_new_source-02.js create mode 100644 devtools/server/tests/xpcshell/test_nodelistactor.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-02.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-03.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-04.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-05.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-06.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-07.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-08.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-14.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-15.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-16.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-17.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-18.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-19.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-20.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-21.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-22.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-23.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-24.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-25.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-fn-apply-01.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-fn-apply-02.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-fn-apply-03.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-nested-promise.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-nested-proxy.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-property-value-01.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-property-value-02.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-property-value-03.js create mode 100644 devtools/server/tests/xpcshell/test_objectgrips-sparse-array.js create mode 100644 devtools/server/tests/xpcshell/test_pause_exceptions-01.js create mode 100644 devtools/server/tests/xpcshell/test_pause_exceptions-02.js create mode 100644 devtools/server/tests/xpcshell/test_pause_exceptions-03.js create mode 100644 devtools/server/tests/xpcshell/test_pause_exceptions-04.js create mode 100644 devtools/server/tests/xpcshell/test_pauselifetime-01.js create mode 100644 devtools/server/tests/xpcshell/test_pauselifetime-02.js create mode 100644 devtools/server/tests/xpcshell/test_pauselifetime-03.js create mode 100644 devtools/server/tests/xpcshell/test_pauselifetime-04.js create mode 100644 devtools/server/tests/xpcshell/test_promise_state-01.js create mode 100644 devtools/server/tests/xpcshell/test_promise_state-02.js create mode 100644 devtools/server/tests/xpcshell/test_promise_state-03.js create mode 100644 devtools/server/tests/xpcshell/test_promises_run_to_completion.js create mode 100644 devtools/server/tests/xpcshell/test_register_actor.js create mode 100644 devtools/server/tests/xpcshell/test_requestTypes.js create mode 100644 devtools/server/tests/xpcshell/test_restartFrame-01.js create mode 100644 devtools/server/tests/xpcshell/test_safe-getter.js create mode 100644 devtools/server/tests/xpcshell/test_sessionDataHelpers.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-at-the-beginning-of-a-minified-fn.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-at-the-end-of-a-minified-fn.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-column-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-column.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line-with-multiple-offsets.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line-with-multiple-statements.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line-with-no-offsets.js create mode 100644 devtools/server/tests/xpcshell/test_setBreakpoint-on-line.js create mode 100644 devtools/server/tests/xpcshell/test_shapes_highlighter_helpers.js create mode 100644 devtools/server/tests/xpcshell/test_source-01.js create mode 100644 devtools/server/tests/xpcshell/test_source-02.js create mode 100644 devtools/server/tests/xpcshell/test_source-03.js create mode 100644 devtools/server/tests/xpcshell/test_source-04.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-01.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-02.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-03.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-04.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-05.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-06.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-07.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-08.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-09.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-10.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-11.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-12.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-13.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-14.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-15.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-16.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-17.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-18.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-19.js create mode 100644 devtools/server/tests/xpcshell/test_stepping-with-skip-breakpoints.js create mode 100644 devtools/server/tests/xpcshell/test_symbolactor.js create mode 100644 devtools/server/tests/xpcshell/test_symbols-01.js create mode 100644 devtools/server/tests/xpcshell/test_symbols-02.js create mode 100644 devtools/server/tests/xpcshell/test_threadlifetime-01.js create mode 100644 devtools/server/tests/xpcshell/test_threadlifetime-02.js create mode 100644 devtools/server/tests/xpcshell/test_threadlifetime-04.js create mode 100644 devtools/server/tests/xpcshell/test_unsafeDereference.js create mode 100644 devtools/server/tests/xpcshell/test_wasm_source-01.js create mode 100644 devtools/server/tests/xpcshell/test_watchpoint-01.js create mode 100644 devtools/server/tests/xpcshell/test_watchpoint-02.js create mode 100644 devtools/server/tests/xpcshell/test_watchpoint-03.js create mode 100644 devtools/server/tests/xpcshell/test_watchpoint-04.js create mode 100644 devtools/server/tests/xpcshell/test_watchpoint-05.js create mode 100644 devtools/server/tests/xpcshell/test_webext_apis.js create mode 100644 devtools/server/tests/xpcshell/test_webextension_descriptor.js create mode 100644 devtools/server/tests/xpcshell/test_xpcshell_debugging.js create mode 100644 devtools/server/tests/xpcshell/testactors.js create mode 100644 devtools/server/tests/xpcshell/webextension-helpers.js create mode 100644 devtools/server/tests/xpcshell/xpcshell.ini create mode 100644 devtools/server/tests/xpcshell/xpcshell_debugging_script.js (limited to 'devtools/server/tests') diff --git a/devtools/server/tests/browser/animation-data.html b/devtools/server/tests/browser/animation-data.html new file mode 100644 index 0000000000..1ee654cb17 --- /dev/null +++ b/devtools/server/tests/browser/animation-data.html @@ -0,0 +1,115 @@ + + + + Animation Test Data + + + +
+
+
+
+
+
+
+
+
+ + diff --git a/devtools/server/tests/browser/animation.html b/devtools/server/tests/browser/animation.html new file mode 100644 index 0000000000..f7b83df283 --- /dev/null +++ b/devtools/server/tests/browser/animation.html @@ -0,0 +1,170 @@ + + +
+
+
+
+
+
+
+
+
+
+
+ diff --git a/devtools/server/tests/browser/application-manifest-404-manifest.html b/devtools/server/tests/browser/application-manifest-404-manifest.html new file mode 100644 index 0000000000..fd182a69a6 --- /dev/null +++ b/devtools/server/tests/browser/application-manifest-404-manifest.html @@ -0,0 +1,10 @@ + + + + + Simple manifest + + + +

This page links to a manifest URL that is a 404.

+ diff --git a/devtools/server/tests/browser/application-manifest-basic.html b/devtools/server/tests/browser/application-manifest-basic.html new file mode 100644 index 0000000000..a8e11a645f --- /dev/null +++ b/devtools/server/tests/browser/application-manifest-basic.html @@ -0,0 +1,10 @@ + + + + + Simple manifest + + + +
{ "name": "Foo App" }
+ diff --git a/devtools/server/tests/browser/application-manifest-invalid-json.html b/devtools/server/tests/browser/application-manifest-invalid-json.html new file mode 100644 index 0000000000..2717a97ddd --- /dev/null +++ b/devtools/server/tests/browser/application-manifest-invalid-json.html @@ -0,0 +1,11 @@ + + + + + Invalid JSON + + + +

Invalid JSON:

+
foo:
+ diff --git a/devtools/server/tests/browser/application-manifest-no-manifest.html b/devtools/server/tests/browser/application-manifest-no-manifest.html new file mode 100644 index 0000000000..5f0668aa50 --- /dev/null +++ b/devtools/server/tests/browser/application-manifest-no-manifest.html @@ -0,0 +1,9 @@ + + + + + No manifest + + +

This page does not link to a manifest

+ diff --git a/devtools/server/tests/browser/application-manifest-warnings.html b/devtools/server/tests/browser/application-manifest-warnings.html new file mode 100644 index 0000000000..57f8b9b4e7 --- /dev/null +++ b/devtools/server/tests/browser/application-manifest-warnings.html @@ -0,0 +1,10 @@ + + + + + Empty manifest + + + +
{ }
+ diff --git a/devtools/server/tests/browser/browser.ini b/devtools/server/tests/browser/browser.ini new file mode 100644 index 0000000000..771bd6f95f --- /dev/null +++ b/devtools/server/tests/browser/browser.ini @@ -0,0 +1,151 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +skip-if = http3 # Bug 1829298 +support-files = + head.js + animation.html + animation-data.html + application-manifest-404-manifest.html + application-manifest-basic.html + application-manifest-invalid-json.html + application-manifest-no-manifest.html + application-manifest-warnings.html + doc_accessibility_audit.html + doc_accessibility_infobar.html + doc_accessibility_keyboard_audit.html + doc_accessibility_text_label_audit_frame.html + doc_accessibility_text_label_audit.html + doc_accessibility.html + doc_allocations.html + doc_compatibility.html + doc_force_cc.html + doc_force_gc.html + doc_innerHTML.html + doc_iframe.html + doc_iframe_content.html + doc_iframe2.html + error-actor.js + grid.html + inspector-isScrollable-data.html + inspector-search-data.html + inspector-traversal-data.html + inspector-shadow.html + storage-cookies-same-name.html + storage-dynamic-windows.html + storage-listings.html + storage-unsecured-iframe.html + storage-updates.html + storage-secured-iframe.html + test-errors-actor.js + test-window.xhtml + inspector-helpers.js + storage-helpers.js + !/devtools/client/shared/test/shared-head.js + !/devtools/client/shared/test/telemetry-test-helpers.js + !/devtools/server/tests/chrome/hello-actor.js + +[browser_accessibility_highlighter_infobar.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_infobar_show.js] +[browser_accessibility_keyboard_audit.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_infobar_audit_keyboard.js] +[browser_accessibility_infobar_audit_text_label.js] +[browser_accessibility_node.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_node_audit.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_node_events.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_node_tabbing_order_highlighter.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_simple.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_simulator.js] +[browser_accessibility_tabbing_order_highlighter.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_text_label_audit_frame.js] +skip-if = + (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_text_label_audit.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_walker_audit.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_walker.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533487 +[browser_actor_error.js] +[browser_animation_actor-lifetime.js] +[browser_animation_emitMutations.js] +[browser_animation_getMultipleStates.js] +[browser_animation_getPlayers.js] +[browser_animation_getStateAfterFinished.js] +[browser_animation_getSubTreeAnimations.js] +[browser_animation_keepFinished.js] +[browser_animation_playerState.js] +[browser_animation_playPauseIframe.js] +[browser_animation_playPauseSeveral.js] +[browser_animation_reconstructState.js] +[browser_animation_refreshTransitions.js] +[browser_animation_setCurrentTime.js] +[browser_animation_setPlaybackRate.js] +[browser_animation_simple.js] +[browser_animation_updatedState.js] +[browser_application_manifest.js] +[browser_canvasframe_helper_01.js] +skip-if = true # Bug 1183605 +[browser_canvasframe_helper_02.js] +skip-if = true # iframe will not be loaded in xul:window with strict xhtml. +[browser_canvasframe_helper_03.js] +skip-if = true # Bug 1183605 +[browser_canvasframe_helper_04.js] +skip-if = true # Bug 1183605 +[browser_canvasframe_helper_05.js] +skip-if = true # Bug 1183605 +[browser_canvasframe_helper_06.js] +skip-if = true # Bug 1183605 +[browser_compatibility_cssIssues.js] +[browser_connectToFrame.js] +[browser_debugger_server.js] +[browser_getProcess.js] +[browser_inspector-anonymous.js] +[browser_inspector-iframe.js] +[browser_inspector-insert.js] +[browser_inspector-isScrollable.js] +[browser_inspector-mutations-childlist.js] +skip-if = + win10_2004 && fission && debug && socketprocess_networking # high frequency intermittent +[browser_inspector-release.js] +[browser_inspector-remove.js] +[browser_inspector-retain.js] +[browser_inspector-search.js] +[browser_inspector-shadow.js] +[browser_inspector-traversal.js] +[browser_inspector-utils.js] +[browser_layout_getGrids.js] +[browser_layout_simple.js] +[browser_memory_allocations_01.js] +[browser_perf-01.js] +skip-if = tsan # bug 1804081, profiler issues in TSAN +[browser_perf-02.js] +skip-if = tsan # bug 1804081, profiler issues in TSAN +[browser_perf-04.js] +skip-if = tsan # bug 1804081, profiler issues in TSAN +[browser_perf-getSupportedFeatures.js] +skip-if = tsan # bug 1804081, profiler issues in TSAN +[browser_storage_cookies-duplicate-names.js] +https_first_disabled = true +[browser_storage_dynamic_windows.js] +https_first_disabled = true +skip-if = + debug # Bug 1715916 - test is having race conditions on slow hardware + tsan # high frequency intermittent + win10_2004 && asan && fission # high frequency intermittent + win11_2009 && asan # high frequency intermittent +[browser_storage_listings.js] +https_first_disabled = true +[browser_storage_updates.js] +https_first_disabled = true +[browser_style_utils_getFontPreviewData.js] +[browser_styles_getRuleText.js] +[browser_stylesheets_getTextEmpty.js] diff --git a/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js b/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js new file mode 100644 index 0000000000..0979276230 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js @@ -0,0 +1,73 @@ +/* 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"; + +// Test the accessible highlighter's infobar content. + +const { + truncateString, +} = require("resource://devtools/shared/inspector/utils.js"); +const { + MAX_STRING_LENGTH, +} = require("resource://devtools/server/actors/highlighters/utils/accessibility.js"); + +add_task(async function () { + const { target, walker, parentAccessibility, a11yWalker } = + await initAccessibilityFrontsForUrl( + MAIN_DOMAIN + "doc_accessibility_infobar.html" + ); + + info("Button front checks"); + await checkNameAndRole(walker, "#button", a11yWalker, "Accessible Button"); + + info("Front with long name checks"); + await checkNameAndRole( + walker, + "#h1", + a11yWalker, + "Lorem ipsum dolor sit ame" + "\u2026" + "e et dolore magna aliqua." + ); + + await waitForA11yShutdown(parentAccessibility); + await target.destroy(); + gBrowser.removeCurrentTab(); +}); + +/** + * A helper function for testing the accessible's displayed name and roles. + * + * @param {Object} walker + * The DOM walker. + * @param {String} querySelector + * The selector for the node to retrieve accessible from. + * @param {Object} a11yWalker + * The accessibility walker. + * @param {String} expectedName + * Expected string content for displaying the accessible's name. + * We are testing this in particular because name can be truncated. + */ +async function checkNameAndRole( + walker, + querySelector, + a11yWalker, + expectedName +) { + const node = await walker.querySelector(walker.rootNode, querySelector); + const accessibleFront = await a11yWalker.getAccessibleFor(node); + + const { name, role } = accessibleFront; + const onHighlightEvent = a11yWalker.once("highlighter-event"); + + await a11yWalker.highlightAccessible(accessibleFront); + const { options } = await onHighlightEvent; + is(options.name, name, "Accessible highlight has correct name option"); + is(options.role, role, "Accessible highlight has correct role option"); + + is( + `"${truncateString(name, MAX_STRING_LENGTH)}"`, + `"${expectedName}"`, + "Accessible has correct displayed name." + ); +} diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js b/devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js new file mode 100644 index 0000000000..73fc7127f4 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js @@ -0,0 +1,157 @@ +/* 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"; + +// Checks for the AccessibleHighlighter's infobar component and its keyboard +// audit. + +add_task(async function () { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: MAIN_DOMAIN + "doc_accessibility_infobar.html", + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async function () { + const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" + ); + const { + HighlighterEnvironment, + } = require("resource://devtools/server/actors/highlighters.js"); + const { + AccessibleHighlighter, + } = require("resource://devtools/server/actors/highlighters/accessible.js"); + const { + LocalizationHelper, + } = require("resource://devtools/shared/l10n.js"); + const L10N = new LocalizationHelper( + "devtools/shared/locales/accessibility.properties" + ); + + const { + accessibility: { + AUDIT_TYPE, + ISSUE_TYPE: { + [AUDIT_TYPE.KEYBOARD]: { + INTERACTIVE_NO_ACTION, + FOCUSABLE_NO_SEMANTICS, + }, + }, + SCORES: { FAIL, WARNING }, + }, + } = require("resource://devtools/shared/constants.js"); + + /** + * Checks for updated content for an infobar. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @param {Object} audit + * Audit information that is passed on highlighter show. + */ + function checkKeyboard(infobar, audit) { + const { issue, score } = audit || {}; + let expected = ""; + if (issue) { + const { ISSUE_TO_INFOBAR_LABEL_MAP } = + infobar.audit.reports[AUDIT_TYPE.KEYBOARD].constructor; + expected = L10N.getStr(ISSUE_TO_INFOBAR_LABEL_MAP[issue]); + } + + is( + infobar.getTextContent("keyboard"), + expected, + "infobar keyboard audit text content is correct" + ); + if (score) { + ok(infobar.getElement("keyboard").classList.contains(score)); + } + } + + // Start testing. First, create highlighter environment and initialize. + const env = new HighlighterEnvironment(); + env.initFromWindow(content.window); + + // Wait for loading highlighter environment content to complete before creating the + // highlighter. + await new Promise(resolve => { + const doc = env.document; + + function onContentLoaded() { + if ( + doc.readyState === "interactive" || + doc.readyState === "complete" + ) { + resolve(); + } else { + doc.addEventListener("DOMContentLoaded", onContentLoaded, { + once: true, + }); + } + } + + onContentLoaded(); + }); + + // Now, we can test the Infobar's audit content. + const node = content.document.createElement("div"); + content.document.body.append(node); + const highlighter = new AccessibleHighlighter(env); + await highlighter.isReady; + const infobar = highlighter.accessibleInfobar; + const bounds = { + x: 0, + y: 0, + w: 250, + h: 100, + }; + + const tests = [ + { + desc: "Infobar is shown with no keyboard audit content when no audit.", + }, + { + desc: "Infobar is shown with no keyboard audit content when audit is null.", + audit: null, + }, + { + desc: + "Infobar is shown with no keyboard audit content when empty " + + "keyboard audit.", + audit: { [AUDIT_TYPE.KEYBOARD]: null }, + }, + { + desc: "Infobar is shown with keyboard audit content for an error.", + audit: { + [AUDIT_TYPE.KEYBOARD]: { + score: FAIL, + issue: INTERACTIVE_NO_ACTION, + }, + }, + }, + { + desc: "Infobar is shown with keyboard audit content for a warning.", + audit: { + [AUDIT_TYPE.KEYBOARD]: { + score: WARNING, + issue: FOCUSABLE_NO_SEMANTICS, + }, + }, + }, + ]; + + for (const test of tests) { + const { desc, audit } = test; + + info(desc); + highlighter.show(node, { ...bounds, audit }); + checkKeyboard(infobar, audit && audit[AUDIT_TYPE.KEYBOARD]); + highlighter.hide(); + } + }); + } + ); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js b/devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js new file mode 100644 index 0000000000..a4e2d895ee --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js @@ -0,0 +1,164 @@ +/* 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"; + +// Checks for the AccessibleHighlighter's infobar component and its text label +// audit. + +add_task(async function () { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: MAIN_DOMAIN + "doc_accessibility_infobar.html", + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async function () { + const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" + ); + const { + HighlighterEnvironment, + } = require("resource://devtools/server/actors/highlighters.js"); + const { + AccessibleHighlighter, + } = require("resource://devtools/server/actors/highlighters/accessible.js"); + const { + LocalizationHelper, + } = require("resource://devtools/shared/l10n.js"); + const L10N = new LocalizationHelper( + "devtools/shared/locales/accessibility.properties" + ); + + const { + accessibility: { + AUDIT_TYPE, + ISSUE_TYPE: { + [AUDIT_TYPE.TEXT_LABEL]: { + DIALOG_NO_NAME, + FORM_NO_VISIBLE_NAME, + TOOLBAR_NO_NAME, + }, + }, + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, + } = require("resource://devtools/shared/constants.js"); + + /** + * Checks for updated content for an infobar. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @param {Object} audit + * Audit information that is passed on highlighter show. + */ + function checkTextLabel(infobar, audit) { + const { issue, score } = audit || {}; + let expected = ""; + if (issue) { + const { ISSUE_TO_INFOBAR_LABEL_MAP } = + infobar.audit.reports[AUDIT_TYPE.TEXT_LABEL].constructor; + expected = L10N.getStr(ISSUE_TO_INFOBAR_LABEL_MAP[issue]); + } + + is( + infobar.getTextContent("text-label"), + expected, + "infobar text label audit text content is correct" + ); + if (score) { + ok(infobar.getElement("text-label").classList.contains(score)); + } + } + + // Start testing. First, create highlighter environment and initialize. + const env = new HighlighterEnvironment(); + env.initFromWindow(content.window); + + // Wait for loading highlighter environment content to complete before creating the + // highlighter. + await new Promise(resolve => { + const doc = env.document; + + function onContentLoaded() { + if ( + doc.readyState === "interactive" || + doc.readyState === "complete" + ) { + resolve(); + } else { + doc.addEventListener("DOMContentLoaded", onContentLoaded, { + once: true, + }); + } + } + + onContentLoaded(); + }); + + // Now, we can test the Infobar's audit content. + const node = content.document.createElement("div"); + content.document.body.append(node); + const highlighter = new AccessibleHighlighter(env); + await highlighter.isReady; + const infobar = highlighter.accessibleInfobar; + const bounds = { + x: 0, + y: 0, + w: 250, + h: 100, + }; + + const tests = [ + { + desc: "Infobar is shown with no text label audit content when no audit.", + }, + { + desc: "Infobar is shown with no text label audit content when audit is null.", + audit: null, + }, + { + desc: + "Infobar is shown with no text label audit content when empty " + + "text label audit.", + audit: { [AUDIT_TYPE.TEXT_LABEL]: null }, + }, + { + desc: "Infobar is shown with text label audit content for an error.", + audit: { + [AUDIT_TYPE.TEXT_LABEL]: { score: FAIL, issue: TOOLBAR_NO_NAME }, + }, + }, + { + desc: "Infobar is shown with text label audit content for a warning.", + audit: { + [AUDIT_TYPE.TEXT_LABEL]: { + score: WARNING, + issue: FORM_NO_VISIBLE_NAME, + }, + }, + }, + { + desc: "Infobar is shown with text label audit content for best practices.", + audit: { + [AUDIT_TYPE.TEXT_LABEL]: { + score: BEST_PRACTICES, + issue: DIALOG_NO_NAME, + }, + }, + }, + ]; + + for (const test of tests) { + const { desc, audit } = test; + + info(desc); + highlighter.show(node, { ...bounds, audit }); + checkTextLabel(infobar, audit && audit[AUDIT_TYPE.TEXT_LABEL]); + highlighter.hide(); + } + }); + } + ); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_show.js b/devtools/server/tests/browser/browser_accessibility_infobar_show.js new file mode 100644 index 0000000000..9fedf6d3b4 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_infobar_show.js @@ -0,0 +1,181 @@ +/* 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"; + +// Checks for the AccessibleHighlighter's and XULWindowHighlighter's infobar components. + +add_task(async function () { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: MAIN_DOMAIN + "doc_accessibility_infobar.html", + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async function () { + const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" + ); + const { + HighlighterEnvironment, + } = require("resource://devtools/server/actors/highlighters.js"); + const { + AccessibleHighlighter, + } = require("resource://devtools/server/actors/highlighters/accessible.js"); + + /** + * Get whether or not infobar container is hidden. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @return {String|null} If the infobar container is hidden. + */ + function isContainerHidden(infobar) { + return !!infobar + .getElement("infobar-container") + .getAttribute("hidden"); + } + + /** + * Get name of accessible object. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @return {String} The text content of the infobar-name element. + */ + function getName(infobar) { + return infobar.getTextContent("infobar-name"); + } + + /** + * Get role of accessible object. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @return {String} The text content of the infobar-role element. + */ + function getRole(infobar) { + return infobar.getTextContent("infobar-role"); + } + + /** + * Checks for updated content for an infobar with valid bounds. + * + * @param {Object} infobar + * Accessible highlighter's infobar component. + * @param {Object} options + * Options to pass for the highlighter's show method. + * Available options: + * - {String} role + * Role value of the accessible. + * - {String} name + * Name value of the accessible. + * - {Boolean} shouldBeHidden + * If the infobar component should be hidden. + */ + function checkInfobar(infobar, { shouldBeHidden, role, name }) { + is( + isContainerHidden(infobar), + shouldBeHidden, + "Infobar's hidden state is correct." + ); + + if (shouldBeHidden) { + return; + } + + is(getRole(infobar), role, "infobarRole text content is correct"); + is( + getName(infobar), + `"${name}"`, + "infoBarName text content is correct" + ); + } + + /** + * Checks for updated content of an infobar with valid bounds. + * + * @param {Element} node + * Node to check infobar content on. + * @param {Object} highlighter + * Accessible highlighter. + */ + function testInfobar(node, highlighter) { + const infobar = highlighter.accessibleInfobar; + const bounds = { + x: 0, + y: 0, + w: 250, + h: 100, + }; + + info("Check that infobar is shown with valid bounds."); + highlighter.show(node, { + ...bounds, + role: "button", + name: "Accessible Button", + }); + + checkInfobar(infobar, { + role: "button", + name: "Accessible Button", + shouldBeHidden: false, + }); + highlighter.hide(); + + info("Check that infobar is hidden after .hide() is called."); + checkInfobar(infobar, { shouldBeHidden: true }); + + info("Check to make sure content is updated with new options."); + highlighter.show(node, { + ...bounds, + name: "Test link", + role: "link", + }); + checkInfobar(infobar, { + name: "Test link", + role: "link", + shouldBeHidden: false, + }); + highlighter.hide(); + } + + // Start testing. First, create highlighter environment and initialize. + const env = new HighlighterEnvironment(); + env.initFromWindow(content.window); + + // Wait for loading highlighter environment content to complete before creating the + // highlighter. + await new Promise(resolve => { + const doc = env.document; + + function onContentLoaded() { + if ( + doc.readyState === "interactive" || + doc.readyState === "complete" + ) { + resolve(); + } else { + doc.addEventListener("DOMContentLoaded", onContentLoaded, { + once: true, + }); + } + } + + onContentLoaded(); + }); + + // Now, we can test the Infobar and XULWindowInfobar components with their + // respective highlighters. + const node = content.document.createElement("div"); + content.document.body.append(node); + + info("Checks for Infobar's show method"); + const highlighter = new AccessibleHighlighter(env); + await highlighter.isReady; + testInfobar(node, highlighter); + }); + } + ); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_keyboard_audit.js b/devtools/server/tests/browser/browser_accessibility_keyboard_audit.js new file mode 100644 index 0000000000..5cf211acfa --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_keyboard_audit.js @@ -0,0 +1,371 @@ +/* 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"; + +/** + * Checks functionality around text label audit for the AccessibleActor. + */ + +const { + accessibility: { + AUDIT_TYPE: { KEYBOARD }, + SCORES: { FAIL, WARNING }, + ISSUE_TYPE: { + [KEYBOARD]: { + FOCUSABLE_NO_SEMANTICS, + FOCUSABLE_POSITIVE_TABINDEX, + INTERACTIVE_NO_ACTION, + INTERACTIVE_NOT_FOCUSABLE, + MOUSE_INTERACTIVE_ONLY, + NO_FOCUS_VISIBLE, + }, + }, + }, +} = require("resource://devtools/shared/constants.js"); + +add_task(async function () { + const { target, walker, parentAccessibility, a11yWalker } = + await initAccessibilityFrontsForUrl( + `${MAIN_DOMAIN}doc_accessibility_keyboard_audit.html` + ); + + const tests = [ + [ + "Focusable element (styled button) with no semantics.", + "#button-1", + { score: WARNING, issue: FOCUSABLE_NO_SEMANTICS }, + ], + ["Element (styled button) with no semantics.", "#button-2", null], + [ + "Container element for out of order focusable element.", + "#input-container", + null, + ], + [ + "Interactive element with focus out of order (-1).", + "#input-1", + { + score: FAIL, + issue: INTERACTIVE_NOT_FOCUSABLE, + }, + ], + [ + "Interactive element with focus out of order (-1) when disabled.", + "#input-2", + null, + ], + ["Interactive element when disabled.", "#input-3", null], + ["Focusable interactive element.", "#input-4", null], + [ + "Interactive accesible (link with no attributes) with no accessible actions.", + "#link-1", + { + score: FAIL, + issue: INTERACTIVE_NO_ACTION, + }, + ], + ["Interactive accessible (link with valid href).", "#link-2", null], + ["Interactive accessible (link with # as href).", "#link-3", null], + [ + "Interactive accessible (link with empty string as href).", + "#link-4", + null, + ], + ["Interactive accessible with no tabindex.", "#button-3", null], + [ + "Interactive accessible with -1 tabindex.", + "#button-4", + { + score: FAIL, + issue: INTERACTIVE_NOT_FOCUSABLE, + }, + ], + ["Interactive accessible with 0 tabindex.", "#button-5", null], + [ + "Interactive accessible with 1 tabindex.", + "#button-6", + { score: WARNING, issue: FOCUSABLE_POSITIVE_TABINDEX }, + ], + [ + "Focusable ARIA button with no focus styling.", + "#focusable-1", + { score: WARNING, issue: NO_FOCUS_VISIBLE }, + ], + ["Focusable ARIA button with focus styling.", "#focusable-2", null], + ["Focusable ARIA button with browser styling.", "#focusable-3", null], + [ + "Not focusable, non-semantic element that has a click handler.", + "#mouse-only-1", + { score: FAIL, issue: MOUSE_INTERACTIVE_ONLY }, + ], + [ + "Focusable, non-semantic element that has a click handler.", + "#focusable-4", + { score: WARNING, issue: FOCUSABLE_NO_SEMANTICS }, + ], + [ + "Not focusable, ARIA button that has a click handler.", + "#button-7", + { score: FAIL, issue: INTERACTIVE_NOT_FOCUSABLE }, + ], + ["Focusable, ARIA button with a click handler.", "#button-8", null], + ["Regular image, no keyboard checks should flag an issue.", "#img-1", null], + [ + "Image with a longdesc (accessible will have showlongdesc action).", + "#img-2", + null, + ], + [ + "Clickable image with a longdesc (accessible will have click and showlongdesc actions).", + "#img-3", + { score: FAIL, issue: MOUSE_INTERACTIVE_ONLY }, + ], + [ + "Clickable image (accessible will have click action).", + "#img-4", + { score: FAIL, issue: MOUSE_INTERACTIVE_ONLY }, + ], + ["Focusable button with aria-haspopup.", "#buttonmenu-1", null], + [ + "Not focusable aria button with aria-haspopup.", + "#buttonmenu-2", + { + score: FAIL, + issue: INTERACTIVE_NOT_FOCUSABLE, + }, + ], + ["Focusable checkbox.", "#checkbox-1", null], + ["Focusable select element size > 1", "#listbox-1", null], + ["Focusable select element with one option", "#combobox-1", null], + ["Focusable select element with no options", "#combobox-2", null], + ["Focusable select element with two options", "#combobox-3", null], + [ + "Non-focusable aria combobox with one aria option.", + "#editcombobox-1", + null, + ], + ["Non-focusable aria combobox with no options.", "#editcombobox-2", null], + ["Focusable aria combobox with no options.", "#editcombobox-3", null], + [ + "Non-focusable aria switch", + "#switch-1", + { + score: FAIL, + issue: INTERACTIVE_NOT_FOCUSABLE, + }, + ], + ["Focusable aria switch", "#switch-2", null], + [ + "Combobox list that is visible (has focusable state)", + "#owned_listbox", + null, + ], + [ + "Mouse interactive, label that contains form element (linked)", + "#label-1", + null, + ], + ["Mouse interactive label for external element (linked)", "#label-2", null], + ["Not interactive unlinked label", "#label-3", null], + [ + "Not interactive unlinked label with folloing form element", + "#label-4", + null, + ], + ["Image inside an anchor (href)", "#img-5", null], + ["Image inside an anchor (onmousedown)", "#img-6", null], + ["Image inside an anchor (onclick)", "#img-7", null], + ["Image inside an anchor (onmouseup)", "#img-8", null], + [ + "Section with a collapse action from aria-expanded attribute", + "#section-1", + null, + ], + ["Tabindex -1 should not report an element as focusable", "#main", null], + [ + "Not keyboard focusable element with no focus styling.", + "#not-keyboard-focusable-1", + null, + ], + ["Interactive grid that is not focusable.", "#grid-1", null], + ["Focusable interactive grid.", "#grid-2", null], + [ + "Non interactive ARIA table does not need to be focusable.", + "#table-1", + null, + ], + [ + "Focusable ARIA table does not have interactive semantics", + "#table-2", + { score: "WARNING", issue: "FOCUSABLE_NO_SEMANTICS" }, + ], + ["Non interactive table does not need to be focusable.", "#table-3", null], + [ + "Focusable table does not have interactive semantics", + "#table-4", + { score: "WARNING", issue: "FOCUSABLE_NO_SEMANTICS" }, + ], + [ + "Article that is not focusable is not considered interactive", + "#article-1", + null, + ], + ["Focusable article is considered interactive", "#article-2", null], + [ + "Column header that is not focusable is not considered interactive (ARIA grid)", + "#columnheader-1", + null, + ], + [ + "Column header that is not focusable is not considered interactive (ARIA table)", + "#columnheader-2", + null, + ], + [ + "Column header that is not focusable is not considered interactive (table)", + "#columnheader-3", + null, + ], + [ + "Column header that is focusable is considered interactive (table)", + "#columnheader-4", + null, + ], + [ + "Column header that is not focusable is not considered interactive (table as ARIA grid)", + "#columnheader-5", + null, + ], + [ + "Column header that is focusable is considered interactive (table as ARIA grid)", + "#columnheader-6", + null, + ], + [ + "Row header that is not focusable is not considered interactive", + "#rowheader-1", + null, + ], + [ + "Row header that is not focusable is not considered interactive", + "#rowheader-2", + null, + ], + [ + "Row header that is not focusable is not considered interactive", + "#rowheader-3", + null, + ], + [ + "Row header that is focusable is considered interactive", + "#rowheader-4", + null, + ], + [ + "Row header that is not focusable is not considered interactive (table as ARIA grid)", + "#rowheader-5", + null, + ], + [ + "Row header that is focusable is considered interactive (table as ARIA grid)", + "#rowheader-6", + null, + ], + [ + "Gridcell that is not focusable is not considered interactive (ARIA grid)", + "#gridcell-1", + null, + ], + [ + "Gridcell that is focusable is considered interactive (ARIA grid)", + "#gridcell-2", + null, + ], + [ + "Gridcell that is not focusable is not considered interactive (table as ARIA grid)", + "#gridcell-3", + null, + ], + [ + "Gridcell that is focusable is considered interactive (table as ARIA grid)", + "#gridcell-4", + null, + ], + [ + "Tab list that is not focusable is not considered interactive", + "#tablist-1", + null, + ], + ["Focusable tab list is considered interactive", "#tablist-2", null], + [ + "Scrollbar that is not focusable is not considered interactive", + "#scrollbar-1", + null, + ], + ["Focusable scrollbar is considered interactive", "#scrollbar-2", null], + [ + "Separator that is not focusable is not considered interactive", + "#separator-1", + null, + ], + ["Focusable separator is considered interactive", "#separator-2", null], + [ + "Toolbar that is not focusable is not considered interactive", + "#toolbar-1", + null, + ], + ["Focusable toolbar is considered interactive", "#toolbar-2", null], + [ + "Menu popup that is not focusable is not considered interactive", + "#menu-1", + null, + ], + ["Focusable menu popup is considered interactive", "#menu-2", null], + [ + "Menubar that is not focusable is not considered interactive", + "#menubar-1", + null, + ], + ["Focusable menubar is considered interactive", "#menubar-2", null], + ]; + + for (const [description, selector, expected] of tests) { + info(description); + const node = await walker.querySelector(walker.rootNode, selector); + const front = await a11yWalker.getAccessibleFor(node); + const audit = await front.audit({ types: [KEYBOARD] }); + Assert.deepEqual( + audit[KEYBOARD], + expected, + `Audit result for ${selector} is correct.` + ); + } + + info("Text leaf inside a link (jump action is propagated to the text link)"); + let node = await walker.querySelector(walker.rootNode, "#link-5"); + let parent = await a11yWalker.getAccessibleFor(node); + let front = (await parent.children())[0]; + let audit = await front.audit({ types: [KEYBOARD] }); + Assert.deepEqual( + audit[KEYBOARD], + null, + "Text leafs are excluded from semantics rule." + ); + + info("Combobox list that is invisible"); + node = await walker.querySelector(walker.rootNode, "#combobox-1"); + parent = await a11yWalker.getAccessibleFor(node); + front = (await parent.children())[0]; + audit = await front.audit({ types: [KEYBOARD] }); + Assert.deepEqual( + audit[KEYBOARD], + null, + "Combobox lists (invisible) are excluded from semantics rule." + ); + + await waitForA11yShutdown(parentAccessibility); + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_node.js b/devtools/server/tests/browser/browser_accessibility_node.js new file mode 100644 index 0000000000..a7f2749f30 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_node.js @@ -0,0 +1,150 @@ +/* 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"; + +// Checks for the AccessibleActor + +add_task(async function () { + const { target, walker, a11yWalker, parentAccessibility } = + await initAccessibilityFrontsForUrl(MAIN_DOMAIN + "doc_accessibility.html"); + const modifiers = + Services.appinfo.OS === "Darwin" ? "\u2303\u2325" : "Alt+Shift+"; + + const buttonNode = await walker.querySelector(walker.rootNode, "#button"); + const accessibleFront = await a11yWalker.getAccessibleFor(buttonNode); + + checkA11yFront(accessibleFront, { + name: "Accessible Button", + role: "button", + childCount: 1, + }); + + await accessibleFront.hydrate(); + + checkA11yFront(accessibleFront, { + name: "Accessible Button", + role: "button", + value: "", + description: "Accessibility Test", + keyboardShortcut: modifiers + "b", + childCount: 1, + domNodeType: 1, + indexInParent: 1, + states: ["focusable", "opaque", "enabled", "sensitive"], + actions: ["Press"], + attributes: { + "margin-top": "0px", + display: "inline-block", + "text-align": "center", + "text-indent": "0px", + "margin-left": "0px", + tag: "button", + "margin-right": "0px", + id: "button", + "margin-bottom": "0px", + }, + }); + + info("Children"); + const children = await accessibleFront.children(); + is(children.length, 1, "Accessible Front has correct number of children"); + checkA11yFront(children[0], { + name: "Accessible Button", + role: "text leaf", + }); + + info("Relations"); + const labelNode = await walker.querySelector(walker.rootNode, "#label"); + const controlNode = await walker.querySelector(walker.rootNode, "#control"); + const labelAccessibleFront = await a11yWalker.getAccessibleFor(labelNode); + const controlAccessibleFront = await a11yWalker.getAccessibleFor(controlNode); + const docAccessibleFront = await a11yWalker.getAccessibleFor(walker.rootNode); + const relations = await labelAccessibleFront.getRelations(); + is(relations.length, 2, "Accessible front has a correct number of relations"); + is(relations[0].type, "label for", "Label has a label for relation"); + is(relations[0].targets.length, 1, "Label is a label for one target"); + is( + relations[0].targets[0], + controlAccessibleFront, + "Label is a label for control accessible front" + ); + is( + relations[1].type, + "containing document", + "Label has a containing document relation" + ); + is(relations[1].targets.length, 1, "Label is contained by just one document"); + is( + relations[1].targets[0], + docAccessibleFront, + "Label's containing document is a root document" + ); + + info("Snapshot"); + const snapshot = await controlAccessibleFront.snapshot(); + Assert.deepEqual(snapshot, { + name: "Label", + role: "textbox", + actions: ["Activate"], + value: "", + nodeCssSelector: "#control", + nodeType: 1, + description: "", + keyboardShortcut: "", + childCount: 0, + indexInParent: 1, + states: [ + "focusable", + "autocompletion", + "selectable text", + "editable", + "opaque", + "single line", + "enabled", + "sensitive", + ], + children: [], + attributes: { + "margin-left": "0px", + "text-align": "start", + "text-indent": "0px", + id: "control", + tag: "input", + "margin-top": "0px", + "margin-bottom": "0px", + "margin-right": "0px", + display: "inline-block", + "explicit-name": "true", + }, + }); + + // Check that we're using ARIA role tokens for landmarks implicit in native + // markup. + const headerNode = await walker.querySelector(walker.rootNode, "#header"); + const headerAccessibleFront = await a11yWalker.getAccessibleFor(headerNode); + checkA11yFront(headerAccessibleFront, { + name: null, + role: "banner", + childCount: 1, + }); + const navNode = await walker.querySelector(walker.rootNode, "#nav"); + const navAccessibleFront = await a11yWalker.getAccessibleFor(navNode); + checkA11yFront(navAccessibleFront, { + name: null, + role: "navigation", + childCount: 1, + }); + const footerNode = await walker.querySelector(walker.rootNode, "#footer"); + const footerAccessibleFront = await a11yWalker.getAccessibleFor(footerNode); + checkA11yFront(footerAccessibleFront, { + name: null, + role: "contentinfo", + childCount: 1, + }); + + await waitForA11yShutdown(parentAccessibility); + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_node_audit.js b/devtools/server/tests/browser/browser_accessibility_node_audit.js new file mode 100644 index 0000000000..a3115a2846 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_node_audit.js @@ -0,0 +1,116 @@ +/* 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"; + +/** + * Checks functionality around audit for the AccessibleActor. This includes + * tests for the return value when calling the audit method, payload of the + * corresponding event as well as the AccesibleFront state being up to date. + */ + +const { + accessibility: { AUDIT_TYPE, SCORES }, +} = require("resource://devtools/shared/constants.js"); +const EMPTY_AUDIT = Object.keys(AUDIT_TYPE).reduce((audit, key) => { + audit[key] = null; + return audit; +}, {}); + +const EXPECTED_CONTRAST_DATA = { + value: 21, + color: [0, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: true, + score: SCORES.AAA, +}; + +const EMPTY_CONTRAST_AUDIT = { + [AUDIT_TYPE.CONTRAST]: null, +}; + +const CONTRAST_AUDIT = { + [AUDIT_TYPE.CONTRAST]: EXPECTED_CONTRAST_DATA, +}; + +const FULL_AUDIT = { + ...EMPTY_AUDIT, + [AUDIT_TYPE.CONTRAST]: EXPECTED_CONTRAST_DATA, +}; + +async function checkAudit(a11yWalker, node, expected, options) { + const front = await a11yWalker.getAccessibleFor(node); + const [textLeafNode] = await front.children(); + + const onAudited = textLeafNode.once("audited"); + const audit = await textLeafNode.audit(options); + const auditFromEvent = await onAudited; + + Assert.deepEqual(audit, expected.audit, "Audit results are correct."); + Assert.deepEqual(textLeafNode.checks, expected.checks, "Checks are correct."); + Assert.deepEqual( + auditFromEvent, + expected.audit, + "Audit results from event are correct." + ); +} + +add_task(async function () { + const { target, walker, a11yWalker, parentAccessibility } = + await initAccessibilityFrontsForUrl( + MAIN_DOMAIN + "doc_accessibility_infobar.html" + ); + + const headerNode = await walker.querySelector(walker.rootNode, "#h1"); + await checkAudit( + a11yWalker, + headerNode, + { audit: CONTRAST_AUDIT, checks: CONTRAST_AUDIT }, + { types: [AUDIT_TYPE.CONTRAST] } + ); + await checkAudit(a11yWalker, headerNode, { + audit: FULL_AUDIT, + checks: FULL_AUDIT, + }); + await checkAudit( + a11yWalker, + headerNode, + { audit: CONTRAST_AUDIT, checks: FULL_AUDIT }, + { types: [AUDIT_TYPE.CONTRAST] } + ); + await checkAudit( + a11yWalker, + headerNode, + { audit: FULL_AUDIT, checks: FULL_AUDIT }, + { types: [] } + ); + + const paragraphNode = await walker.querySelector(walker.rootNode, "#p"); + await checkAudit( + a11yWalker, + paragraphNode, + { audit: EMPTY_CONTRAST_AUDIT, checks: EMPTY_CONTRAST_AUDIT }, + { types: [AUDIT_TYPE.CONTRAST] } + ); + await checkAudit(a11yWalker, paragraphNode, { + audit: EMPTY_AUDIT, + checks: EMPTY_AUDIT, + }); + await checkAudit( + a11yWalker, + paragraphNode, + { audit: EMPTY_CONTRAST_AUDIT, checks: EMPTY_AUDIT }, + { types: [AUDIT_TYPE.CONTRAST] } + ); + await checkAudit( + a11yWalker, + paragraphNode, + { audit: EMPTY_AUDIT, checks: EMPTY_AUDIT }, + { types: [] } + ); + + await waitForA11yShutdown(parentAccessibility); + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_node_events.js b/devtools/server/tests/browser/browser_accessibility_node_events.js new file mode 100644 index 0000000000..77a1e7892f --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_node_events.js @@ -0,0 +1,197 @@ +/* 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"; + +// Checks for the AccessibleActor events + +add_task(async function () { + const { target, walker, a11yWalker, parentAccessibility } = + await initAccessibilityFrontsForUrl(MAIN_DOMAIN + "doc_accessibility.html"); + const modifiers = + Services.appinfo.OS === "Darwin" ? "\u2303\u2325" : "Alt+Shift+"; + + const rootNode = await walker.getRootNode(); + const a11yDoc = await a11yWalker.getAccessibleFor(rootNode); + const buttonNode = await walker.querySelector(walker.rootNode, "#button"); + const accessibleFront = await a11yWalker.getAccessibleFor(buttonNode); + const sliderNode = await walker.querySelector(walker.rootNode, "#slider"); + const accessibleSliderFront = await a11yWalker.getAccessibleFor(sliderNode); + const browser = gBrowser.selectedBrowser; + + checkA11yFront(accessibleFront, { + name: "Accessible Button", + role: "button", + childCount: 1, + }); + + await accessibleFront.hydrate(); + + checkA11yFront(accessibleFront, { + name: "Accessible Button", + role: "button", + value: "", + description: "Accessibility Test", + keyboardShortcut: modifiers + "b", + childCount: 1, + domNodeType: 1, + indexInParent: 1, + states: ["focusable", "opaque", "enabled", "sensitive"], + actions: ["Press"], + attributes: { + "margin-top": "0px", + display: "inline-block", + "text-align": "center", + "text-indent": "0px", + "margin-left": "0px", + tag: "button", + "margin-right": "0px", + id: "button", + "margin-bottom": "0px", + }, + }); + + info("Name change event"); + await emitA11yEvent( + accessibleFront, + "name-change", + (name, parent) => { + checkA11yFront(accessibleFront, { name: "Renamed" }); + checkA11yFront(parent, {}, a11yDoc); + }, + () => + SpecialPowers.spawn(browser, [], () => + content.document + .getElementById("button") + .setAttribute("aria-label", "Renamed") + ) + ); + + info("Description change event"); + await emitA11yEvent( + accessibleFront, + "description-change", + () => checkA11yFront(accessibleFront, { description: "" }), + () => + SpecialPowers.spawn(browser, [], () => + content.document + .getElementById("button") + .removeAttribute("aria-describedby") + ) + ); + + info("State change event"); + const expectedStates = ["unavailable", "opaque"]; + await emitA11yEvent( + accessibleFront, + "states-change", + newStates => { + checkA11yFront(accessibleFront, { states: expectedStates }); + SimpleTest.isDeeply(newStates, expectedStates, "States are updated"); + }, + () => + SpecialPowers.spawn(browser, [], () => + content.document.getElementById("button").setAttribute("disabled", true) + ) + ); + + info("Attributes change event"); + await emitA11yEvent( + accessibleFront, + "attributes-change", + newAttrs => { + checkA11yFront(accessibleFront, { + attributes: { + "container-live": "polite", + display: "inline-block", + "event-from-input": "false", + "explicit-name": "true", + id: "button", + live: "polite", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px", + tag: "button", + "text-align": "center", + "text-indent": "0px", + }, + }); + is(newAttrs.live, "polite", "Attributes are updated"); + }, + () => + SpecialPowers.spawn(browser, [], () => + content.document + .getElementById("button") + .setAttribute("aria-live", "polite") + ) + ); + + info("Value change event"); + await accessibleSliderFront.hydrate(); + checkA11yFront(accessibleSliderFront, { value: "5" }); + await emitA11yEvent( + accessibleSliderFront, + "value-change", + () => checkA11yFront(accessibleSliderFront, { value: "6" }), + () => + SpecialPowers.spawn(browser, [], () => + content.document + .getElementById("slider") + .setAttribute("aria-valuenow", "6") + ) + ); + + info("Reorder event"); + is(accessibleSliderFront.childCount, 1, "Slider has only 1 child"); + const [firstChild] = await accessibleSliderFront.children(); + await firstChild.hydrate(); + is( + firstChild.indexInParent, + 0, + "Slider's first child has correct index in parent" + ); + await emitA11yEvent( + accessibleSliderFront, + "reorder", + childCount => { + is(childCount, 2, "Child count is updated"); + is(accessibleSliderFront.childCount, 2, "Child count is updated"); + is( + firstChild.indexInParent, + 1, + "Slider's first child has an updated index in parent" + ); + }, + () => + SpecialPowers.spawn(browser, [], () => { + const doc = content.document; + const slider = doc.getElementById("slider"); + const button = doc.createElement("button"); + button.innerText = "Slider button"; + content.document + .getElementById("slider") + .insertBefore(button, slider.firstChild); + }) + ); + + await emitA11yEvent( + firstChild, + "index-in-parent-change", + indexInParent => + is( + indexInParent, + 0, + "Slider's first child has an updated index in parent" + ), + () => + SpecialPowers.spawn(browser, [], () => + content.document.getElementById("slider").firstChild.remove() + ) + ); + + await waitForA11yShutdown(parentAccessibility); + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_node_tabbing_order_highlighter.js b/devtools/server/tests/browser/browser_accessibility_node_tabbing_order_highlighter.js new file mode 100644 index 0000000000..adb47c0ec6 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_node_tabbing_order_highlighter.js @@ -0,0 +1,92 @@ +/* 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"; + +// Checks for the NodeTabbingOrderHighlighter. + +add_task(async function () { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: MAIN_DOMAIN + "doc_accessibility_infobar.html", + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async function () { + const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" + ); + const { + HighlighterEnvironment, + } = require("resource://devtools/server/actors/highlighters.js"); + const { + NodeTabbingOrderHighlighter, + } = require("resource://devtools/server/actors/highlighters/node-tabbing-order.js"); + + // Checks for updated content for an infobar. + async function testShowHide(highlighter, node, index) { + const shown = highlighter.show(node, { index }); + const infoBarText = highlighter.getElement("infobar-text"); + + ok(shown, "Highlighter is shown."); + is( + parseInt(infoBarText.getTextContent(), 10), + index, + "infobar text content is correct" + ); + + highlighter.hide(); + } + + // Start testing. First, create highlighter environment and initialize. + const env = new HighlighterEnvironment(); + env.initFromWindow(content.window); + + // Wait for loading highlighter environment content to complete before + // creating the highlighter. + await new Promise(resolve => { + const doc = env.document; + + function onContentLoaded() { + if ( + doc.readyState === "interactive" || + doc.readyState === "complete" + ) { + resolve(); + } else { + doc.addEventListener("DOMContentLoaded", onContentLoaded, { + once: true, + }); + } + } + + onContentLoaded(); + }); + + // Now, we can test the Infobar's index content. + const node = content.document.createElement("div"); + content.document.body.append(node); + const highlighter = new NodeTabbingOrderHighlighter(env); + await highlighter.isReady; + + info("Showing Node tabbing order highlighter with index"); + await testShowHide(highlighter, node, 1); + + info("Showing Node tabbing order highlighter with new index"); + await testShowHide(highlighter, node, 9); + + info( + "Showing and highlighting focused node with the Node tabbing order highlighter" + ); + highlighter.show(node, { index: 1 }); + highlighter.updateFocus(true); + const { classList } = highlighter.getElement("root"); + ok(classList.contains("focused"), "Focus styling is applied"); + highlighter.updateFocus(false); + ok(!classList.contains("focused"), "Focus styling is removed"); + highlighter.hide(); + }); + } + ); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_simple.js b/devtools/server/tests/browser/browser_accessibility_simple.js new file mode 100644 index 0000000000..518d4dbb99 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_simple.js @@ -0,0 +1,106 @@ +/* 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"; + +const PREF_ACCESSIBILITY_FORCE_DISABLED = "accessibility.force_disabled"; + +function checkAccessibilityState(accessibility, parentAccessibility, expected) { + const { enabled } = accessibility; + const { canBeDisabled, canBeEnabled } = parentAccessibility; + is(enabled, expected.enabled, "Enabled state is correct."); + is(canBeDisabled, expected.canBeDisabled, "canBeDisabled state is correct."); + is(canBeEnabled, expected.canBeEnabled, "canBeEnabled state is correct."); +} + +// Simple checks for the AccessibilityActor and AccessibleWalkerActor + +add_task(async function () { + const { + walker: domWalker, + target, + accessibility, + parentAccessibility, + a11yWalker, + } = await initAccessibilityFrontsForUrl( + "data:text/html;charset=utf-8,test
", + { enableByDefault: false } + ); + + ok(accessibility, "The AccessibilityFront was created"); + ok(accessibility.getWalker, "The getWalker method exists"); + ok(accessibility.getSimulator, "The getSimulator method exists"); + + ok(accessibility.accessibleWalkerFront, "Accessible walker was initialized"); + + is( + a11yWalker, + accessibility.accessibleWalkerFront, + "The AccessibleWalkerFront was returned" + ); + + const a11ySimulator = accessibility.simulatorFront; + ok(accessibility.simulatorFront, "Accessible simulator was initialized"); + is( + a11ySimulator, + accessibility.simulatorFront, + "The SimulatorFront was returned" + ); + + checkAccessibilityState(accessibility, parentAccessibility, { + enabled: false, + canBeDisabled: true, + canBeEnabled: true, + }); + + info("Force disable accessibility service: updates canBeEnabled flag"); + let onEvent = parentAccessibility.once("can-be-enabled-change"); + Services.prefs.setIntPref(PREF_ACCESSIBILITY_FORCE_DISABLED, 1); + await onEvent; + checkAccessibilityState(accessibility, parentAccessibility, { + enabled: false, + canBeDisabled: true, + canBeEnabled: false, + }); + + info("Clear force disable accessibility service: updates canBeEnabled flag"); + onEvent = parentAccessibility.once("can-be-enabled-change"); + Services.prefs.clearUserPref(PREF_ACCESSIBILITY_FORCE_DISABLED); + await onEvent; + checkAccessibilityState(accessibility, parentAccessibility, { + enabled: false, + canBeDisabled: true, + canBeEnabled: true, + }); + + info("Initialize accessibility service"); + const initEvent = accessibility.once("init"); + await parentAccessibility.enable(); + await waitForA11yInit(); + await initEvent; + checkAccessibilityState(accessibility, parentAccessibility, { + enabled: true, + canBeDisabled: true, + canBeEnabled: true, + }); + + const rootNode = await domWalker.getRootNode(); + const a11yDoc = await accessibility.accessibleWalkerFront.getAccessibleFor( + rootNode + ); + ok(a11yDoc, "Accessible document actor is created"); + + info("Shutdown accessibility service"); + const shutdownEvent = accessibility.once("shutdown"); + await waitForA11yShutdown(parentAccessibility); + await shutdownEvent; + checkAccessibilityState(accessibility, parentAccessibility, { + enabled: false, + canBeDisabled: true, + canBeEnabled: true, + }); + + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_simulator.js b/devtools/server/tests/browser/browser_accessibility_simulator.js new file mode 100644 index 0000000000..47e3b898a3 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_simulator.js @@ -0,0 +1,88 @@ +/* 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"; + +const { + accessibility: { + SIMULATION_TYPE: { PROTANOPIA }, + }, +} = require("resource://devtools/shared/constants.js"); +const { + simulation: { + COLOR_TRANSFORMATION_MATRICES: { + PROTANOPIA: PROTANOPIA_MATRIX, + NONE: DEFAULT_MATRIX, + }, + }, +} = require("resource://devtools/server/actors/accessibility/constants.js"); + +// Checks for the SimulatorActor + +async function setup() { + await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { + content.window.testColorMatrix = function (actual, expected) { + for (const idx in actual) { + is( + actual[idx].toFixed(3), + expected[idx].toFixed(3), + "Color matrix value is set correctly." + ); + } + }; + }); + SimpleTest.registerCleanupFunction(async function () { + await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { + content.window.testColorMatrix = null; + }); + }); +} + +async function testSimulate(simulator, matrix, type = null) { + const matrixApplied = await simulator.simulate({ types: type ? [type] : [] }); + ok(matrixApplied, "Simulation color matrix is successfully applied."); + + await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [[type, matrix]], + ([simulationType, simulationMatrix]) => { + const { window } = content; + info( + `Test that color matrix is set to ${ + simulationType || "default" + } simulation values.` + ); + window.testColorMatrix( + window.docShell.getColorMatrix(), + simulationMatrix + ); + } + ); +} + +add_task(async function () { + const { target, accessibility } = await initAccessibilityFrontsForUrl( + MAIN_DOMAIN + "doc_accessibility.html", + { enableByDefault: false } + ); + + const simulator = accessibility.simulatorFront; + if (!simulator) { + ok(false, "Missing simulator actor."); + return; + } + + await setup(); + + info("Test that protanopia is successfully simulated."); + await testSimulate(simulator, PROTANOPIA_MATRIX, PROTANOPIA); + + info( + "Test that simulations are successfully removed by setting default color matrix." + ); + await testSimulate(simulator, DEFAULT_MATRIX); + + await target.destroy(); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_tabbing_order_highlighter.js b/devtools/server/tests/browser/browser_accessibility_tabbing_order_highlighter.js new file mode 100644 index 0000000000..fb99534318 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_tabbing_order_highlighter.js @@ -0,0 +1,101 @@ +/* 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"; + +// Checks for the TabbingOrderHighlighter. + +add_task(async function () { + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: MAIN_DOMAIN + "doc_accessibility_infobar.html", + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], async function () { + const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" + ); + const { + HighlighterEnvironment, + } = require("resource://devtools/server/actors/highlighters.js"); + const { + TabbingOrderHighlighter, + } = require("resource://devtools/server/actors/highlighters/tabbing-order.js"); + + // Start testing. First, create highlighter environment and initialize. + const env = new HighlighterEnvironment(); + env.initFromWindow(content.window); + + // Wait for loading highlighter environment content to complete before + // creating the highlighter. + await new Promise(resolve => { + const doc = env.document; + + function onContentLoaded() { + if ( + doc.readyState === "interactive" || + doc.readyState === "complete" + ) { + resolve(); + } else { + doc.addEventListener("DOMContentLoaded", onContentLoaded, { + once: true, + }); + } + } + + onContentLoaded(); + }); + + // Now, we can test the Infobar's index content. + const node = content.document.createElement("div"); + content.document.body.append(node); + const highlighter = new TabbingOrderHighlighter(env); + await highlighter.isReady; + + info("Showing tabbing order highlighter for all tabbable nodes"); + const { contentDOMReference, index } = await highlighter.show( + content.document, + { + index: 0, + } + ); + + is( + contentDOMReference, + null, + "No current element when at the end of the tab order" + ); + is(index, 2, "Current index is correct"); + is( + highlighter._highlighters.size, + 2, + "Number of node tabbing order highlighters is correct" + ); + for (let i = 0; i < highlighter._highlighters.size; i++) { + const nodeHighlighter = [...highlighter._highlighters.values()][i]; + const infoBarText = nodeHighlighter.getElement("infobar-text"); + + is( + parseInt(infoBarText.getTextContent(), 10), + i + 1, + "infobar text content is correct" + ); + } + + info("Showing focus highlighting"); + const input = content.document.getElementById("input"); + highlighter.updateFocus({ node: input, focused: true }); + const nodeHighlighter = highlighter._highlighters.get(input); + const { classList } = nodeHighlighter.getElement("root"); + ok(classList.contains("focused"), "Focus styling is applied"); + highlighter.updateFocus({ node: input, focused: false }); + ok(!classList.contains("focused"), "Focus styling is removed"); + + highlighter.hide(); + }); + } + ); +}); diff --git a/devtools/server/tests/browser/browser_accessibility_text_label_audit.js b/devtools/server/tests/browser/browser_accessibility_text_label_audit.js new file mode 100644 index 0000000000..dad2bcaa75 --- /dev/null +++ b/devtools/server/tests/browser/browser_accessibility_text_label_audit.js @@ -0,0 +1,1138 @@ +/* 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"; + +/** + * Checks functionality around text label audit for the AccessibleActor. + */ + +const { + accessibility: { + AUDIT_TYPE: { TEXT_LABEL }, + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + ISSUE_TYPE: { + [TEXT_LABEL]: { + DIALOG_NO_NAME, + DOCUMENT_NO_TITLE, + EMBED_NO_NAME, + FIGURE_NO_NAME, + FORM_FIELDSET_NO_NAME, + FORM_FIELDSET_NO_NAME_FROM_LEGEND, + FORM_NO_NAME, + FORM_NO_VISIBLE_NAME, + FORM_OPTGROUP_NO_NAME_FROM_LABEL, + HEADING_NO_CONTENT, + HEADING_NO_NAME, + IFRAME_NO_NAME_FROM_TITLE, + IMAGE_NO_NAME, + INTERACTIVE_NO_NAME, + MATHML_GLYPH_NO_NAME, + TOOLBAR_NO_NAME, + }, + }, + }, +} = require("resource://devtools/shared/constants.js"); + +add_task(async function () { + const { target, walker, a11yWalker, parentAccessibility } = + await initAccessibilityFrontsForUrl( + `${MAIN_DOMAIN}doc_accessibility_text_label_audit.html` + ); + + const tests = [ + ["Button menu with inner content", "#buttonmenu-1", null], + ["Button menu nested inside a