-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1943262 - Refactor instantiation of nsEffectiveTLDService r=cooki…
…e-reviewers,anti-tracking-reviewers,permissions-reviewers,emz This ensures that the instantiation of the service always returns the same singleton. I also changed calls to nsEffectiveTLDService::GetInstance to use mozilla::components::EffectiveTLD::Service() instead. Differential Revision: https://phabricator.services.mozilla.com/D235288
- Loading branch information
Showing
15 changed files
with
88 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
"use strict"; | ||
|
||
add_task(_ => { | ||
try { | ||
Cc["@mozilla.org/network/effective-tld-service;1"].createInstance( | ||
Ci.nsISupports | ||
); | ||
} catch (e) { | ||
is( | ||
e.result, | ||
Cr.NS_ERROR_XPC_CI_RETURNED_FAILURE, | ||
"Component creation as an instance fails with expected code" | ||
); | ||
} | ||
// Check that create instance and the service getter all return the same object. | ||
let etld = Cc["@mozilla.org/network/effective-tld-service;1"].createInstance( | ||
Ci.nsIEffectiveTLDService | ||
); | ||
|
||
Assert.equal(etld, Services.eTLD); | ||
|
||
// eslint-disable-next-line mozilla/use-services | ||
let etld2 = Cc["@mozilla.org/network/effective-tld-service;1"].getService( | ||
Ci.nsIEffectiveTLDService | ||
); | ||
|
||
Assert.equal(etld, etld2); | ||
}); |
Oops, something went wrong.