| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 WindowTreeConnection* embedded2 = Embed(child2).connection; | 809 WindowTreeConnection* embedded2 = Embed(child2).connection; |
| 810 ASSERT_NE(nullptr, embedded2); | 810 ASSERT_NE(nullptr, embedded2); |
| 811 WindowTreeConnection* embedded3 = Embed(child3).connection; | 811 WindowTreeConnection* embedded3 = Embed(child3).connection; |
| 812 ASSERT_NE(nullptr, embedded3); | 812 ASSERT_NE(nullptr, embedded3); |
| 813 | 813 |
| 814 Window* child11 = NewVisibleWindow(GetFirstRoot(embedded1), embedded1); | 814 Window* child11 = NewVisibleWindow(GetFirstRoot(embedded1), embedded1); |
| 815 Window* child21 = NewVisibleWindow(GetFirstRoot(embedded2), embedded2); | 815 Window* child21 = NewVisibleWindow(GetFirstRoot(embedded2), embedded2); |
| 816 Window* child31 = NewVisibleWindow(GetFirstRoot(embedded3), embedded3); | 816 Window* child31 = NewVisibleWindow(GetFirstRoot(embedded3), embedded3); |
| 817 WaitForTreeSizeToMatch(parent, 7); | 817 WaitForTreeSizeToMatch(parent, 7); |
| 818 | 818 |
| 819 Window* expecteds[] = { child1, child2, child3, child1, nullptr }; | 819 Window* expecteds[] = { child3, child2, child1, child3, nullptr }; |
| 820 Window* focused[] = { child11, child21, child31, child11, nullptr }; | 820 Window* focused[] = { child31, child21, child11, child31, nullptr }; |
| 821 for (size_t index = 0; expecteds[index]; ++index) { | 821 for (size_t index = 0; expecteds[index]; ++index) { |
| 822 host()->ActivateNextWindow(); | 822 host()->ActivateNextWindow(); |
| 823 ASSERT_TRUE(WaitForOrderChange(window_manager(), expecteds[index])) | |
| 824 << " Failure at " << index; | |
| 825 | |
| 826 WaitForWindowToHaveFocus(focused[index]); | 823 WaitForWindowToHaveFocus(focused[index]); |
| 827 EXPECT_TRUE(focused[index]->HasFocus()); | 824 EXPECT_TRUE(focused[index]->HasFocus()); |
| 825 EXPECT_EQ(parent->children().back(), expecteds[index]); |
| 828 } | 826 } |
| 829 } | 827 } |
| 830 | 828 |
| 831 namespace { | 829 namespace { |
| 832 | 830 |
| 833 class DestroyedChangedObserver : public WindowObserver { | 831 class DestroyedChangedObserver : public WindowObserver { |
| 834 public: | 832 public: |
| 835 DestroyedChangedObserver(WindowServerTestBase* test, | 833 DestroyedChangedObserver(WindowServerTestBase* test, |
| 836 Window* window, | 834 Window* window, |
| 837 bool* got_destroy) | 835 bool* got_destroy) |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 embed_window->SetBounds(gfx::Rect(21, 22, 23, 24)); | 1059 embed_window->SetBounds(gfx::Rect(21, 22, 23, 24)); |
| 1062 WaitForBoundsToChange(GetFirstRoot(embedded_connection)); | 1060 WaitForBoundsToChange(GetFirstRoot(embedded_connection)); |
| 1063 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == | 1061 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == |
| 1064 GetFirstRoot(embedded_connection)->bounds()); | 1062 GetFirstRoot(embedded_connection)->bounds()); |
| 1065 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == | 1063 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == |
| 1066 GetFirstRoot(embedded_connection)->client_area()); | 1064 GetFirstRoot(embedded_connection)->client_area()); |
| 1067 } | 1065 } |
| 1068 | 1066 |
| 1069 } // namespace ws | 1067 } // namespace ws |
| 1070 } // namespace mus | 1068 } // namespace mus |
| OLD | NEW |