| 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 <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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2789 | 2789 |
| 2790 View* child = new View(); | 2790 View* child = new View(); |
| 2791 root.AddChildView(child); | 2791 root.AddChildView(child); |
| 2792 | 2792 |
| 2793 View* foo1 = new View(); | 2793 View* foo1 = new View(); |
| 2794 child->AddChildView(foo1); | 2794 child->AddChildView(foo1); |
| 2795 View* foo2 = new View(); | 2795 View* foo2 = new View(); |
| 2796 child->AddChildView(foo2); | 2796 child->AddChildView(foo2); |
| 2797 View* foo3 = new View(); | 2797 View* foo3 = new View(); |
| 2798 child->AddChildView(foo3); | 2798 child->AddChildView(foo3); |
| 2799 foo1->set_focusable(true); | 2799 foo1->SetFocusable(true); |
| 2800 foo2->set_focusable(true); | 2800 foo2->SetFocusable(true); |
| 2801 foo3->set_focusable(true); | 2801 foo3->SetFocusable(true); |
| 2802 | 2802 |
| 2803 ASSERT_EQ(0, child->GetIndexOf(foo1)); | 2803 ASSERT_EQ(0, child->GetIndexOf(foo1)); |
| 2804 ASSERT_EQ(1, child->GetIndexOf(foo2)); | 2804 ASSERT_EQ(1, child->GetIndexOf(foo2)); |
| 2805 ASSERT_EQ(2, child->GetIndexOf(foo3)); | 2805 ASSERT_EQ(2, child->GetIndexOf(foo3)); |
| 2806 ASSERT_EQ(foo2, foo1->GetNextFocusableView()); | 2806 ASSERT_EQ(foo2, foo1->GetNextFocusableView()); |
| 2807 ASSERT_EQ(foo3, foo2->GetNextFocusableView()); | 2807 ASSERT_EQ(foo3, foo2->GetNextFocusableView()); |
| 2808 ASSERT_EQ(NULL, foo3->GetNextFocusableView()); | 2808 ASSERT_EQ(NULL, foo3->GetNextFocusableView()); |
| 2809 | 2809 |
| 2810 // Move |foo2| at the end. | 2810 // Move |foo2| at the end. |
| 2811 child->ReorderChildView(foo2, -1); | 2811 child->ReorderChildView(foo2, -1); |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3508 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); | 3508 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); |
| 3509 ASSERT_EQ(3u, child_layers_post.size()); | 3509 ASSERT_EQ(3u, child_layers_post.size()); |
| 3510 EXPECT_EQ(v1->layer(), child_layers_post[0]); | 3510 EXPECT_EQ(v1->layer(), child_layers_post[0]); |
| 3511 EXPECT_EQ(v2->layer(), child_layers_post[1]); | 3511 EXPECT_EQ(v2->layer(), child_layers_post[1]); |
| 3512 EXPECT_EQ(v1_old_layer, child_layers_post[2]); | 3512 EXPECT_EQ(v1_old_layer, child_layers_post[2]); |
| 3513 } | 3513 } |
| 3514 | 3514 |
| 3515 #endif // USE_AURA | 3515 #endif // USE_AURA |
| 3516 | 3516 |
| 3517 } // namespace views | 3517 } // namespace views |
| OLD | NEW |