Closed Bug 2036971 Opened 2 months ago Closed 2 months ago

Fix geckoview-junit test assertions that were bypassed on Kotlin <2.4

Categories

(GeckoView :: General, defect)

All
Android
defect

Tracking

(firefox152 fixed)

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

Details

Attachments

(3 files)

Three tests had incorrect @AssertCalled count/order constraints or wrong expected values that were silently bypassed on Kotlin 2.3 and older due to a Kotlin bridge-method annotation propagation issue. Discovered while diagnosing Kotlin 2.4 geckoview-junit failures.

The onLocationChange callback receives the absolute URL (Services.io's
displaySpec for the resolved URI), not the relative argument passed to
window.location.replace(). The strict equalTo check only avoided
failing because the bridge-method @AssertCalled propagation suppressed
this override on Kotlin 2.3.21 — the assertion was never evaluated.

The actual delivery order is onLocationChange(about:blank) ->
onLoadRequest(target) -> onLocationChange(target) -> onTitleChange.
The hard-coded [1,2,3,4] order was wrong (it placed onLoadRequest
after the two location changes); update to [1,3] / [2] / [4].

WebNotification.click() simulates a notification-body click and produces
a notificationclick event with event.action = "". The service-worker
fixture only appends ?action=<id> to the target URL when event.action
is non-empty, so the test's expected URL (with ?action=foo) was never
attainable through click(). Use the click(action) overload to simulate
clicking the action button instead.

Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7a23994f19c1 https://hg.mozilla.org/integration/autoland/rev/a974ea9baaec Match the resolved absolute URL in locationReplaceOnUserGesture. r=geckoview-reviewers,ohall https://github.com/mozilla-firefox/firefox/commit/c2751649914d https://hg.mozilla.org/integration/autoland/rev/121de9b402bc Fix expected delegate-call order in openWindowNewClosedSession. r=geckoview-reviewers,ohall https://github.com/mozilla-firefox/firefox/commit/5d4df13e5f9b https://hg.mozilla.org/integration/autoland/rev/a3ed62235aaa Click the notification action button in openWindowWithActionAfterAlertServiceTeardown. r=geckoview-reviewers,ohall
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: