Bug 1393805 - Part 5 - Test that the system extensions dev dir is readable from content. r?bobowen draft
authorHaik Aftandilian <haftandilian@mozilla.com>
Wed, 27 Sep 2017 16:01:57 -0700
changeset 675833 7242f8e6e03fd03b518d09c2a66778927afb5e51
parent 675832 50f8a9b914982c4328552a7db57d4988cb17ea68
child 734725 7a9755f488192ee4fc00250daf7207bc1f0ab6ec
push id83258
push userhaftandilian@mozilla.com
push dateThu, 05 Oct 2017 23:13:20 +0000
reviewersbobowen
bugs1393805
milestone58.0a1
Bug 1393805 - Part 5 - Test that the system extensions dev dir is readable from content. r?bobowen MozReview-Commit-ID: 7YN7S7R39CU
security/sandbox/test/browser_content_sandbox_fs.js
security/sandbox/test/browser_content_sandbox_utils.js
--- a/security/sandbox/test/browser_content_sandbox_fs.js
+++ b/security/sandbox/test/browser_content_sandbox_fs.js
@@ -400,16 +400,25 @@ async function testFileAccess() {
       desc:     "home dir",
       ok:       true,
       browser:  fileBrowser,
       file:     homeDir,
       minLevel: 0,
     });
   }
 
+  let sysExtDevDir = GetSystemExtensionsDevDir();
+  tests.push({
+    desc:     "system extensions dev dir",
+    ok:       true,
+    browser:  webBrowser,
+    file:     sysExtDevDir,
+    minLevel: 0,
+  });
+
   if (isWin()) {
     let extDir = GetPerUserExtensionDir();
     tests.push({
       desc:       "per-user extensions dir",
       ok:         true,
       browser:    webBrowser,
       file:       extDir,
       minLevel:   minHomeReadSandboxLevel(),
--- a/security/sandbox/test/browser_content_sandbox_utils.js
+++ b/security/sandbox/test/browser_content_sandbox_utils.js
@@ -66,16 +66,20 @@ function GetProfileDir() {
 }
 
 function GetHomeDir() {
   // get home directory
   let homeDir = Services.dirsvc.get("Home", Ci.nsIFile);
   return (homeDir);
 }
 
+function GetSystemExtensionsDevDir() {
+  return Services.dirsvc.get("XRESysExtDev", Ci.nsIFile);
+}
+
 function GetPerUserExtensionDir() {
   return Services.dirsvc.get("XREUSysExt", Ci.nsIFile);
 }
 
 // Returns a file object for the file or directory named |name| in the
 // profile directory.
 function GetProfileEntry(name) {
   let entry = GetProfileDir();