Closed
Bug 1671578
Opened 4 years ago
Closed 4 years ago
Implement GeckoSession.Loader.equals()
Categories
(GeckoView :: General, enhancement)
Tracking
(firefox84 fixed)
RESOLVED
FIXED
84 Branch
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: sebastian, Assigned: agi)
References
Details
Attachments
(1 file)
In AC we have a bunch of tests that verify that we forward the correct data to GeckoView.
A simplified example is:
engineSession.loadUrl("http://mozilla.org")
verify(geckoSession).loadUri(
"http://mozilla.org",
null as GeckoSession?,
GeckoSession.LOAD_FLAGS_NONE,
null as Map<String, String>?
)
If I translate this to using GeckoSession.Loader
:
verify(geckoSession).load(
GeckoSession.Loader()
.uri("https://www.mozilla.org")
)
... then this fails because since GeckoSession.Loader
doesn't implement equals
it falls back to comparing references. Implementing equals()
(and then probably also hashCode()
) would help us write test and would make GeckoSession.Loader
more like a data class in Kotlin or a Record in Java 14+.
Reporter | ||
Comment 1•4 years ago
|
||
Since all fields are private I also can't work around this by capturing the arguments and comparing myself.
Assignee | ||
Updated•4 years ago
|
Assignee: nobody → agi
Assignee | ||
Comment 2•4 years ago
|
||
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/55a5da81f312 Overload Loader.equals. r=snorp
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59fd9fd259e0 Backed out changeset 55a5da81f312 for linting opt failures. https://hg.mozilla.org/integration/autoland/rev/f20537ff856c Overload Loader.equals.
Comment 5•4 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox84:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•