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

Side by Side Diff: sandbox/tests/validation_tests/suite.cc

Issue 113190: Add support for alternate window station. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 // This file contains the validation tests for the sandbox. 5 // This file contains the validation tests for the sandbox.
6 // It includes the tests that need to be performed inside the 6 // It includes the tests that need to be performed inside the
7 // sandbox. 7 // sandbox.
8 8
9 #include <shlwapi.h> 9 #include <shlwapi.h>
10 10
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 EXPECT_EQ(SBOX_TEST_DENIED, 70 EXPECT_EQ(SBOX_TEST_DENIED,
71 runner.RunTest( 71 runner.RunTest(
72 L"OpenKey HKLM " 72 L"OpenKey HKLM "
73 L"\"Software\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon\"")); 73 L"\"Software\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon\""));
74 } 74 }
75 75
76 // Tests that the permissions on the Windowstation does not allow the sandbox 76 // Tests that the permissions on the Windowstation does not allow the sandbox
77 // to get to the interactive desktop or to make the sbox desktop interactive. 77 // to get to the interactive desktop or to make the sbox desktop interactive.
78 TEST(ValidationSuite, TestDesktop) { 78 TEST(ValidationSuite, TestDesktop) {
79 TestRunner runner; 79 TestRunner runner;
80 runner.GetPolicy()->SetDesktop(L"sbox_validation_desktop"); 80 runner.GetPolicy()->SetAlternateDesktop(false);
81 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"OpenInteractiveDesktop NULL")); 81 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"OpenInteractiveDesktop NULL"));
82 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"SwitchToSboxDesktop NULL")); 82 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"SwitchToSboxDesktop NULL"));
83 } 83 }
84 84
85 // Tests if the windows are correctly protected by the sandbox. 85 // Tests if the windows are correctly protected by the sandbox.
86 TEST(ValidationSuite, TestWindows) { 86 TEST(ValidationSuite, TestWindows) {
87 TestRunner runner; 87 TestRunner runner;
88 wchar_t command[1024] = {0}; 88 wchar_t command[1024] = {0};
89 89
90 wsprintf(command, L"ValidWindow %d", ::GetDesktopWindow()); 90 wsprintf(command, L"ValidWindow %d", ::GetDesktopWindow());
(...skipping 15 matching lines...) Expand all
106 // Tests if the threads are correctly protected by the sandbox. 106 // Tests if the threads are correctly protected by the sandbox.
107 TEST(ValidationSuite, TestThread) { 107 TEST(ValidationSuite, TestThread) {
108 TestRunner runner; 108 TestRunner runner;
109 wchar_t command[1024] = {0}; 109 wchar_t command[1024] = {0};
110 110
111 wsprintf(command, L"OpenThread %d", ::GetCurrentThreadId()); 111 wsprintf(command, L"OpenThread %d", ::GetCurrentThreadId());
112 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); 112 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command));
113 } 113 }
114 114
115 } // namespace sandbox 115 } // namespace sandbox
OLDNEW
« chrome/renderer/renderer_main_platform_delegate_win.cc ('K') | « sandbox/src/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698