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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 unified diff | Download patch
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 <utility> 9 #include <utility>
10 10
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 private: 688 private:
689 scoped_ptr<NullLayerDelegate> default_layer_delegate_; 689 scoped_ptr<NullLayerDelegate> default_layer_delegate_;
690 690
691 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); 691 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest);
692 }; 692 };
693 693
694 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { 694 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) {
695 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); 695 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN));
696 std::string name = "\"\'\\/\b\f\n\r\t\n"; 696 std::string name = "\"\'\\/\b\f\n\r\t\n";
697 layer->set_name(name); 697 layer->set_name(name);
698 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info = 698 scoped_ptr<base::trace_event::ConvertableToTraceFormat> debug_info(
699 layer->TakeDebugInfo(layer->cc_layer_for_testing()); 699 layer->TakeDebugInfo(layer->cc_layer_for_testing()));
700 EXPECT_TRUE(debug_info.get()); 700 EXPECT_TRUE(debug_info.get());
701 std::string json; 701 std::string json;
702 debug_info->AppendAsTraceFormat(&json); 702 debug_info->AppendAsTraceFormat(&json);
703 base::JSONReader json_reader; 703 base::JSONReader json_reader;
704 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json)); 704 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json));
705 EXPECT_TRUE(debug_info_value); 705 EXPECT_TRUE(debug_info_value);
706 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY)); 706 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY));
707 base::DictionaryValue* dictionary = 0; 707 base::DictionaryValue* dictionary = 0;
708 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary)); 708 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary));
709 std::string roundtrip; 709 std::string roundtrip;
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 root->SetOpacity(0.5f); 1811 root->SetOpacity(0.5f);
1812 WaitForSwap(); 1812 WaitForSwap();
1813 EXPECT_EQ(1u, animation_observer.animation_step_count()); 1813 EXPECT_EQ(1u, animation_observer.animation_step_count());
1814 1814
1815 EXPECT_FALSE(animation_observer.shutdown()); 1815 EXPECT_FALSE(animation_observer.shutdown());
1816 ResetCompositor(); 1816 ResetCompositor();
1817 EXPECT_TRUE(animation_observer.shutdown()); 1817 EXPECT_TRUE(animation_observer.shutdown());
1818 } 1818 }
1819 1819
1820 } // namespace ui 1820 } // namespace ui
OLDNEW
« cc/layers/layer_impl.cc ('K') | « ui/compositor/layer.cc ('k') | ui/events/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698