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 "ash/desktop_background/desktop_background_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 namespace { | 38 namespace { |
39 | 39 |
40 // Containers IDs used for tests. | 40 // Containers IDs used for tests. |
41 const int kDesktopBackgroundId = | 41 const int kDesktopBackgroundId = |
42 ash::internal::kShellWindowId_DesktopBackgroundContainer; | 42 ash::internal::kShellWindowId_DesktopBackgroundContainer; |
43 const int kLockScreenBackgroundId = | 43 const int kLockScreenBackgroundId = |
44 ash::internal::kShellWindowId_LockScreenBackgroundContainer; | 44 ash::internal::kShellWindowId_LockScreenBackgroundContainer; |
45 | 45 |
46 // Returns number of child windows in a shell window container. | 46 // Returns number of child windows in a shell window container. |
47 int ChildCountForContainer(int container_id) { | 47 int ChildCountForContainer(int container_id) { |
48 RootWindow* root = ash::Shell::GetPrimaryRootWindow(); | 48 Window* root = ash::Shell::GetPrimaryRootWindow(); |
49 Window* container = root->GetChildById(container_id); | 49 Window* container = root->GetChildById(container_id); |
50 return static_cast<int>(container->children().size()); | 50 return static_cast<int>(container->children().size()); |
51 } | 51 } |
52 | 52 |
53 class TestObserver : public DesktopBackgroundControllerObserver { | 53 class TestObserver : public DesktopBackgroundControllerObserver { |
54 public: | 54 public: |
55 explicit TestObserver(DesktopBackgroundController* controller) | 55 explicit TestObserver(DesktopBackgroundController* controller) |
56 : controller_(controller) { | 56 : controller_(controller) { |
57 DCHECK(controller_); | 57 DCHECK(controller_); |
58 controller_->AddObserver(this); | 58 controller_->AddObserver(this); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 DesktopBackgroundController::GetMaxDisplaySizeInNative().ToString()); | 624 DesktopBackgroundController::GetMaxDisplaySizeInNative().ToString()); |
625 | 625 |
626 // Maximum width and height belongs to different displays. | 626 // Maximum width and height belongs to different displays. |
627 UpdateDisplay("400x300,100x500"); | 627 UpdateDisplay("400x300,100x500"); |
628 EXPECT_EQ( | 628 EXPECT_EQ( |
629 "400x500", | 629 "400x500", |
630 DesktopBackgroundController::GetMaxDisplaySizeInNative().ToString()); | 630 DesktopBackgroundController::GetMaxDisplaySizeInNative().ToString()); |
631 } | 631 } |
632 | 632 |
633 } // namespace ash | 633 } // namespace ash |
OLD | NEW |