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

Side by Side Diff: sandbox/win/src/integrity_level_test.cc

Issue 330853002: Add UIPI support for sandbox alternate desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: conditional tweak Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <atlsecurity.h> 6 #include <atlsecurity.h>
7 7
8 #include "base/win/windows_version.h" 8 #include "base/win/windows_version.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "sandbox/win/src/sandbox.h" 10 #include "sandbox/win/src/sandbox.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 TEST(IntegrityLevelTest, TestLowILReal) { 47 TEST(IntegrityLevelTest, TestLowILReal) {
48 if (base::win::GetVersion() != base::win::VERSION_VISTA) 48 if (base::win::GetVersion() != base::win::VERSION_VISTA)
49 return; 49 return;
50 50
51 TestRunner runner(JOB_LOCKDOWN, USER_INTERACTIVE, USER_INTERACTIVE); 51 TestRunner runner(JOB_LOCKDOWN, USER_INTERACTIVE, USER_INTERACTIVE);
52 52
53 runner.SetTimeout(INFINITE); 53 runner.SetTimeout(INFINITE);
54 54
55 runner.GetPolicy()->SetAlternateDesktop(true);
55 runner.GetPolicy()->SetIntegrityLevel(INTEGRITY_LEVEL_LOW); 56 runner.GetPolicy()->SetIntegrityLevel(INTEGRITY_LEVEL_LOW);
56 57
57 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"CheckIntegrityLevel")); 58 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"CheckIntegrityLevel"));
58 59
59 runner.SetTestState(BEFORE_REVERT); 60 runner.SetTestState(BEFORE_REVERT);
60 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"CheckIntegrityLevel")); 61 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"CheckIntegrityLevel"));
61 } 62 }
62 63
63 TEST(DelayedIntegrityLevelTest, TestLowILDelayed) { 64 TEST(DelayedIntegrityLevelTest, TestLowILDelayed) {
64 if (base::win::GetVersion() != base::win::VERSION_VISTA) 65 if (base::win::GetVersion() != base::win::VERSION_VISTA)
(...skipping 16 matching lines...) Expand all
81 return; 82 return;
82 83
83 TestRunner runner(JOB_LOCKDOWN, USER_INTERACTIVE, USER_INTERACTIVE); 84 TestRunner runner(JOB_LOCKDOWN, USER_INTERACTIVE, USER_INTERACTIVE);
84 85
85 runner.SetTimeout(INFINITE); 86 runner.SetTimeout(INFINITE);
86 87
87 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"CheckIntegrityLevel")); 88 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"CheckIntegrityLevel"));
88 } 89 }
89 90
90 } // namespace sandbox 91 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698