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

Unified Diff: cc/quads/list_container_unittest.cc

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: rebase Created 6 years, 2 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/quads/list_container.cc ('k') | cc/quads/render_pass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/list_container_unittest.cc
diff --git a/cc/quads/list_container_unittest.cc b/cc/quads/list_container_unittest.cc
index dd06877d22f53aac20eb1ec713da09d48477119c..cb79f7aa8453ed74e8969acdb48ccb0bff5fab5c 100644
--- a/cc/quads/list_container_unittest.cc
+++ b/cc/quads/list_container_unittest.cc
@@ -525,5 +525,32 @@ TEST(ListContainerTest,
}
}
+TEST(ListContainerTest,
+ SimpleIterationAndReverseIterationWithIndexSharedQuadState) {
+ ListContainer<SharedQuadState> list;
+ std::vector<SharedQuadState*> sqs_list;
+ size_t size = 10;
+ for (size_t i = 0; i < size; ++i) {
+ sqs_list.push_back(list.AllocateAndConstruct<SharedQuadState>());
+ }
+ EXPECT_EQ(size, list.size());
+
+ size_t i = 0;
+ for (ListContainer<SharedQuadState>::Iterator iter = list.begin();
+ iter != list.end();
+ ++iter) {
+ EXPECT_EQ(i, iter.index());
+ ++i;
+ }
+
+ i = 0;
+ for (ListContainer<SharedQuadState>::ReverseIterator iter = list.rbegin();
+ iter != list.rend();
+ ++iter) {
+ EXPECT_EQ(i, iter.index());
+ ++i;
+ }
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/quads/list_container.cc ('k') | cc/quads/render_pass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698