| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 EXPECT_TRUE(v); | 113 EXPECT_TRUE(v); |
| 114 if (!v) | 114 if (!v) |
| 115 return false; | 115 return false; |
| 116 | 116 |
| 117 // Check if the View tree and the Layer tree are in sync. | 117 // Check if the View tree and the Layer tree are in sync. |
| 118 EXPECT_EQ(l, v->layer()); | 118 EXPECT_EQ(l, v->layer()); |
| 119 if (v->layer() != l) | 119 if (v->layer() != l) |
| 120 return false; | 120 return false; |
| 121 | 121 |
| 122 // Check if the visibility states of the View and the Layer are in sync. | 122 // Check if the visibility states of the View and the Layer are in sync. |
| 123 EXPECT_EQ(l->IsDrawn(), v->IsVisibleInRootView()); | 123 EXPECT_EQ(l->IsDrawn(), v->IsDrawn()); |
| 124 if (v->IsVisibleInRootView() != l->IsDrawn()) { | 124 if (v->IsDrawn() != l->IsDrawn()) { |
| 125 for (const views::View* vv = v; vv; vv = vv->parent()) | 125 for (const views::View* vv = v; vv; vv = vv->parent()) |
| 126 LOG(ERROR) << "V: " << vv << " " << vv->visible() << " " | 126 LOG(ERROR) << "V: " << vv << " " << vv->visible() << " " |
| 127 << vv->IsVisibleInRootView() << " " << vv->layer(); | 127 << vv->IsDrawn() << " " << vv->layer(); |
| 128 for (const ui::Layer* ll = l; ll; ll = ll->parent()) | 128 for (const ui::Layer* ll = l; ll; ll = ll->parent()) |
| 129 LOG(ERROR) << "L: " << ll << " " << ll->IsDrawn(); | 129 LOG(ERROR) << "L: " << ll << " " << ll->IsDrawn(); |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Check if the size of the View and the Layer are in sync. | 133 // Check if the size of the View and the Layer are in sync. |
| 134 EXPECT_EQ(l->bounds(), v->bounds()); | 134 EXPECT_EQ(l->bounds(), v->bounds()); |
| 135 if (v->bounds() != l->bounds()) | 135 if (v->bounds() != l->bounds()) |
| 136 return false; | 136 return false; |
| 137 | 137 |
| (...skipping 2935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3073 ScrambleTree(content); | 3073 ScrambleTree(content); |
| 3074 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); | 3074 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); |
| 3075 | 3075 |
| 3076 ScrambleTree(content); | 3076 ScrambleTree(content); |
| 3077 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); | 3077 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); |
| 3078 } | 3078 } |
| 3079 | 3079 |
| 3080 #endif // VIEWS_COMPOSITOR | 3080 #endif // VIEWS_COMPOSITOR |
| 3081 | 3081 |
| 3082 } // namespace views | 3082 } // namespace views |
| OLD | NEW |