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

Unified Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/surfaces/surface_aggregator_test_helpers.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator_unittest.cc
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index cea06ea617a0b49fdeb2252f5cc4d2ad65b520d6..4771c823b291db5b3981c8c62de2cbfd2576d31c 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -67,7 +67,7 @@ TEST_F(SurfaceAggregatorTest, ValidSurfaceNoFrame) {
class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest {
public:
- SurfaceAggregatorValidSurfaceTest() : allocator_(1u) {}
+ SurfaceAggregatorValidSurfaceTest() : allocator_(1u), child_allocator_(2u) {}
virtual void SetUp() {
SurfaceAggregatorTest::SetUp();
@@ -96,6 +96,12 @@ class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest {
TestPassesMatchExpectations(
expected_passes, expected_pass_count, &frame_data->render_pass_list);
+ // Ensure no duplicate pass ids output.
+ std::set<RenderPassId> used_passes;
+ for (auto* pass : frame_data->render_pass_list) {
+ EXPECT_TRUE(used_passes.insert(pass->id).second);
+ }
+
EXPECT_EQ(expected_surface_count,
aggregator_.previous_contained_surfaces().size());
for (size_t i = 0; i < expected_surface_count; i++) {
@@ -133,6 +139,7 @@ class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest {
protected:
SurfaceId root_surface_id_;
SurfaceIdAllocator allocator_;
+ SurfaceIdAllocator child_allocator_;
};
// Tests that a very simple frame containing only two solid color quads makes it
@@ -153,8 +160,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, MultiPassSimpleFrame) {
test::Quad::SolidColorQuad(SK_ColorLTGRAY)},
{test::Quad::SolidColorQuad(SK_ColorGRAY),
test::Quad::SolidColorQuad(SK_ColorDKGRAY)}};
- test::Pass passes[] = {test::Pass(quads[0], arraysize(quads[0])),
- test::Pass(quads[1], arraysize(quads[1]))};
+ test::Pass passes[] = {
+ test::Pass(quads[0], arraysize(quads[0]), RenderPassId(1, 1)),
+ test::Pass(quads[1], arraysize(quads[1]), RenderPassId(1, 2))};
SubmitFrame(passes, arraysize(passes), root_surface_id_);
@@ -341,7 +349,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, RootCopyRequest) {
// This tests referencing a surface that has multiple render passes.
TEST_F(SurfaceAggregatorValidSurfaceTest, MultiPassSurfaceReference) {
- SurfaceId embedded_surface_id = allocator_.GenerateId();
+ SurfaceId embedded_surface_id = child_allocator_.GenerateId();
factory_.Create(embedded_surface_id, SurfaceSize());
RenderPassId pass_ids[] = {RenderPassId(1, 1), RenderPassId(1, 2),
« no previous file with comments | « cc/surfaces/surface_aggregator_test_helpers.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698