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

Unified Diff: base/trace_event/memory_allocator_attributes_type_info_unittest.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_allocator_attributes_type_info.cc ('k') | base/trace_event/memory_allocator_dump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_allocator_attributes_type_info_unittest.cc
diff --git a/base/trace_event/memory_allocator_attributes_type_info_unittest.cc b/base/trace_event/memory_allocator_attributes_type_info_unittest.cc
deleted file mode 100644
index 5f69faef1521c809b5e0d89b97337650e1acf37c..0000000000000000000000000000000000000000
--- a/base/trace_event/memory_allocator_attributes_type_info_unittest.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/trace_event/memory_allocator_attributes_type_info.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace base {
-namespace trace_event {
-
-TEST(MemoryAllocatorAttributesTypeInfoTest, BasicTest) {
- MemoryAllocatorAttributesTypeInfo attrs;
- EXPECT_EQ("", attrs.Get("non_existing_alloc", "non_existing_attr"));
-
- attrs.Set("alloc", "attr", "type");
- EXPECT_TRUE(attrs.Exists("alloc", "attr"));
- EXPECT_FALSE(attrs.Exists("alloc", "foo"));
- EXPECT_FALSE(attrs.Exists("foo", "attr"));
- EXPECT_EQ("type", attrs.Get("alloc", "attr"));
-
- attrs.Set("alloc2", "attr", "type2");
- EXPECT_TRUE(attrs.Exists("alloc2", "attr"));
- EXPECT_FALSE(attrs.Exists("alloc2", "foo"));
- EXPECT_EQ("type", attrs.Get("alloc", "attr"));
- EXPECT_EQ("type2", attrs.Get("alloc2", "attr"));
-
- MemoryAllocatorAttributesTypeInfo other_attrs;
- other_attrs.Set("other_alloc", "other_attr", "other_type");
- other_attrs.Set("other_alloc", "attr", "other_type2");
- other_attrs.Set("other_alloc_2", "other_attr", "other_type");
- other_attrs.Set("other_alloc_2", "attr", "other_type3");
-
- // Check the merging logic.
- attrs.Update(other_attrs);
- EXPECT_EQ("other_type", attrs.Get("other_alloc", "other_attr"));
- EXPECT_EQ("other_type2", attrs.Get("other_alloc", "attr"));
- EXPECT_EQ("other_type", attrs.Get("other_alloc_2", "other_attr"));
- EXPECT_EQ("other_type3", attrs.Get("other_alloc_2", "attr"));
- EXPECT_EQ("type", attrs.Get("alloc", "attr"));
- EXPECT_EQ("type2", attrs.Get("alloc2", "attr"));
- EXPECT_FALSE(other_attrs.Exists("alloc", "attr"));
- EXPECT_FALSE(other_attrs.Exists("alloc2", "attr"));
-}
-
-// DEATH tests are not supported in Android / iOS.
-#if !defined(NDEBUG) && !defined(OS_ANDROID) && !defined(OS_IOS)
-TEST(MemoryAllocatorAttributesTypeInfoTest, DuplicatesDeathTest) {
- MemoryAllocatorAttributesTypeInfo attrs;
- attrs.Set("alloc", "attr", "type");
- MemoryAllocatorAttributesTypeInfo conflicting_attrs;
- conflicting_attrs.Set("alloc", "attr", "type2");
- ASSERT_DEATH(attrs.Set("alloc", "attr", "other_type"), "");
- ASSERT_DEATH(attrs.Update(conflicting_attrs), "");
-}
-#endif
-
-} // namespace trace_event
-} // namespace base
« no previous file with comments | « base/trace_event/memory_allocator_attributes_type_info.cc ('k') | base/trace_event/memory_allocator_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698