Chromium Code Reviews| 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 #include <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #define _ATL_NO_EXCEPTIONS | 7 #define _ATL_NO_EXCEPTIONS |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlsecurity.h> | 9 #include <atlsecurity.h> |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 | 134 |
| 135 TEST(AppContainerTest, RequiresImpersonation) { | 135 TEST(AppContainerTest, RequiresImpersonation) { |
| 136 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) | 136 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) |
| 137 return; | 137 return; |
| 138 | 138 |
| 139 TestRunner runner(JOB_UNPROTECTED, USER_RESTRICTED, USER_RESTRICTED); | 139 TestRunner runner(JOB_UNPROTECTED, USER_RESTRICTED, USER_RESTRICTED); |
| 140 EXPECT_EQ(SBOX_ERROR_CANNOT_INIT_APPCONTAINER, | 140 EXPECT_EQ(SBOX_ERROR_CANNOT_INIT_APPCONTAINER, |
| 141 runner.GetPolicy()->SetAppContainer(kAppContainerSid)); | 141 runner.GetPolicy()->SetAppContainer(kAppContainerSid)); |
| 142 } | 142 } |
| 143 | 143 |
| 144 // We are treating LowBox as another approach for launching appcontainer. | |
| 145 // For convenience including LowBox tests inside this file. | |
|
rvargas (doing something else)
2015/02/28 01:10:06
nit: remove lines 144-45
Shrikant Kelkar
2015/02/28 01:55:41
Done.
| |
| 146 // We expect TEST_DENIED because when we setup appcontainer through lowbox way | |
|
rvargas (doing something else)
2015/02/28 01:10:06
nit: Actually, I think we can remove the whole com
Shrikant Kelkar
2015/02/28 01:55:41
Done.
| |
| 147 // we are missing out on some initial setup of BNO and things like that, which | |
| 148 // seem to force NtOpenEvent to look for the object only inside | |
| 149 // AppContainerBasedNameObject namespace, where it doesn't find the required | |
| 150 // object. | |
| 151 TEST(AppContainerTest, DenyOpenEventForLowBox) { | |
| 152 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) | |
| 153 return; | |
| 154 | |
| 155 TestRunner runner(JOB_UNPROTECTED, USER_UNPROTECTED, USER_UNPROTECTED); | |
| 156 | |
| 157 base::win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, L"test")); | |
| 158 ASSERT_TRUE(event.IsValid()); | |
| 159 | |
| 160 EXPECT_EQ(SBOX_ALL_OK, runner.GetPolicy()->SetLowBox(kAppContainerSid)); | |
| 161 | |
| 162 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open f test")); | |
| 163 } | |
|
rvargas (doing something else)
2015/02/28 01:10:06
caveat: missing more tests for a future CL (as in,
Shrikant Kelkar
2015/02/28 01:55:41
Done.
| |
| 164 | |
| 144 } // namespace sandbox | 165 } // namespace sandbox |
| OLD | NEW |