Roger McFarlane | c9251650 | 2023-05-15 20:05:12 | [diff] [blame^] | 1 | // Copyright 2023 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/metrics/histogram_shared_memory.h" |
| 6 | #include "testing/gtest/include/gtest/gtest.h" |
| 7 | |
| 8 | namespace base { |
| 9 | |
| 10 | TEST(HistogramSharedMemory, Default) { |
| 11 | HistogramSharedMemory default_constructed; |
| 12 | EXPECT_FALSE(default_constructed.IsValid()); |
| 13 | } |
| 14 | |
| 15 | TEST(HistogramSharedMemory, Create) { |
| 16 | auto memory = HistogramSharedMemory::Create(1234, {"Test", 1 << 20}); |
| 17 | ASSERT_TRUE(memory.has_value()); |
| 18 | EXPECT_TRUE(memory->IsValid()); |
| 19 | } |
| 20 | |
| 21 | } // namespace base |