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

Side by Side Diff: base/test/test_suite.cc

Issue 1580873003: Enable handle verifier for tests and add some tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable handle hooks for drmemory Created 4 years, 10 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
« no previous file with comments | « base/debug/close_handle_hook_win.cc ('k') | base/win/scoped_handle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/test/test_suite.h" 5 #include "base/test/test_suite.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 #include "testing/gtest/include/gtest/gtest.h" 33 #include "testing/gtest/include/gtest/gtest.h"
34 #include "testing/multiprocess_func_list.h" 34 #include "testing/multiprocess_func_list.h"
35 35
36 #if defined(OS_MACOSX) 36 #if defined(OS_MACOSX)
37 #include "base/mac/scoped_nsautorelease_pool.h" 37 #include "base/mac/scoped_nsautorelease_pool.h"
38 #if defined(OS_IOS) 38 #if defined(OS_IOS)
39 #include "base/test/test_listener_ios.h" 39 #include "base/test/test_listener_ios.h"
40 #endif // OS_IOS 40 #endif // OS_IOS
41 #endif // OS_MACOSX 41 #endif // OS_MACOSX
42 42
43 #if !defined(OS_WIN) 43 #if defined(OS_WIN)
44 #include "base/debug/close_handle_hook_win.h"
45 #include "base/win/windows_version.h"
46 #else
44 #include "base/i18n/rtl.h" 47 #include "base/i18n/rtl.h"
45 #if !defined(OS_IOS) 48 #if !defined(OS_IOS)
46 #include "base/strings/string_util.h" 49 #include "base/strings/string_util.h"
47 #include "third_party/icu/source/common/unicode/uloc.h" 50 #include "third_party/icu/source/common/unicode/uloc.h"
48 #endif 51 #endif
49 #endif 52 #endif
50 53
51 #if defined(OS_ANDROID) 54 #if defined(OS_ANDROID)
52 #include "base/test/test_support_android.h" 55 #include "base/test/test_support_android.h"
53 #endif 56 #endif
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 settings.log_file = log_filename.value().c_str(); 313 settings.log_file = log_filename.value().c_str();
311 settings.delete_old = logging::DELETE_OLD_LOG_FILE; 314 settings.delete_old = logging::DELETE_OLD_LOG_FILE;
312 logging::InitLogging(settings); 315 logging::InitLogging(settings);
313 // We want process and thread IDs because we may have multiple processes. 316 // We want process and thread IDs because we may have multiple processes.
314 // Note: temporarily enabled timestamps in an effort to catch bug 6361. 317 // Note: temporarily enabled timestamps in an effort to catch bug 6361.
315 logging::SetLogItems(true, true, true, true); 318 logging::SetLogItems(true, true, true, true);
316 #endif // else defined(OS_ANDROID) 319 #endif // else defined(OS_ANDROID)
317 320
318 CHECK(debug::EnableInProcessStackDumping()); 321 CHECK(debug::EnableInProcessStackDumping());
319 #if defined(OS_WIN) 322 #if defined(OS_WIN)
323 #if defined(_DEBUG)
scottmg 2016/02/01 16:45:31 It's sort of weird that sometimes it's disabled he
Will Harris 2016/02/01 19:16:12 Done. Another option is expose something like bas
324 // Handle hooks cause shutdown asserts in Debug on Windows 7. crbug.com/571304
325 if (base::win::GetVersion() >= base::win::VERSION_WIN8)
326 base::debug::InstallHandleHooks();
327 #else
328 base::debug::InstallHandleHooks();
329 #endif
330
320 RouteStdioToConsole(true); 331 RouteStdioToConsole(true);
321 // Make sure we run with high resolution timer to minimize differences 332 // Make sure we run with high resolution timer to minimize differences
322 // between production code and test code. 333 // between production code and test code.
323 Time::EnableHighResolutionTimer(true); 334 Time::EnableHighResolutionTimer(true);
324 #endif // defined(OS_WIN) 335 #endif // defined(OS_WIN)
325 336
326 // In some cases, we do not want to see standard error dialogs. 337 // In some cases, we do not want to see standard error dialogs.
327 if (!debug::BeingDebugged() && 338 if (!debug::BeingDebugged() &&
328 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { 339 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) {
329 SuppressErrorDialogs(); 340 SuppressErrorDialogs();
(...skipping 25 matching lines...) Expand all
355 366
356 TestTimeouts::Initialize(); 367 TestTimeouts::Initialize();
357 368
358 trace_to_file_.BeginTracingFromCommandLineOptions(); 369 trace_to_file_.BeginTracingFromCommandLineOptions();
359 } 370 }
360 371
361 void TestSuite::Shutdown() { 372 void TestSuite::Shutdown() {
362 } 373 }
363 374
364 } // namespace base 375 } // namespace base
OLDNEW
« no previous file with comments | « base/debug/close_handle_hook_win.cc ('k') | base/win/scoped_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698