Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1060)

Unified Diff: content/common/sandbox_mac_diraccess_unittest.mm

Issue 469383002: Fix Mac sandbox meta data access (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_mac_diraccess_unittest.mm
diff --git a/content/common/sandbox_mac_diraccess_unittest.mm b/content/common/sandbox_mac_diraccess_unittest.mm
index 06a5442b2556383f5121243fb90e10927977b5a8..7fb7d45ce6d8e5335e2f11acb78288bc5932dd83 100644
--- a/content/common/sandbox_mac_diraccess_unittest.mm
+++ b/content/common/sandbox_mac_diraccess_unittest.mm
@@ -127,7 +127,6 @@ TEST_F(MacDirAccessSandboxTest, RegexEscape) {
std::string out;
EXPECT_TRUE(Sandbox::QuoteStringForRegex(in_utf8, &out));
EXPECT_EQ(expected, out);
-
}
}
@@ -178,6 +177,18 @@ TEST_F(MacDirAccessSandboxTest, SandboxAccess) {
}
}
+TEST_F(MacDirAccessSandboxTest, AllowMetadataForPath) {
+ {
+ std::string expected(
+ "(allow file-read-metadata (literal \"/\")(literal \"/System\")"
+ "(literal \"/System/Library\")"
+ "(literal \"/System/Library/Frameworks\"))");
+ NSString* sandbox_command = Sandbox::AllowMetadataForPath(
+ base::FilePath("/System/Library/Frameworks"));
+ EXPECT_EQ(base::SysNSStringToUTF8(sandbox_command), expected);
+ }
+}
+
MULTIPROCESS_TEST_MAIN(mac_sandbox_path_access) {
char *sandbox_allowed_dir = getenv(kSandboxAccessPathKey);
if (!sandbox_allowed_dir)
« no previous file with comments | « content/common/sandbox_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698