Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: ash/monitor/multi_monitor_manager_unittest.cc

Issue 10442017: Rename GetRootWindow() -> GetPrimaryRootWindow() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git-try -b linux_chromeos,win_aura Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/monitor/monitor_controller.cc ('k') | ash/screensaver/screensaver_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/monitor/multi_monitor_manager.h" 5 #include "ash/monitor/multi_monitor_manager.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 public: 44 public:
45 MultiMonitorManagerTest() 45 MultiMonitorManagerTest()
46 : removed_count_(0U), 46 : removed_count_(0U),
47 root_window_destroyed_(false) { 47 root_window_destroyed_(false) {
48 } 48 }
49 virtual ~MultiMonitorManagerTest() {} 49 virtual ~MultiMonitorManagerTest() {}
50 50
51 virtual void SetUp() OVERRIDE { 51 virtual void SetUp() OVERRIDE {
52 AshTestBase::SetUp(); 52 AshTestBase::SetUp();
53 monitor_manager()->AddObserver(this); 53 monitor_manager()->AddObserver(this);
54 Shell::GetRootWindow()->AddObserver(this); 54 Shell::GetPrimaryRootWindow()->AddObserver(this);
55 } 55 }
56 virtual void TearDown() OVERRIDE { 56 virtual void TearDown() OVERRIDE {
57 Shell::GetRootWindow()->RemoveObserver(this); 57 Shell::GetPrimaryRootWindow()->RemoveObserver(this);
58 monitor_manager()->RemoveObserver(this); 58 monitor_manager()->RemoveObserver(this);
59 AshTestBase::TearDown(); 59 AshTestBase::TearDown();
60 } 60 }
61 61
62 aura::MonitorManager* monitor_manager() { 62 aura::MonitorManager* monitor_manager() {
63 return aura::Env::GetInstance()->monitor_manager(); 63 return aura::Env::GetInstance()->monitor_manager();
64 } 64 }
65 const vector<Monitor>& changed() const { return changed_; } 65 const vector<Monitor>& changed() const { return changed_; }
66 const vector<Monitor>& added() const { return added_; } 66 const vector<Monitor>& added() const { return added_; }
67 67
(...skipping 19 matching lines...) Expand all
87 } 87 }
88 virtual void OnMonitorAdded(const Monitor& new_monitor) OVERRIDE { 88 virtual void OnMonitorAdded(const Monitor& new_monitor) OVERRIDE {
89 added_.push_back(new_monitor); 89 added_.push_back(new_monitor);
90 } 90 }
91 virtual void OnMonitorRemoved(const Monitor& old_monitor) OVERRIDE { 91 virtual void OnMonitorRemoved(const Monitor& old_monitor) OVERRIDE {
92 ++removed_count_; 92 ++removed_count_;
93 } 93 }
94 94
95 // aura::WindowObserver overrides: 95 // aura::WindowObserver overrides:
96 virtual void OnWindowDestroying(aura::Window* window) { 96 virtual void OnWindowDestroying(aura::Window* window) {
97 ASSERT_EQ(Shell::GetRootWindow(), window); 97 ASSERT_EQ(Shell::GetPrimaryRootWindow(), window);
98 root_window_destroyed_ = true; 98 root_window_destroyed_ = true;
99 } 99 }
100 100
101 void UpdateMonitor(const std::string str) { 101 void UpdateMonitor(const std::string str) {
102 vector<Monitor> monitors = CreateMonitorsFromString(str); 102 vector<Monitor> monitors = CreateMonitorsFromString(str);
103 monitor_manager()->OnNativeMonitorsChanged(monitors); 103 monitor_manager()->OnNativeMonitorsChanged(monitors);
104 } 104 }
105 105
106 private: 106 private:
107 vector<Monitor> changed_; 107 vector<Monitor> changed_;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 reset(); 227 reset();
228 228
229 internal::MultiMonitorManager::CycleMonitor(); 229 internal::MultiMonitorManager::CycleMonitor();
230 EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); 230 EXPECT_EQ(1U, monitor_manager()->GetNumMonitors());
231 EXPECT_EQ("0 0 0", GetCountSummary()); 231 EXPECT_EQ("0 0 0", GetCountSummary());
232 reset(); 232 reset();
233 } 233 }
234 234
235 } // namespace test 235 } // namespace test
236 } // namespace ash 236 } // namespace ash
OLDNEW
« no previous file with comments | « ash/monitor/monitor_controller.cc ('k') | ash/screensaver/screensaver_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698