Repository navigation
test(contexts): check in Chrome that no browser_ui target stays attached - #697
Closed
thomasklemm wants to merge 1 commit into
Closed
thomasklemm wants to merge 1 commit into
thomasklemm wants to merge 1 commit into
Conversation
The spec waited for at least two untracked targets, but Chrome 157 opens one `chrome://omnibox-popup.top-chrome/` target per browser context instead of two, so it failed although Ferrum still detaches from it. Ask Chrome for the context's `browser_ui` targets instead, which holds for any count and also catches one that stays attached before its attach event has been handled.
Contributor
Author
|
Closing, since 532aec9 fixed this on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spec/contexts_spec.rb("detaches from attached targets of a type it doesn't track") fails on every CI job sincechrome-version: stableresolves to Chrome for Testing 157.0.8103.38, for example in #696. The last greenmainrun used 156.0.8078.80.Ferrum itself still works. Probing both versions locally:
browser_uitargets per new browser context:chrome://omnibox-popup.top-chrome/andchrome://omnibox-popup.top-chrome/omnibox_popup_aim.html.Contexts#detach_untrackedresumes and detaches them, andTarget.getTargetsreports them withattached: falseafterwards.The spec waited for at least two untracked attach events, so it failed on 157. Instead of lowering the count, it now asks Chrome directly: it polls
Target.getTargetsfor the new context'sbrowser_uitargets until there is at least one and none is attached, the same waycontext_spec.rbchecks service workers. That holds for any number of targets and also catches a target that stays attached before its attach event has been handled, which the event-based version could miss.Test
spec/contexts_spec.rb).detach_untrackedstubbed to do nothing it fails on both versions (expected [true] …,expected [true, true] …).expected [true, false] to all equal false).Spec-only, so no CHANGELOG entry.