Closed Bug 2037667 Opened 6 months ago Closed 5 months ago

Prepare tests listed in the main browser.toml file for the SRD pref flip

Categories

(Firefox :: Settings UI, task)

task

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox152 --- fixed
firefox153 --- fixed

People

(Reporter: hjones, Assigned: tgiles)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(8 external files)

We need to make sure our tests listed in in preferences will pass with the SRD pref enabled or disabled. Some of this work was already taken care of in this patch (specifically the creation of the new -srd manifest and moving some tests that are SRD only out of the new manifest). Here are the generic steps to take/things we should be checking for reference:

  • add missing tests from browser/components/preferences/tests/browser.toml to browser/components/preferences/tests/browser-srd.toml and ensure we have dupe-manifest=true and the browser.settings-redesign.enabled pref set to true
  • register this manifest in browser/components/preferences/moz.build
  • remove any tests that already set browser.settings-redesign.enabled to true from the old browser.toml file since these don't need to work with the pref disabled
  • clean up any code setting the SRD pref from within the test files (this will be read from the manifest)
  • remove any tests from the new manifest that are only relevant to the old UI
  • fix any failing tests
  • add new tests if there are any obvious gaps
Blocks: 2037820
No longer blocks: srd-tests
Assignee: nobody → tgiles

Add dupe-manifest = true to browser-srd.toml so shared tests can run
without build system errors.

Move the audited set of shared tests into browser-srd.toml so they run
with browser.settings-redesign.enabled=true. Remove
browser_advanced_update.js from browser-srd.toml since it only covers
the legacy General pane.

Split browser_accessibility_pane.js, browser_appearance_pane, and
browser_colors_dialog into _xul.js copies that retain the
legacy/XUL-only assertions. This ensures we don't lose the pane-specific
coverage when the SRD pref is disabled, while allowing the non _xul.js
files to handle the SRD related changes in the next commit in this
stack.

Add an openPrefsTab helper to head.js for tests that need to open the
preferences UI at a specific category and wait for paneshown. This
replaces the openPreferencesViaOpenPreferencesAPI and similar observer
setups across the test directory.

Note: this part depends on the next commit in the stack (Part 2) for any
shared test referenced from browser-srd.toml to function under the
enabled redesign pref. They must land or back out together.

Update shared preferences tests so they pass under both the legacy XUL
preferences and the new settings redesign preferences. Each file follows
one or more of these patterns:

  • Calls openPrefsTab helper from head.js for pane navigation.
  • Replace hard-coded pane/subcategory selectors with unscoped versions.
    SRD pane containers don't have a DOM id while the legacy containers
    do.
  • Add SRD-conditional branches for elements that change when the
    redesign is enabled. This includes pane location, DOM shape, or
    telemetry bucket changes.
  • Guard null-element accesses, fix sync-pane-loaded observer leaks, and
    use assertions with a tolerance value where exact equality checks were
    too strict.
  • Drop redundant inline browser.settings-redesign.enabled=true
    pushPrefEnv calls.

Note: This commit pairs with the previous commit in the stack (Part 1).
browser-srd.toml entries added there reference these files, so these two
commits must land or back out together.

Add two SRD-only tests that close new coverage gaps discovered while
making the shared tests pass when SRD is enabled.

browser_srd_telemetry_bucket_migration.js ensures that when a setting
moves to a new pane, the recorded telemetry from Glean's
browserUiInteraction is placed in the correct bucket. For example,
useSmoothScrolling moved from General to Accessibility and so its
interaction should be recorded in Accessibility.

browser_srd_related_settings_links.js verifies the "Related Settings"
moz-box-link elements on the Appearance pane render with the expected
hrefs.

Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a1bbd666e8f3 https://hg.mozilla.org/integration/autoland/rev/27cb79fa00c2 Revert "Bug 2037667 - Part 3: Add SRD coverage-gap regression tests r=mkennedy" for causing mochitests failures in browser_windows_launch_on_login_msix.js.

Reverted this because it was causing mochitests failures in browser_windows_launch_on_login_msix.js.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | browser/components/preferences/tests/browser_windows_launch_on_login_msix.js | test_check_uncheck_checkbox - Uncaught exception in test - TypeError: can't access property "checked", launchOnLoginCheckbox is null
Flags: needinfo?(tgiles)
Attachment #9591318 - Attachment description: WIP: Bug 2037667 - Part 4: Update browser_windows_launch_on_login_msix.js test r?#settings-reviewers → Bug 2037667 - Part 4: Update browser_windows_launch_on_login_msix.js test r?#settings-reviewers
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/458943999f3f https://hg.mozilla.org/integration/autoland/rev/c6079c784c2b Revert "Bug 2037667 - Part 4: Update browser_windows_launch_on_login_msix.js test r=mstriemer" for breaking gecko decision task.

Reverted this because it was breaking gecko decision task.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: OSError: Error parsing TOML manifest file /builds/worker/checkouts/gecko/browser/components/preferences/tests/browser-srd.toml: redefinition of table browser_legacy_pane_mappings.js for key browser_legacy_pane_mappings.js at line 52 column 1
Flags: needinfo?(tgiles)
Regressions: 2043893

Add dupe-manifest = true to browser-srd.toml so shared tests can run
without build system errors.

Move the audited set of shared tests into browser-srd.toml so they run
with browser.settings-redesign.enabled=true. Remove
browser_advanced_update.js from browser-srd.toml since it only covers
the legacy General pane.

Split browser_accessibility_pane.js, browser_appearance_pane, and
browser_colors_dialog into _xul.js copies that retain the
legacy/XUL-only assertions. This ensures we don't lose the pane-specific
coverage when the SRD pref is disabled, while allowing the non _xul.js
files to handle the SRD related changes in the next commit in this
stack.

Add an openPrefsTab helper to head.js for tests that need to open the
preferences UI at a specific category and wait for paneshown. This
replaces the openPreferencesViaOpenPreferencesAPI and similar observer
setups across the test directory.

Note: this part depends on the next commit in the stack (Part 2) for any
shared test referenced from browser-srd.toml to function under the
enabled redesign pref. They must land or back out together.

Original Revision: https://phabricator.services.mozilla.com/D302555

Attachment #9593071 - Flags: approval-mozilla-beta?

Update shared preferences tests so they pass under both the legacy XUL
preferences and the new settings redesign preferences. Each file follows
one or more of these patterns:

  • Calls openPrefsTab helper from head.js for pane navigation.
  • Replace hard-coded pane/subcategory selectors with unscoped versions.
    SRD pane containers don't have a DOM id while the legacy containers
    do.
  • Add SRD-conditional branches for elements that change when the
    redesign is enabled. This includes pane location, DOM shape, or
    telemetry bucket changes.
  • Guard null-element accesses, fix sync-pane-loaded observer leaks, and
    use assertions with a tolerance value where exact equality checks were
    too strict.
  • Drop redundant inline browser.settings-redesign.enabled=true
    pushPrefEnv calls.

Note: This commit pairs with the previous commit in the stack (Part 1).
browser-srd.toml entries added there reference these files, so these two
commits must land or back out together.

Original Revision: https://phabricator.services.mozilla.com/D302556

Attachment #9593073 - Flags: approval-mozilla-beta?

Add an SRD-only test that closes a new coverage gap discovered while
making the shared tests pass when SRD is enabled.

browser_srd_telemetry_bucket_migration.js ensures that when a setting
moves to a new pane, the recorded telemetry from Glean's
browserUiInteraction is placed in the correct bucket. For example,
useSmoothScrolling moved from General to Accessibility and so its
interaction should be recorded in Accessibility.

Original Revision: https://phabricator.services.mozilla.com/D302557

Attachment #9593074 - Flags: approval-mozilla-beta?
Attachment #9593075 - Flags: approval-mozilla-beta?
Flags: in-testsuite+
Attachment #9593071 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9593073 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9593074 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9593075 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: