Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_task(async () => {
- info("URI sent when record in DB");
- const client = RemoteSettings("public-suffix-list");
- const collection = await client.openCollection();
- await collection.clear(); // Empty the collection
- await collection.create(
- {
- id: "tld-dafsa",
- "commit-hash": "fake-commit-hash",
- attachment: {
- hash: "fake-hash",
- size: 37837,
- filename: "dafsa.bin",
- location:
- "main-workspace/public-suffix-list/1bb15755-b13e-4795-a185-34668a885f0a.bin",
- mimetype: "application/octet-stream",
- },
- },
- { synced: true }
- );
- const backup = client.attachments.download;
- client.attachments.download = async rec => {
- console.log("ran");
- return "file://mocked";
- };
- // Downloader.prototype.download = async rec => {
- // console.log("ran");
- // return `${rec.id}/fileURI`;
- // };
- const promiseSignal = TestUtils.topicObserved("public-suffix-list-updated");
- PublicSuffixList.init();
- const observed = await promiseSignal;
- Assert.equal(observed, "file://mocked");
- await collection.clear();
- client.attachments.download = backup;
- });
Add Comment
Please, Sign In to add comment