| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "ui/aura/test/aura_test_base.h" | 7 #include "ui/aura/test/aura_test_base.h" |
| 8 #include "ui/aura/test/test_windows.h" | 8 #include "ui/aura/test/test_windows.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Returns a string containing the name of each of the child windows (bottommost | 38 // Returns a string containing the name of each of the child windows (bottommost |
| 39 // first) of |parent|. The format of the string is "name1 name2 name3 ...". | 39 // first) of |parent|. The format of the string is "name1 name2 name3 ...". |
| 40 std::string ChildWindowNamesAsString(const aura::Window& parent) { | 40 std::string ChildWindowNamesAsString(const aura::Window& parent) { |
| 41 std::string names; | 41 std::string names; |
| 42 typedef std::vector<aura::Window*> Windows; | 42 typedef std::vector<aura::Window*> Windows; |
| 43 for (Windows::const_iterator it = parent.children().begin(); | 43 for (Windows::const_iterator it = parent.children().begin(); |
| 44 it != parent.children().end(); ++it) { | 44 it != parent.children().end(); ++it) { |
| 45 if (!names.empty()) | 45 if (!names.empty()) |
| 46 names += " "; | 46 names += " "; |
| 47 names += (*it)->name(); | 47 names += (*it)->GetName(); |
| 48 } | 48 } |
| 49 return names; | 49 return names; |
| 50 } | 50 } |
| 51 | 51 |
| 52 typedef aura::test::AuraTestBase WindowReordererTest; | 52 typedef aura::test::AuraTestBase WindowReordererTest; |
| 53 | 53 |
| 54 // Test that views with layers and views with associated windows are reordered | 54 // Test that views with layers and views with associated windows are reordered |
| 55 // according to the view hierarchy. | 55 // according to the view hierarchy. |
| 56 TEST_F(WindowReordererTest, Basic) { | 56 TEST_F(WindowReordererTest, Basic) { |
| 57 std::unique_ptr<Widget> parent( | 57 std::unique_ptr<Widget> parent( |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 EXPECT_EQ("v1 v2 w", | 256 EXPECT_EQ("v1 v2 w", |
| 257 ui::test::ChildLayerNamesAsString(*parent_window->layer())); | 257 ui::test::ChildLayerNamesAsString(*parent_window->layer())); |
| 258 | 258 |
| 259 // Work around for bug in NativeWidgetAura. | 259 // Work around for bug in NativeWidgetAura. |
| 260 // TODO: fix bug and remove this. | 260 // TODO: fix bug and remove this. |
| 261 parent->Close(); | 261 parent->Close(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace | 264 } // namespace |
| 265 } // namespace views | 265 } // namespace views |
| OLD | NEW |