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 "athena/wm/window_list_provider_impl.h" | 5 #include "athena/wm/window_list_provider_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "athena/screen/public/screen_manager.h" | 9 #include "athena/screen/public/screen_manager.h" |
10 #include "athena/test/base/athena_test_base.h" | 10 #include "athena/test/base/athena_test_base.h" |
11 #include "athena/test/base/test_windows.h" | 11 #include "athena/test/base/test_windows.h" |
12 #include "athena/wm/public/window_list_provider_observer.h" | 12 #include "athena/wm/public/window_list_provider_observer.h" |
13 #include "athena/wm/public/window_manager.h" | 13 #include "athena/wm/public/window_manager.h" |
| 14 #include "base/strings/string_number_conversions.h" |
14 #include "ui/aura/client/window_tree_client.h" | 15 #include "ui/aura/client/window_tree_client.h" |
15 #include "ui/aura/test/test_window_delegate.h" | 16 #include "ui/aura/test/test_window_delegate.h" |
16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
17 #include "ui/wm/core/window_util.h" | 18 #include "ui/wm/core/window_util.h" |
18 | 19 |
19 namespace athena { | 20 namespace athena { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 bool AreWindowListsEqual(const aura::Window::Windows& one, | 24 bool AreWindowListsEqual(const aura::Window::Windows& one, |
(...skipping 19 matching lines...) Expand all Loading... |
43 std::string GetWindowOrder(const aura::Window::Windows& original, | 44 std::string GetWindowOrder(const aura::Window::Windows& original, |
44 const aura::Window::Windows& now) { | 45 const aura::Window::Windows& now) { |
45 if (original.size() != now.size()) | 46 if (original.size() != now.size()) |
46 return "size has changed."; | 47 return "size has changed."; |
47 std::string output; | 48 std::string output; |
48 for (aura::Window::Windows::const_iterator it = now.begin(); | 49 for (aura::Window::Windows::const_iterator it = now.begin(); |
49 it != now.end(); ++it) { | 50 it != now.end(); ++it) { |
50 for (size_t i = 0; i < original.size(); i++) { | 51 for (size_t i = 0; i < original.size(); i++) { |
51 if ((*it) == original[i]) { | 52 if ((*it) == original[i]) { |
52 output += (output.size() ? " " : std::string()) + | 53 output += (output.size() ? " " : std::string()) + |
53 std::to_string(i + 1); | 54 base::IntToString(i + 1); |
54 break; | 55 break; |
55 } | 56 } |
56 } | 57 } |
57 } | 58 } |
58 return output; | 59 return output; |
59 } | 60 } |
60 | 61 |
61 class WindowListObserver : public WindowListProviderObserver { | 62 class WindowListObserver : public WindowListProviderObserver { |
62 public: | 63 public: |
63 explicit WindowListObserver(WindowListProvider* provider) | 64 explicit WindowListObserver(WindowListProvider* provider) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 EXPECT_FALSE(t1->IsVisible()); | 348 EXPECT_FALSE(t1->IsVisible()); |
348 w1->Show(); | 349 w1->Show(); |
349 EXPECT_TRUE(t1->IsVisible()); | 350 EXPECT_TRUE(t1->IsVisible()); |
350 | 351 |
351 // Resetting transient window won't notify the observer. | 352 // Resetting transient window won't notify the observer. |
352 t1.reset(); | 353 t1.reset(); |
353 EXPECT_EQ(0, observer->window_removal_calls()); | 354 EXPECT_EQ(0, observer->window_removal_calls()); |
354 } | 355 } |
355 | 356 |
356 } // namespace athena | 357 } // namespace athena |
OLD | NEW |