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

Side by Side Diff: cc/base/sidecar_list_container_unittest.cc

Issue 1163803003: cc: Implement RemoveLast for DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: danakj comments Created 5 years, 6 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
« no previous file with comments | « cc/base/sidecar_list_container.h ('k') | cc/playback/display_item_list.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 Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/base/sidecar_list_container.h" 5 #include "cc/base/sidecar_list_container.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 num_elements++; 175 num_elements++;
176 } 176 }
177 EXPECT_EQ(kNumElementsForTest, num_elements); 177 EXPECT_EQ(kNumElementsForTest, num_elements);
178 178
179 container.clear(); 179 container.clear();
180 EXPECT_TRUE(container.empty()); 180 EXPECT_TRUE(container.empty());
181 EXPECT_EQ(0u, container.size()); 181 EXPECT_EQ(0u, container.size());
182 EXPECT_EQ(container.end(), container.begin()); 182 EXPECT_EQ(container.end(), container.begin());
183 } 183 }
184 184
185 TEST(SidecarListContainerTest, RemoveLast) {
186 // We need only ensure that the sidecar is also destroyed on RemoveLast.
187 // The rest is logic already present in ListContainer.
188 bool sidecar_destroyed = false;
189 TestContainer container;
190 TestElement* element = container.AllocateAndConstruct<TestElement>();
191 new (container.GetSidecar(element)) TestSidecar(&sidecar_destroyed);
192 ASSERT_FALSE(sidecar_destroyed);
193 container.RemoveLast();
194 ASSERT_TRUE(sidecar_destroyed);
195 }
196
185 } // namespace 197 } // namespace
186 } // namespace cc 198 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/sidecar_list_container.h ('k') | cc/playback/display_item_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698