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

Side by Side Diff: base/property_bag_unittest.cc

Issue 8652002: Move PropertyBag to base. Originally this was in chrome\common because only chrome used it. Now t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: move to base namespace and forward declare where possible Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/property_bag.cc ('k') | chrome/browser/extensions/extension_omnibox_api.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/property_bag.h" 5 #include "base/property_bag.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace base {
9
8 TEST(PropertyBagTest, AddQueryRemove) { 10 TEST(PropertyBagTest, AddQueryRemove) {
9 PropertyBag bag; 11 PropertyBag bag;
10 PropertyAccessor<int> adaptor; 12 PropertyAccessor<int> adaptor;
11 13
12 // Should be no match initially. 14 // Should be no match initially.
13 EXPECT_TRUE(adaptor.GetProperty(&bag) == NULL); 15 EXPECT_TRUE(adaptor.GetProperty(&bag) == NULL);
14 16
15 // Add the value and make sure we get it back. 17 // Add the value and make sure we get it back.
16 const int kFirstValue = 1; 18 const int kFirstValue = 1;
17 adaptor.SetProperty(&bag, kFirstValue); 19 adaptor.SetProperty(&bag, kFirstValue);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ASSERT_TRUE(adaptor1.GetProperty(&copy)); 55 ASSERT_TRUE(adaptor1.GetProperty(&copy));
54 ASSERT_TRUE(adaptor2.GetProperty(&copy)); 56 ASSERT_TRUE(adaptor2.GetProperty(&copy));
55 EXPECT_EQ(kType1Value, *adaptor1.GetProperty(&copy)); 57 EXPECT_EQ(kType1Value, *adaptor1.GetProperty(&copy));
56 EXPECT_EQ(kType2Value, *adaptor2.GetProperty(&copy)); 58 EXPECT_EQ(kType2Value, *adaptor2.GetProperty(&copy));
57 59
58 // Clear it out, neither property should be left. 60 // Clear it out, neither property should be left.
59 copy = PropertyBag(); 61 copy = PropertyBag();
60 EXPECT_TRUE(adaptor1.GetProperty(&copy) == NULL); 62 EXPECT_TRUE(adaptor1.GetProperty(&copy) == NULL);
61 EXPECT_TRUE(adaptor2.GetProperty(&copy) == NULL); 63 EXPECT_TRUE(adaptor2.GetProperty(&copy) == NULL);
62 } 64 }
65
66 } // namespace base
OLDNEW
« no previous file with comments | « base/property_bag.cc ('k') | chrome/browser/extensions/extension_omnibox_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698