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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 WindowTreeConnection* embedded2 = Embed(child2).connection; | 804 WindowTreeConnection* embedded2 = Embed(child2).connection; |
805 ASSERT_NE(nullptr, embedded2); | 805 ASSERT_NE(nullptr, embedded2); |
806 WindowTreeConnection* embedded3 = Embed(child3).connection; | 806 WindowTreeConnection* embedded3 = Embed(child3).connection; |
807 ASSERT_NE(nullptr, embedded3); | 807 ASSERT_NE(nullptr, embedded3); |
808 | 808 |
809 Window* child11 = NewVisibleWindow(embedded1->GetRoot(), embedded1); | 809 Window* child11 = NewVisibleWindow(embedded1->GetRoot(), embedded1); |
810 Window* child21 = NewVisibleWindow(embedded2->GetRoot(), embedded2); | 810 Window* child21 = NewVisibleWindow(embedded2->GetRoot(), embedded2); |
811 Window* child31 = NewVisibleWindow(embedded3->GetRoot(), embedded3); | 811 Window* child31 = NewVisibleWindow(embedded3->GetRoot(), embedded3); |
812 WaitForTreeSizeToMatch(parent, 7); | 812 WaitForTreeSizeToMatch(parent, 7); |
813 | 813 |
814 Window* expecteds[] = { child1, child2, child3, child1, nullptr }; | 814 Window* expecteds[] = { child3, child2, child1, child3, nullptr }; |
815 Window* focused[] = { child11, child21, child31, child11, nullptr }; | 815 Window* focused[] = { child31, child21, child11, child31, nullptr }; |
816 for (size_t index = 0; expecteds[index]; ++index) { | 816 for (size_t index = 0; expecteds[index]; ++index) { |
817 host()->ActivateNextWindow(); | 817 host()->ActivateNextWindow(); |
818 ASSERT_TRUE(WaitForOrderChange(window_manager(), expecteds[index])) | |
819 << " Failure at " << index; | |
820 | |
821 WaitForWindowToHaveFocus(focused[index]); | 818 WaitForWindowToHaveFocus(focused[index]); |
822 EXPECT_TRUE(focused[index]->HasFocus()); | 819 EXPECT_TRUE(focused[index]->HasFocus()); |
| 820 EXPECT_EQ(parent->children().back(), expecteds[index]); |
823 } | 821 } |
824 } | 822 } |
825 | 823 |
826 namespace { | 824 namespace { |
827 | 825 |
828 class DestroyedChangedObserver : public WindowObserver { | 826 class DestroyedChangedObserver : public WindowObserver { |
829 public: | 827 public: |
830 DestroyedChangedObserver(WindowServerTestBase* test, | 828 DestroyedChangedObserver(WindowServerTestBase* test, |
831 Window* window, | 829 Window* window, |
832 bool* got_destroy) | 830 bool* got_destroy) |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 WaitForBoundsToChange(embedded_connection->GetRoot()); | 1054 WaitForBoundsToChange(embedded_connection->GetRoot()); |
1057 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == | 1055 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == |
1058 embedded_connection->GetRoot()->bounds()); | 1056 embedded_connection->GetRoot()->bounds()); |
1059 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == | 1057 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == |
1060 embedded_connection->GetRoot()->client_area()); | 1058 embedded_connection->GetRoot()->client_area()); |
1061 } | 1059 } |
1062 | 1060 |
1063 } // namespace ws | 1061 } // namespace ws |
1064 | 1062 |
1065 } // namespace mus | 1063 } // namespace mus |
OLD | NEW |