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

Side by Side Diff: content/browser/indexed_db/list_set_unittest.cc

Issue 2601983002: [IndexedDB] Adding transaction and value support to observers (Closed)
Patch Set: added comments and bug link Created 3 years, 11 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
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 "content/browser/indexed_db/list_set.h" 5 #include "content/browser/indexed_db/list_set.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const list_set<int>& ref = set; 43 const list_set<int>& ref = set;
44 44
45 list_set<int>::const_iterator it = ref.begin(); 45 list_set<int>::const_iterator it = ref.begin();
46 for (int i = 5; i > 0; --i) { 46 for (int i = 5; i > 0; --i) {
47 EXPECT_EQ(i, *it); 47 EXPECT_EQ(i, *it);
48 ++it; 48 ++it;
49 } 49 }
50 EXPECT_EQ(ref.end(), it); 50 EXPECT_EQ(ref.end(), it);
51 } 51 }
52 52
53 TEST(ListSetTest, ListSetInsertFront) {
54 list_set<int> set;
55 for (int i = 5; i > 0; --i)
56 set.insert(i);
57 for (int i = 6; i <= 10; ++i)
58 set.insert_front(i);
59
60 const list_set<int>& ref = set;
61
62 list_set<int>::const_iterator it = ref.begin();
63 for (int i = 10; i > 0; --i) {
64 EXPECT_EQ(i, *it);
65 ++it;
66 }
67 EXPECT_EQ(ref.end(), it);
68 }
69
53 TEST(ListSetTest, ListSetPrimitive) { 70 TEST(ListSetTest, ListSetPrimitive) {
54 list_set<int> set; 71 list_set<int> set;
55 EXPECT_TRUE(set.empty()); 72 EXPECT_TRUE(set.empty());
56 EXPECT_EQ(0u, set.size()); 73 EXPECT_EQ(0u, set.size());
57 { 74 {
58 list_set<int>::iterator it = set.begin(); 75 list_set<int>::iterator it = set.begin();
59 EXPECT_EQ(set.end(), it); 76 EXPECT_EQ(set.end(), it);
60 } 77 }
61 78
62 for (int i = 5; i > 0; --i) 79 for (int i = 5; i > 0; --i)
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 set.erase(r2); 251 set.erase(r2);
235 252
236 EXPECT_EQ(0u, set.size()); 253 EXPECT_EQ(0u, set.size());
237 { 254 {
238 list_set<scoped_refptr<RefCounted<int> > >::iterator it = set.begin(); 255 list_set<scoped_refptr<RefCounted<int> > >::iterator it = set.begin();
239 EXPECT_EQ(set.end(), it); 256 EXPECT_EQ(set.end(), it);
240 } 257 }
241 } 258 }
242 259
243 } // namespace content 260 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/list_set.h ('k') | content/child/indexed_db/indexed_db_callbacks_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698