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

Unified Diff: sandbox/win/src/named_pipe_policy_test.cc

Issue 1814863004: Cleanup/Remove Windows XP/Vista version checks from Windows sandbox code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes Created 4 years, 9 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
Index: sandbox/win/src/named_pipe_policy_test.cc
diff --git a/sandbox/win/src/named_pipe_policy_test.cc b/sandbox/win/src/named_pipe_policy_test.cc
index 813cf1f4640290993504d44e5bac62f2fdbf3242..04f048832e3d76d07b2d181261861fbe7df59efa 100644
--- a/sandbox/win/src/named_pipe_policy_test.cc
+++ b/sandbox/win/src/named_pipe_policy_test.cc
@@ -71,12 +71,8 @@ TEST(NamedPipePolicyTest, CreatePipe) {
EXPECT_EQ(SBOX_TEST_SUCCEEDED,
runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\testbleh"));
- // On XP, the sandbox can create a pipe without any help but it fails on
- // Vista+, this is why we do not test the "denied" case.
- if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_VISTA) {
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\bleh"));
- }
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\bleh"));
}
// Tests if we can create a pipe with a path traversal in the sandbox.
@@ -88,18 +84,14 @@ TEST(NamedPipePolicyTest, CreatePipeTraversal) {
TargetPolicy::NAMEDPIPES_ALLOW_ANY,
L"\\\\.\\pipe\\test*"));
- // On XP, the sandbox can create a pipe without any help but it fails on
- // Vista+, this is why we do not test the "denied" case.
- if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_VISTA) {
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test\\..\\bleh"));
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test/../bleh"));
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test\\../bleh"));
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test/..\\bleh"));
- }
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test\\..\\bleh"));
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test/../bleh"));
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test\\../bleh"));
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\test/..\\bleh"));
}
// This tests that path canonicalization is actually disabled if we use \\?\
@@ -129,12 +121,8 @@ TEST(NamedPipePolicyTest, CreatePipeStrictInterceptions) {
EXPECT_EQ(SBOX_TEST_SUCCEEDED,
runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\testbleh"));
- // On XP, the sandbox can create a pipe without any help but it fails on
- // Vista+, this is why we do not test the "denied" case.
- if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_VISTA) {
- EXPECT_EQ(SBOX_TEST_DENIED,
- runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\bleh"));
- }
+ EXPECT_EQ(SBOX_TEST_DENIED,
+ runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\bleh"));
}
} // namespace sandbox

Powered by Google App Engine
This is Rietveld 408576698