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

Unified Diff: chrome/test/data/webui/sandboxstatus_browsertest.js

Issue 916153003: Add namespace sandbox to about page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 | « chrome/browser/ui/webui/about_ui.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/sandboxstatus_browsertest.js
diff --git a/chrome/test/data/webui/sandboxstatus_browsertest.js b/chrome/test/data/webui/sandboxstatus_browsertest.js
index cc282069a141c4bd568a8c4b9a85a48c2c3f1cf6..b3fe7d526fd107a19f4ff07622720dd9152f3466 100644
--- a/chrome/test/data/webui/sandboxstatus_browsertest.js
+++ b/chrome/test/data/webui/sandboxstatus_browsertest.js
@@ -28,25 +28,41 @@ SandboxStatusUITest.prototype = {
// SUID sandbox is currently incompatible with AddressSanitizer,
// see http://crbug.com/137653.
GEN('#if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER)');
-GEN('# define MAYBE_testSUIDSandboxEnabled \\');
-GEN(' testSUIDSandboxEnabled');
+GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\');
+GEN(' testSUIDorNamespaceSandboxEnabled');
GEN('#else');
-GEN('# define MAYBE_testSUIDSandboxEnabled \\');
-GEN(' DISABLED_testSUIDSandboxEnabled');
+GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\');
+GEN(' DISABLED_testSUIDorNamespaceSandboxEnabled');
GEN('#endif');
/**
* Test if the SUID sandbox is enabled.
*/
-TEST_F('SandboxStatusUITest', 'MAYBE_testSUIDSandboxEnabled', function() {
+TEST_F('SandboxStatusUITest',
+ 'MAYBE_testSUIDorNamespaceSandboxEnabled', function() {
+ var namespaceyesstring = 'Namespace Sandbox\tYes';
+ var namespacenostring = 'Namespace Sandbox\tNo';
var suidyesstring = 'SUID Sandbox\tYes';
var suidnostring = 'SUID Sandbox\tNo';
+
var suidyes = document.body.innerText.match(suidyesstring);
var suidno = document.body.innerText.match(suidnostring);
+ var namespaceyes = document.body.innerText.match(namespaceyesstring);
+ var namespaceno = document.body.innerText.match(namespacenostring);
+
+ // Exactly one of the namespace or suid sandbox should be enabled.
+ expectTrue(suidyes !== null || namespaceyes !== null);
+ expectFalse(suidyes !== null && namespaceyes !== null);
+
+ if (namespaceyes !== null) {
+ expectEquals(null, namespaceno);
+ expectEquals(namespaceyesstring, namespaceyes[0]);
+ }
- expectEquals(null, suidno);
- assertFalse(suidyes === null);
- expectEquals(suidyesstring, suidyes[0]);
+ if (suidyes !== null) {
+ expectEquals(null, suidno);
+ expectEquals(suidyesstring, suidyes[0]);
+ }
});
// The seccomp-bpf sandbox is also not compatible with ASAN.
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698