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

Side by Side Diff: util/win/process_info_test.cc

Issue 1426533008: Make ScopedGeneric uses slightly more consistent (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 1 month 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 | « client/settings.cc ('k') | util/win/scoped_local_alloc.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 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 518 }
519 519
520 struct ScopedRegistryKeyCloseTraits { 520 struct ScopedRegistryKeyCloseTraits {
521 static HKEY InvalidValue() { 521 static HKEY InvalidValue() {
522 return nullptr; 522 return nullptr;
523 } 523 }
524 static void Free(HKEY key) { 524 static void Free(HKEY key) {
525 RegCloseKey(key); 525 RegCloseKey(key);
526 } 526 }
527 }; 527 };
528
528 using ScopedRegistryKey = 529 using ScopedRegistryKey =
529 base::ScopedGeneric<HKEY, ScopedRegistryKeyCloseTraits>; 530 base::ScopedGeneric<HKEY, ScopedRegistryKeyCloseTraits>;
530 531
531 TEST(ProcessInfo, Handles) { 532 TEST(ProcessInfo, Handles) {
532 ScopedTempDir temp_dir; 533 ScopedTempDir temp_dir;
533 534
534 ScopedFileHandle file(LoggingOpenFileForWrite( 535 ScopedFileHandle file(LoggingOpenFileForWrite(
535 temp_dir.path().Append(FILE_PATH_LITERAL("test_file")), 536 temp_dir.path().Append(FILE_PATH_LITERAL("test_file")),
536 FileWriteMode::kTruncateOrCreate, 537 FileWriteMode::kTruncateOrCreate,
537 FilePermissions::kWorldReadable)); 538 FilePermissions::kWorldReadable));
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 EXPECT_TRUE( 639 EXPECT_TRUE(
639 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>( 640 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>(
640 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize))); 641 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize)));
641 EXPECT_FALSE(info.LoggingRangeIsFullyReadable( 642 EXPECT_FALSE(info.LoggingRangeIsFullyReadable(
642 CheckedRange<WinVMAddress, WinVMSize>(0, 1024))); 643 CheckedRange<WinVMAddress, WinVMSize>(0, 1024)));
643 } 644 }
644 645
645 } // namespace 646 } // namespace
646 } // namespace test 647 } // namespace test
647 } // namespace crashpad 648 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/settings.cc ('k') | util/win/scoped_local_alloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698