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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 2238
2239 root->SetOpacity(0.5f); 2239 root->SetOpacity(0.5f);
2240 WaitForSwap(); 2240 WaitForSwap();
2241 EXPECT_EQ(1u, animation_observer.animation_step_count()); 2241 EXPECT_EQ(1u, animation_observer.animation_step_count());
2242 2242
2243 EXPECT_FALSE(animation_observer.shutdown()); 2243 EXPECT_FALSE(animation_observer.shutdown());
2244 ResetCompositor(); 2244 ResetCompositor();
2245 EXPECT_TRUE(animation_observer.shutdown()); 2245 EXPECT_TRUE(animation_observer.shutdown());
2246 } 2246 }
2247 2247
2248 TEST(LayerDebugInfoTest, LayerNameDoesNotClobber) {
2249 Layer layer(LAYER_NOT_DRAWN);
2250 layer.set_name("foo");
2251 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info =
2252 layer.TakeDebugInfo(nullptr);
2253 std::string trace_format("bar,");
2254 debug_info->AppendAsTraceFormat(&trace_format);
2255 std::string expected("bar,{\"layer_name\":\"foo\"}");
2256 EXPECT_EQ(expected, trace_format);
2257 }
2258
2248 } // namespace ui 2259 } // namespace ui
OLDNEW
« 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