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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index 9d38689de893220e1c1d4ed9477d771c196599f9..b5c2a63756900adc90efe16df0091018e0d3a989 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -360,8 +360,10 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
}
-void DrawCallback(bool* executed, bool* result, bool drawn) {
- *executed = true;
+void DrawCallback(uint32* execute_count,
+ SurfaceDrawStatus* result,
+ SurfaceDrawStatus drawn) {
+ *execute_count += 1;
*result = drawn;
}
@@ -377,17 +379,16 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
frame_data->resource_list.push_back(resource);
scoped_ptr<CompositorFrame> frame(new CompositorFrame);
frame->delegated_frame_data = frame_data.Pass();
- bool executed = false;
- bool drawn = false;
+ uint32 execute_count = 0;
+ SurfaceDrawStatus drawn = SurfaceDrawStatus::DRAW_SKIPPED;
factory_.SubmitFrame(id, frame.Pass(),
- base::Bind(&DrawCallback, &executed, &drawn));
+ base::Bind(&DrawCallback, &execute_count, &drawn));
surface_id_ = SurfaceId();
- EXPECT_FALSE(executed);
factory_.DestroyAll();
- EXPECT_TRUE(executed);
- EXPECT_FALSE(drawn);
+ EXPECT_EQ(1u, execute_count);
+ EXPECT_EQ(SurfaceDrawStatus::DRAW_SKIPPED, drawn);
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698