-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebUI: Split TestBrowserProxy from TestMock
TestBrowserProxy was intended as a way to stub out BrowserProxy classes, and to be set up extending an interface, e.g.: class MyTestBrowserProxy extends TestBrowserProxy implements MyProxy { } Later on, the "fromClass()" initializer and related methods were added in an attempt to transform TestBrowserProxy into a generic mocking utility. Unfortunately, the need to support the huge number of existing TestBrowserProxy users of the form above necessitated a few type hacks, e.g. setting a default type of "any" for the template type and allowing initialization via a constructor as well as via fromClass. See https://bugs.chromium.org/p/chromium/issues/detail?id=1076168#c8 for some initial discussion that came up when the pattern was added. Moreover, there were several places in the code using TestBrowserProxy in both ways, generally with a mock-style proxy wrapped inside the "extends" style proxy. This further demonstrated TestBrowserProxy had become 2 different classes merged into one (although the two share some limited functionality, e.g. methodCalled()). This CL forks TestBrowserProxy into TestBrowserProxy and TestMock, removes the "fromClass" initializer and related methods from TestBrowserProxy to make it clear it is intended to be used as above, and makes the constructor for TestMock private and removes " = any" to clarify that users wanting the generic mock should initialize it only with fromClass(). Bug: 1076168 Change-Id: Ic55dd186a5a3835ab9fea2ef8ad96e2b98eeeff5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4232884 Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/main@{#1103346}
- Loading branch information
Rebekah Potter
authored and
Chromium LUCI CQ
committed
Feb 9, 2023
1 parent
dc0c910
commit 6a6d224
Showing
56 changed files
with
322 additions
and
211 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
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
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
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
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.