| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 private: | 639 private: |
| 640 scoped_ptr<NullLayerDelegate> default_layer_delegate_; | 640 scoped_ptr<NullLayerDelegate> default_layer_delegate_; |
| 641 | 641 |
| 642 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); | 642 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); |
| 643 }; | 643 }; |
| 644 | 644 |
| 645 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { | 645 TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { |
| 646 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); | 646 scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); |
| 647 std::string name = "\"\'\\/\b\f\n\r\t\n"; | 647 std::string name = "\"\'\\/\b\f\n\r\t\n"; |
| 648 layer->set_name(name); | 648 layer->set_name(name); |
| 649 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info = | 649 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info = |
| 650 layer->TakeDebugInfo(); | 650 layer->TakeDebugInfo(); |
| 651 EXPECT_TRUE(!!debug_info.get()); | 651 EXPECT_TRUE(!!debug_info.get()); |
| 652 std::string json; | 652 std::string json; |
| 653 debug_info->AppendAsTraceFormat(&json); | 653 debug_info->AppendAsTraceFormat(&json); |
| 654 base::JSONReader json_reader; | 654 base::JSONReader json_reader; |
| 655 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json)); | 655 scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(json)); |
| 656 EXPECT_TRUE(!!debug_info_value); | 656 EXPECT_TRUE(!!debug_info_value); |
| 657 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY)); | 657 EXPECT_TRUE(debug_info_value->IsType(base::Value::TYPE_DICTIONARY)); |
| 658 base::DictionaryValue* dictionary = 0; | 658 base::DictionaryValue* dictionary = 0; |
| 659 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary)); | 659 EXPECT_TRUE(debug_info_value->GetAsDictionary(&dictionary)); |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 MakeFrameData(gfx::Size(10, 10)))); | 1741 MakeFrameData(gfx::Size(10, 10)))); |
| 1742 layer->SetShowDelegatedContent(frame_provider.get(), gfx::Size(10, 10)); | 1742 layer->SetShowDelegatedContent(frame_provider.get(), gfx::Size(10, 10)); |
| 1743 | 1743 |
| 1744 EXPECT_FALSE(delegate.delegated_frame_damage_called()); | 1744 EXPECT_FALSE(delegate.delegated_frame_damage_called()); |
| 1745 layer->OnDelegatedFrameDamage(damage_rect); | 1745 layer->OnDelegatedFrameDamage(damage_rect); |
| 1746 EXPECT_TRUE(delegate.delegated_frame_damage_called()); | 1746 EXPECT_TRUE(delegate.delegated_frame_damage_called()); |
| 1747 EXPECT_EQ(damage_rect, delegate.delegated_frame_damage_rect()); | 1747 EXPECT_EQ(damage_rect, delegate.delegated_frame_damage_rect()); |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 } // namespace ui | 1750 } // namespace ui |
| OLD | NEW |