forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Extensions] Remove ExtensionForceInstallMixin::kBackgroundPageReady
ExtensionForceInstallMixin has different "wait modes" that it uses when loading an extension. Two of these are kBackgroundPageFirstLoad and kBackgroundPageReady. The former waits for an extension's background page to complete its first full load. The latter was trying to map to the notification NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, which is fired from when a background page's document element is first available. However, due to some bugs and previously-poorly-named methods, it only actually applied to persistent background pages (with event pages potentially not waiting). We don't actually need these two separate methods. Waiting for a background page's first load is sufficient for all test cases (and happens after the document element is first available). Simply remove WaitMode::kBackgroundPageReady, and update all uses to instead be WaitMode::kBackgroundPageFirstLoad. Additionally, remove the ExtensionForceInstallMixin method IsExtensionBackgroundPageReady(). This had the same issues as above (only working for persistent background pages). Since this method is only called by a small number of tests and is associated with an action that should cause the background page to load, instead use an ExtensionHostTestHelper at each site. This also addresses potentially flaky / racy instances when (on an extremely slow bot), an event page may have already shut down after being opened. Finally, also replace usages of ExtensionBackgroundPageReadyObserver (which had the same background page issues) with ExtensionHostTestHelper. Bug: 1253332 Change-Id: I1d587172e9fc5706ee34b12d9a7421cb3a8814a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3194776 Commit-Queue: Devlin <[email protected]> Reviewed-by: Alexander Hendrich <[email protected]> Reviewed-by: Achuith Bhandarkar <[email protected]> Reviewed-by: Maksim Ivanov <[email protected]> Cr-Commit-Position: refs/heads/main@{#927435}
- Loading branch information
Showing
4 changed files
with
21 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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