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

Unified 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, 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 | « cc/base/sidecar_list_container.h ('k') | cc/playback/display_item_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/sidecar_list_container_unittest.cc
diff --git a/cc/base/sidecar_list_container_unittest.cc b/cc/base/sidecar_list_container_unittest.cc
index d8fc9ef2ff5c9d21bf9ccd81946932f62130e074..0012014df8f9d1a3b32df59952ec543e3a655a29 100644
--- a/cc/base/sidecar_list_container_unittest.cc
+++ b/cc/base/sidecar_list_container_unittest.cc
@@ -182,5 +182,17 @@ TEST(SidecarListContainerTest, AddingAndRemovingElements) {
EXPECT_EQ(container.end(), container.begin());
}
+TEST(SidecarListContainerTest, RemoveLast) {
+ // We need only ensure that the sidecar is also destroyed on RemoveLast.
+ // The rest is logic already present in ListContainer.
+ bool sidecar_destroyed = false;
+ TestContainer container;
+ TestElement* element = container.AllocateAndConstruct<TestElement>();
+ new (container.GetSidecar(element)) TestSidecar(&sidecar_destroyed);
+ ASSERT_FALSE(sidecar_destroyed);
+ container.RemoveLast();
+ ASSERT_TRUE(sidecar_destroyed);
+}
+
} // namespace
} // namespace cc
« 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