From cfb99d1f4b4d93c337f035e15258b1bdc4583eb9 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 17 Jan 2020 09:02:51 +0000 Subject: [PATCH] Bug 1420296 - Test for same-origin file requests r=rpl Differential Revision: https://phabricator.services.mozilla.com/D54543 --HG-- extra : moz-landing-system : lando --- .../extensions/test/xpcshell/test_ext_file_access.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js b/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js index 7388a730fced..ff5619a03219 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js @@ -63,6 +63,13 @@ add_task(async function file_access_from_extension_page_not_allowed() { "block request to file from background page despite file permission" ); + // Regression test for bug 1420296 . + await browser.test.assertRejects( + fetch(FILE_DUMMY_URL, { mode: "same-origin" }), + /NetworkError when attempting to fetch resource/, + "block request to file from background page despite 'same-origin' mode" + ); + browser.test.sendMessage("done"); }, });