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

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

Issue 2726733003: CSRSS lockdown: destroy CSRSS heap (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into destroy_heap Created 3 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
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 <limits.h> 5 #include <limits.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 7
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/win/scoped_handle.h" 9 #include "base/win/scoped_handle.h"
10 #include "sandbox/win/src/handle_closer_agent.h" 10 #include "sandbox/win/src/handle_closer_agent.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 CHECK_EQ(::WaitForSingleObject(finish_event, INFINITE), WAIT_OBJECT_0); 282 CHECK_EQ(::WaitForSingleObject(finish_event, INFINITE), WAIT_OBJECT_0);
283 CHECK(::CloseHandle(finish_event)); 283 CHECK(::CloseHandle(finish_event));
284 284
285 return SBOX_TEST_SUCCEEDED; 285 return SBOX_TEST_SUCCEEDED;
286 } 286 }
287 287
288 TEST(HandleCloserTest, RunThreadPool) { 288 TEST(HandleCloserTest, RunThreadPool) {
289 TestRunner runner; 289 TestRunner runner;
290 runner.SetTimeout(2000); 290 runner.SetTimeout(2000);
291 runner.SetTestState(AFTER_REVERT); 291 runner.SetTestState(AFTER_REVERT);
292 sandbox::TargetPolicy* policy = runner.GetPolicy();
293 292
294 // Sever the CSRSS connection by closing ALPC ports inside the sandbox. 293 // Sandbox policy will determine which platforms to disconnect CSRSS and when
295 CHECK_EQ(policy->AddKernelObjectToClose(L"ALPC Port", NULL), SBOX_ALL_OK); 294 // to close the CSRSS handle.
296 295
297 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"RunThreadPool")); 296 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"RunThreadPool"));
298 } 297 }
299 298
300 } // namespace sandbox 299 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698