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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 2467953003: LayerDebugInfo should not clobber trace output (Closed)
Patch Set: Created 4 years, 1 month 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 | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 46a33b3391c7c4ac437c19c475a210c4d398aa23..fff271db59ea928c1525367cf6f50a20ff3858b2 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -2245,4 +2245,15 @@ TEST_F(LayerWithRealCompositorTest, CompositorAnimationObserverTest) {
EXPECT_TRUE(animation_observer.shutdown());
}
+TEST(LayerDebugInfoTest, LayerNameDoesNotClobber) {
+ Layer layer(LAYER_NOT_DRAWN);
+ layer.set_name("foo");
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info =
+ layer.TakeDebugInfo(nullptr);
+ std::string trace_format("bar,");
+ debug_info->AppendAsTraceFormat(&trace_format);
+ std::string expected("bar,{\"layer_name\":\"foo\"}");
+ EXPECT_EQ(expected, trace_format);
+}
+
} // namespace ui
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698