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 LazyBackgroundObserver
LazyBackgroundObserver is a test class that provides utilities to wait for an extension's background page to open (WaitUntilLoaded()), close (WaitUntilClosed()), or both open and then close (Wait()). The functionality of this class can be entirely replaced by the ExtensionHostTestHelper: Before: LazyBackgroundObserver lazy_background_observer(profile()) ... lazy_background_observer.Wait(); After: ExtensionHostTestHelper host_helper(profile()); host_helper.RestrictToType( mojom::ViewType::kExtensionBackgroundPage); ... host_helper.WaitForDocumentElementAvailable(); host_helper.WaitForExtensionHostDestroyed(); This is slightly more verbose, however: - This verbosity is actually rather useful in the test. It was not clear from many callsites that they were actually waiting for a full open + close cycle, and some did not need to wait for both events. - This reduces the number of ExtensionHost / background waiting utilities we have, which is helpful (and ExtensionHostTestHelper is far more generally useful than LazyBackgroundObserver). Also ensure that ExtensionHostTestHelper checks the BrowserContext of the ExtensionHost when waiting for an event (since it might be the on- or off-the-record pair of the one the host helper was constructed with). Bug: 991464 Change-Id: I7cb35846441c7ad977d6cf3111c397ff84575bb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3182756 Reviewed-by: Noel Gordon <noel@chromium.org> Reviewed-by: David Bertoni <dbertoni@chromium.org> Commit-Queue: David Bertoni <dbertoni@chromium.org> Cr-Commit-Position: refs/heads/main@{#926343}
- Loading branch information
Showing
10 changed files
with
135 additions
and
102 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
Oops, something went wrong.