Bug 1393805 - Part 5: Test that the system extensions dev dir is readable from content. r=bobowen, a=ritu
authorHaik Aftandilian <haftandilian@mozilla.com>
Wed, 27 Sep 2017 16:01:57 -0700
changeset 432440 9040197e9047d5a28820943f91b8db0945581b74
parent 432439 031933e4a8dcb61c5189bcff2e2cf2d937faad15
child 432441 4522bc7343e6a569a032d95a5478192f1ca04f19
push id7955
push userryanvm@gmail.com
push dateThu, 12 Oct 2017 18:26:39 +0000
treeherdermozilla-beta@c8d3b27528f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen, ritu
bugs1393805
milestone57.0
Bug 1393805 - Part 5: Test that the system extensions dev dir is readable from content. r=bobowen, a=ritu 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 (isMac()) {
     // If ~/Library/Caches/TemporaryItems exists, when level <= 2 we
     // make sure it's readable. For level 3, we make sure it isn't.
     let homeTempDir = GetHomeDir();
     homeTempDir.appendRelativePath("Library/Caches/TemporaryItems");
     if (homeTempDir.exists()) {
       let shouldBeReadable, minLevel;
       if (level >= 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);
+}
+
 // Returns a file object for the file or directory named |name| in the
 // profile directory.
 function GetProfileEntry(name) {
   let entry = GetProfileDir();
   entry.append(name);
   return (entry);
 }