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

Unified Diff: ui/compositor/compositor_unittest.cc

Issue 1976833002: Add some printf debugging to narrow CreateAndReleaseOutputSurface crash Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: printfdebugging: . Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor_unittest.cc
diff --git a/ui/compositor/compositor_unittest.cc b/ui/compositor/compositor_unittest.cc
index 7115bd43caf66883a5cdc62c7acc543005ccc1ad..c45f444c25ec61e1ff1b7de8f33d493d2c0c1e12 100644
--- a/ui/compositor/compositor_unittest.cc
+++ b/ui/compositor/compositor_unittest.cc
@@ -317,28 +317,44 @@ TEST_F(CompositorTestWithMockedTime,
compositor()->SetVisible(true);
}
-#if defined(OS_WIN)
-// TODO(crbug.com/608436): Flaky on windows trybots
-#define MAYBE_CreateAndReleaseOutputSurface \
- DISABLED_CreateAndReleaseOutputSurface
-#else
-#define MAYBE_CreateAndReleaseOutputSurface CreateAndReleaseOutputSurface
-#endif
-TEST_F(CompositorTestWithMessageLoop, MAYBE_CreateAndReleaseOutputSurface) {
+TEST_F(CompositorTestWithMessageLoop, CreateAndReleaseOutputSurface) {
+ LOG(ERROR) << "> Setup";
std::unique_ptr<Layer> root_layer(new Layer(ui::LAYER_SOLID_COLOR));
root_layer->SetBounds(gfx::Rect(10, 10));
compositor()->SetRootLayer(root_layer.get());
compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10));
- DCHECK(compositor()->IsVisible());
+ ASSERT_TRUE(compositor()->IsVisible());
+ LOG(ERROR) << "< Setup";
+
+ LOG(ERROR) << "> ScheduleDraw 1";
compositor()->ScheduleDraw();
DrawWaiterForTest::WaitForCompositingEnded(compositor());
+ LOG(ERROR) << "< ScheduleDraw 1";
+
+ // Go invisible and release the widget.
+ LOG(ERROR) << "> SetVisible(false)";
compositor()->SetVisible(false);
+ LOG(ERROR) << "< SetVisible(false)";
+ LOG(ERROR) << "> ReleaseAcceleratedWidget";
EXPECT_EQ(gfx::kNullAcceleratedWidget,
compositor()->ReleaseAcceleratedWidget());
+ LOG(ERROR) << "< ReleaseAcceleratedWidget";
+
+ // Set a new widget and become visible again.
+ LOG(ERROR) << "> SetAcceleratedWidget";
compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
+ LOG(ERROR) << "< SetAcceleratedWidget";
+ LOG(ERROR) << "> SetVisible(true)";
compositor()->SetVisible(true);
+ LOG(ERROR) << "< SetVisible(true)";
+
+ LOG(ERROR) << "> ScheduleDraw 2";
compositor()->ScheduleDraw();
+ LOG(ERROR) << "< ScheduleDraw 2";
+ LOG(ERROR) << "> Wait for draw 2";
DrawWaiterForTest::WaitForCompositingEnded(compositor());
+ LOG(ERROR) << "< Wait for draw 2";
+
compositor()->SetRootLayer(nullptr);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698