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

Unified Diff: base/win/scoped_handle_unittest.cc

Issue 1545473002: Revert Active Verifier tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « base/win/scoped_handle.cc ('k') | chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_handle_unittest.cc
diff --git a/base/win/scoped_handle_unittest.cc b/base/win/scoped_handle_unittest.cc
index 552e19d5aa0b26a877ab88af39997d29bc0e443d..b573b66450195bfc9f02193564d846b32fb160fe 100644
--- a/base/win/scoped_handle_unittest.cc
+++ b/base/win/scoped_handle_unittest.cc
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <windows.h>
-#include <winternl.h>
-
#include "base/win/scoped_handle.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -33,38 +30,3 @@ TEST(ScopedHandleTest, ScopedHandle) {
handle_holder = handle_source.Pass();
EXPECT_EQ(magic_error, ::GetLastError());
}
-
-TEST(ScopedHandleTest, ActiveVerifierCloseTracked) {
- HANDLE handle = ::CreateMutex(nullptr, FALSE, nullptr);
- ASSERT_NE(HANDLE(NULL), handle);
- ASSERT_DEATH({
- base::win::ScopedHandle handle_holder(handle);
- // Calling CloseHandle on a tracked handle should crash.
- ::CloseHandle(handle);
- }, "CloseHandle called on tracked handle.");
-}
-
-TEST(ScopedHandleTest, ActiveVerifierTrackedHasBeenClosed) {
- HANDLE handle = ::CreateMutex(nullptr, FALSE, nullptr);
- ASSERT_NE(HANDLE(NULL), handle);
- typedef NTSTATUS(WINAPI * NtCloseFunc)(HANDLE);
- NtCloseFunc ntclose = reinterpret_cast<NtCloseFunc>(
- GetProcAddress(GetModuleHandle(L"ntdll.dll"), "NtClose"));
- ASSERT_NE(nullptr, ntclose);
-
- ASSERT_DEATH({
- base::win::ScopedHandle handle_holder(handle);
- ntclose(handle);
- // Destructing a ScopedHandle with an illegally closed handle should fail.
- }, "CloseHandle failed.");
-}
-
-TEST(ScopedHandleTest, ActiveVerifierDoubleTracking) {
- HANDLE handle = ::CreateMutex(nullptr, FALSE, nullptr);
- ASSERT_NE(HANDLE(NULL), handle);
-
- ASSERT_DEATH({
- base::win::ScopedHandle handle_holder(handle);
- base::win::ScopedHandle handle_holder2(handle);
- }, "Attempt to start tracking already tracked handle.");
-}
« no previous file with comments | « base/win/scoped_handle.cc ('k') | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698