Closed Bug 2088306 Opened 25 days ago Closed 24 days ago

Perma TV toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | Uncaught exception in test - ReferenceError: ok is not defined

Categories

(Toolkit :: Picture-in-Picture, defect, P5)

defect

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox159 --- unaffected
firefox160 --- unaffected
firefox161 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: canalun)

References

(Regression)

Details

(Keywords: intermittent-failure, regression, test-verify-fail)

Attachments

(1 external file)

Filed by: asilaghi [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=604320021&repo=autoland&task=Rmp1ozcrRmyujiRNAosE3A.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Rmp1ozcrRmyujiRNAosE3A/runs/0/artifacts/public/logs/live_backing.log
Reftest URL: https://hg.mozilla.org/mozilla-central/raw-file/default/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Rmp1ozcrRmyujiRNAosE3A/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1


[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - TEST-PASS | toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | No swipe gesture events observed - true == true
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Leaving test 
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Entering test 
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Console message: [JavaScript Warning: "HTTPS-First Mode: Upgrading insecure speculative TCP connection “http://example.com/browser/toolkit/components/pictureinpicture/tests/test-page.html” to use “https”."]
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Console message: [JavaScript Warning: "HTTPS-First Mode: Upgrading insecure request “http://example.com/browser/toolkit/components/pictureinpicture/tests/test-page.html” to use “https”."]
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Buffered messages logged at 00:03:14
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - PiP window is ready for touchscreen input
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - PiP window received touchend
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - TEST-PASS | toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | No swipe gesture events observed - true == true
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Leaving test 
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - checking for open popups
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - checking for open sidebars
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - checking window state
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - Buffered messages finished
[task 2026-11-03T00:04:46.252+00:00] 00:04:46     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | Test timed out
[task 2026-11-03T00:04:46.796+00:00] 00:04:46     INFO - Not taking screenshot here: see the one that was previously logged
[task 2026-11-03T00:04:46.796+00:00] 00:04:46     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | profile uploaded in profile_browser_disableSwipeGestures-2.js.json.gz
[task 2026-11-03T00:04:46.796+00:00] 00:04:46     INFO - TEST-UNEXPECTED-TIMEOUT | toolkit/components/pictureinpicture/tests/browser_disableSwipeGestures.js | Test timed out
[task 2026-11-03T00:04:46.796+00:00] 00:04:46     INFO - TEST-INFO took 91861ms
[task 2026-11-03T00:04:46.798+00:00] 00:04:46     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 13 (11bacd100) [pid = 3122] [serial = 17] [outer = 164972500]
[task 2026-11-03T00:04:49.456+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 12 (1649eb900) [pid = 3122] [serial = 8] [outer = 0] [url = about:blank]
[task 2026-11-03T00:04:49.719+00:00] 00:04:49     INFO - GECKO(3122) | Completed ShutdownLeaks collections in process 3122
[task 2026-11-03T00:04:49.719+00:00] 00:04:49     INFO - TEST-START | Shutdown
[task 2026-11-03T00:04:49.719+00:00] 00:04:49     INFO - Browser Chrome Test Summary
[task 2026-11-03T00:04:49.719+00:00] 00:04:49     INFO - Passed:  4
[task 2026-11-03T00:04:49.720+00:00] 00:04:49     INFO - Failed:  1
[task 2026-11-03T00:04:49.720+00:00] 00:04:49     INFO - Todo:    0
[task 2026-11-03T00:04:49.720+00:00] 00:04:49     INFO - Mode:    e10s
[task 2026-11-03T00:04:49.720+00:00] 00:04:49     INFO - *** End BrowserChrome Test Results ***
[task 2026-11-03T00:04:49.851+00:00] 00:04:49     INFO - GECKO(3122) | 1793664289851	Marionette	TRACE	Received observer notification quit-application
[task 2026-11-03T00:04:49.852+00:00] 00:04:49     INFO - GECKO(3122) | 1793664289851	Marionette	TRACE	Application is shutting down with reason: "shutdown"
[task 2026-11-03T00:04:49.852+00:00] 00:04:49     INFO - GECKO(3122) | 1793664289851	Marionette	INFO	Stopped listening on port 2828
[task 2026-11-03T00:04:49.875+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bfa5800 == 5 [pid = 3127] [id = 5] [url = moz-extension://9a310967-e580-48bf-b3e8-4eafebbc122d/_generated_background_page.html]
[task 2026-11-03T00:04:49.876+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bf9e000 == 4 [pid = 3127] [id = 1] [url = moz-extension://efc9c4d6-bf00-4e89-924c-2911e77dc322/_generated_background_page.html]
[task 2026-11-03T00:04:49.876+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bf9fc00 == 3 [pid = 3127] [id = 2] [url = moz-extension://2bacbb7c-66a7-482d-9b36-4cf0955fcfd4/_generated_background_page.html]
[task 2026-11-03T00:04:49.876+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bfa1c00 == 2 [pid = 3127] [id = 3] [url = moz-extension://5662c78f-5ca0-479d-94eb-86e0dd01da34/_generated_background_page.html]
[task 2026-11-03T00:04:49.876+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bf99c00 == 1 [pid = 3127] [id = 0] [url = moz-extension://600448e0-68e6-4d79-a652-2d5d16a99633/_generated_background_page.html]
[task 2026-11-03T00:04:49.877+00:00] 00:04:49     INFO - GECKO(3122) | [Child 3127: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10bfa3c00 == 0 [pid = 3127] [id = 4] [url = moz-extension://822cb335-8509-4886-bdea-88007c19f099/_generated_background_page.html]
[task 2026-11-03T00:04:49.884+00:00] 00:04:49     INFO - GECKO(3122) | 1793664289884	Marionette	DEBUG	Marionette stopped listening
[task 2026-11-03T00:04:49.899+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h:93
[task 2026-11-03T00:04:49.911+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 16494a800 == 5 [pid = 3122] [id = 3] [url = about:blank]
[task 2026-11-03T00:04:49.911+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 120c67c00 == 4 [pid = 3122] [id = 0] [url = chrome://browser/content/hiddenWindowMac.xhtml]
[task 2026-11-03T00:04:49.911+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 1725bc800 == 3 [pid = 3122] [id = 4] [url = chrome://mochikit/content/browser-harness.xhtml]
[task 2026-11-03T00:04:49.912+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 1659d0400 == 2 [pid = 3122] [id = 7] [url = chrome://global/content/pictureinpicture/player.xhtml]
[task 2026-11-03T00:04:49.913+00:00] 00:04:49     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 15e3e0800 == 1 [pid = 3122] [id = 1] [url = chrome://extensions/content/dummy.xhtml]
[task 2026-11-03T00:04:50.102+00:00] 00:04:50     INFO - GECKO(3122) | [Parent 3122: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 15f46d000 == 0 [pid = 3122] [id = 2] [url = chrome://browser/content/browser.xhtml]
[task 2026-11-03T00:04:50.104+00:00] 00:04:50     INFO - GECKO(3122) | [Child 3139: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 10f7bd000 == 1 [pid = 3139] [id = 1] [url = about:blank]
[task 2026-11-03T00:04:50.106+00:00] 00:04:50     INFO - GECKO(3122) | [Child 3130: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 111430400 == 0 [pid = 3130] [id = 3] [url = about:blank]
[task 2026-11-03T00:04:50.108+00:00] 00:04:50     INFO - GECKO(3122) | [Child 3130: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 1 (1104b9000) [pid = 3130] [serial = 9] [outer = 0] [url = about:blank]
[task 2026-11-03T00:04:50.110+00:00] 00:04:50     INFO - GECKO(3122) | [Child 3130: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 0 (1104bef00) [pid = 3130] [serial = 10] [outer = 0] [url = about:blank]

:canalun, since you are the author of the regressor, bug 2085126, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(i.am.kanaru.sato)

Set release status flags based on info from the regressing bug 2085126

Summary

  • Since a second case for touchscreen swipes was added to
    browser_disableSwipeGestures.js, the file has been run in TV (test-verify)
    mode. In that mode, the first case in the file fails with
    "ReferenceError: ok is not defined" (on macOS, the same error shows up as
    a test timeout). This patch fixes that.

Cause

  • In short, apz_test_native_event_utils.js defines a NativePanHandler
    getter on window, and the getter relies on helpers that are cleaned up
    when the test ends. TV mode reuses the same window for repeated runs of
    the test, so the second run fails.

Detailed Cause

[1st run]
test scope #1 = { ok, info, ..., getPanHandler#1, panLeftToRightBegin#1, ... }
window = { NativePanHandler: getter -> calls getPanHandler#1 }
^ defined on window, not on the test scope

Test ends -> testScope.destroy() deletes ok, info, ... from scope #1
(window survives, so the getter stays)

[2nd run]
test scope #2 = { ok, info, ..., getPanHandler#2, panLeftToRightBegin#2, ... }
NativePanHandler already exists on window -> not redefined

panLeftToRightBegin#2 looks up NativePanHandler
  -> not in scope #2 -> found on window (the getter from the 1st run)
  -> getPanHandler#1 -> 1st run's functions -> look up ok()
  -> ok() is gone from scope #1 -> "ReferenceError: ok is not defined"

What this patch does

  • This patch changes apz_test_native_event_utils.js to define
    NativePanHandler on this, which is the test scope in browser-chrome
    tests.
  • In tests that load the file with a <script> tag in an HTML page
    (e.g. mochitest-plain), this is still window, so they behave as
    before.
  • This patch actually fixed local failure of TV mode on Mac.
Assignee: nobody → i.am.kanaru.sato
Status: NEW → ASSIGNED
Flags: needinfo?(i.am.kanaru.sato)
Status: ASSIGNED → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: