| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * TestFixture for SUID Sandbox testing. | 6 * TestFixture for SUID Sandbox testing. |
| 7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
| 8 * @constructor | 8 * @constructor |
| 9 */ | 9 */ |
| 10 function SandboxStatusUITest() {} | 10 function SandboxStatusUITest() {} |
| 11 | 11 |
| 12 SandboxStatusUITest.prototype = { | 12 SandboxStatusUITest.prototype = { |
| 13 __proto__: testing.Test.prototype, | 13 __proto__: testing.Test.prototype, |
| 14 /** | 14 /** |
| 15 * Browse to the options page & call our preLoad(). | 15 * Browse to the options page & call our preLoad(). |
| 16 */ | 16 */ |
| 17 browsePreload: 'chrome://sandbox', | 17 browsePreload: 'chrome://sandbox', |
| 18 | 18 |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // This test is for Linux only. | 21 // This test is for Linux only. |
| 22 // PLEASE READ: | 22 // PLEASE READ: |
| 23 // - If failures of this test are a problem on a bot under your care, | 23 // - If failures of this test are a problem on a bot under your care, |
| 24 // the proper way to address such failures is to install the SUID | 24 // the proper way to address such failures is to install the SUID |
| 25 // sandbox. See: | 25 // sandbox. See: |
| 26 // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_s
andbox_development.md | 26 // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_s
andbox_development.md |
| 27 // - PLEASE DO NOT GLOBALLY DISABLE THIS TEST. | 27 // - PLEASE DO NOT GLOBALLY DISABLE THIS TEST. |
| 28 // SUID sandbox is currently incompatible with AddressSanitizer, | 28 GEN('#if defined(OS_LINUX)'); |
| 29 // see http://crbug.com/137653. | |
| 30 GEN('#if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER)'); | |
| 31 GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\'); | 29 GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\'); |
| 32 GEN(' testSUIDorNamespaceSandboxEnabled'); | 30 GEN(' testSUIDorNamespaceSandboxEnabled'); |
| 33 GEN('#else'); | 31 GEN('#else'); |
| 34 GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\'); | 32 GEN('# define MAYBE_testSUIDorNamespaceSandboxEnabled \\'); |
| 35 GEN(' DISABLED_testSUIDorNamespaceSandboxEnabled'); | 33 GEN(' DISABLED_testSUIDorNamespaceSandboxEnabled'); |
| 36 GEN('#endif'); | 34 GEN('#endif'); |
| 37 | 35 |
| 38 /** | 36 /** |
| 39 * Test if the SUID sandbox is enabled. | 37 * Test if the SUID sandbox is enabled. |
| 40 */ | 38 */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 59 expectEquals(namespaceyesstring, namespaceyes[0]); | 57 expectEquals(namespaceyesstring, namespaceyes[0]); |
| 60 } | 58 } |
| 61 | 59 |
| 62 if (suidyes !== null) { | 60 if (suidyes !== null) { |
| 63 expectEquals(null, suidno); | 61 expectEquals(null, suidno); |
| 64 expectEquals(suidyesstring, suidyes[0]); | 62 expectEquals(suidyesstring, suidyes[0]); |
| 65 } | 63 } |
| 66 }); | 64 }); |
| 67 | 65 |
| 68 // The seccomp-bpf sandbox is also not compatible with ASAN. | 66 // The seccomp-bpf sandbox is also not compatible with ASAN. |
| 69 GEN('#if !defined(OS_LINUX) || defined(ADDRESS_SANITIZER)'); | 67 GEN('#if !defined(OS_LINUX)'); |
| 70 GEN('# define MAYBE_testBPFSandboxEnabled \\'); | 68 GEN('# define MAYBE_testBPFSandboxEnabled \\'); |
| 71 GEN(' DISABLED_testBPFSandboxEnabled'); | 69 GEN(' DISABLED_testBPFSandboxEnabled'); |
| 72 GEN('#else'); | 70 GEN('#else'); |
| 73 GEN('# define MAYBE_testBPFSandboxEnabled \\'); | 71 GEN('# define MAYBE_testBPFSandboxEnabled \\'); |
| 74 GEN(' testBPFSandboxEnabled'); | 72 GEN(' testBPFSandboxEnabled'); |
| 75 GEN('#endif'); | 73 GEN('#endif'); |
| 76 | 74 |
| 77 /** | 75 /** |
| 78 * Test if the seccomp-bpf sandbox is enabled. | 76 * Test if the seccomp-bpf sandbox is enabled. |
| 79 */ | 77 */ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 if (gpuyes || gpuno) { | 128 if (gpuyes || gpuno) { |
| 131 expectEquals(null, gpuno); | 129 expectEquals(null, gpuno); |
| 132 expectTrue(gpuyes && (gpuyes[0] == gpuyesstring)); | 130 expectTrue(gpuyes && (gpuyes[0] == gpuyesstring)); |
| 133 testDone(); | 131 testDone(); |
| 134 } | 132 } |
| 135 } | 133 } |
| 136 }) | 134 }) |
| 137 }); | 135 }); |
| 138 observer.observe(document.getElementById('basic-info'), {childList: true}); | 136 observer.observe(document.getElementById('basic-info'), {childList: true}); |
| 139 }); | 137 }); |
| OLD | NEW |