| OLD | NEW |
| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 scoped_ptr<NullLayerDelegate> default_layer_delegate_; | 685 scoped_ptr<NullLayerDelegate> default_layer_delegate_; |
| 686 | 686 |
| 687 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); | 687 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); |
| 688 }; | 688 }; |
| 689 | 689 |
| 690 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { | 690 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { |
| 691 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); | 691 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); |
| 692 std::string name = "\"\'\\/\b\f\n\r\t\n"; | 692 std::string name = "\"\'\\/\b\f\n\r\t\n"; |
| 693 layer->set_name(name); | 693 layer->set_name(name); |
| 694 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info = | 694 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info = |
| 695 layer->TakeDebugInfo(layer->cc_layer_for_testing()); | 695 layer->TakeDebugInfo(); |
| 696 EXPECT_TRUE(debug_info.get()); | 696 EXPECT_TRUE(debug_info.get()); |
| 697 std::string json; | 697 std::string json; |
| 698 debug_info->AppendAsTraceFormat(&json); | 698 debug_info->AppendAsTraceFormat(&json); |
| 699 base::JSONReader json_reader; | 699 base::JSONReader json_reader; |
| 700 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json)); | 700 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json)); |
| 701 EXPECT_TRUE(debug_info_value); | 701 EXPECT_TRUE(debug_info_value); |
| 702 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY)); | 702 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY)); |
| 703 base::DictionaryValue* dictionary = 0; | 703 base::DictionaryValue* dictionary = 0; |
| 704 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary)); | 704 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary)); |
| 705 std::string roundtrip; | 705 std::string roundtrip; |
| (...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 root->SetOpacity(0.5f); | 1873 root->SetOpacity(0.5f); |
| 1874 WaitForSwap(); | 1874 WaitForSwap(); |
| 1875 EXPECT_EQ(1u, animation_observer.animation_step_count()); | 1875 EXPECT_EQ(1u, animation_observer.animation_step_count()); |
| 1876 | 1876 |
| 1877 EXPECT_FALSE(animation_observer.shutdown()); | 1877 EXPECT_FALSE(animation_observer.shutdown()); |
| 1878 ResetCompositor(); | 1878 ResetCompositor(); |
| 1879 EXPECT_TRUE(animation_observer.shutdown()); | 1879 EXPECT_TRUE(animation_observer.shutdown()); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 } // namespace ui | 1882 } // namespace ui |
| OLD | NEW |