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

Side by Side Diff: ash/display/mirror_window_controller_unittest.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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
« no previous file with comments | « ash/display/mirror_window_controller.cc ('k') | ash/display/mouse_cursor_event_filter.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ash/display/mirror_window_controller.h" 5 #include "ash/display/mirror_window_controller.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorBasic) { 74 TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorBasic) {
75 test::MirrorWindowTestApi test_api; 75 test::MirrorWindowTestApi test_api;
76 aura::test::TestWindowDelegate test_window_delegate; 76 aura::test::TestWindowDelegate test_window_delegate;
77 test_window_delegate.set_window_component(HTTOP); 77 test_window_delegate.set_window_component(HTTOP);
78 78
79 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 79 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
80 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING); 80 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING);
81 UpdateDisplay("400x400,400x400"); 81 UpdateDisplay("400x400,400x400");
82 aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow(); 82 aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
83 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate( 83 std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
84 &test_window_delegate, 84 &test_window_delegate, 0, gfx::Rect(50, 50, 100, 100), root));
85 0,
86 gfx::Rect(50, 50, 100, 100),
87 root));
88 window->Show(); 85 window->Show();
89 window->SetName("foo"); 86 window->SetName("foo");
90 87
91 EXPECT_TRUE(test_api.GetCursorWindow()); 88 EXPECT_TRUE(test_api.GetCursorWindow());
92 EXPECT_EQ("50,50 100x100", window->bounds().ToString()); 89 EXPECT_EQ("50,50 100x100", window->bounds().ToString());
93 90
94 ui::test::EventGenerator generator(root); 91 ui::test::EventGenerator generator(root);
95 generator.MoveMouseTo(10, 10); 92 generator.MoveMouseTo(10, 10);
96 93
97 // Test if cursor movement is propertly reflected in mirror window. 94 // Test if cursor movement is propertly reflected in mirror window.
(...skipping 25 matching lines...) Expand all
123 120
124 TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorRotate) { 121 TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorRotate) {
125 test::MirrorWindowTestApi test_api; 122 test::MirrorWindowTestApi test_api;
126 aura::test::TestWindowDelegate test_window_delegate; 123 aura::test::TestWindowDelegate test_window_delegate;
127 test_window_delegate.set_window_component(HTTOP); 124 test_window_delegate.set_window_component(HTTOP);
128 125
129 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 126 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
130 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING); 127 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING);
131 UpdateDisplay("400x400,400x400"); 128 UpdateDisplay("400x400,400x400");
132 aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow(); 129 aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
133 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate( 130 std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
134 &test_window_delegate, 131 &test_window_delegate, 0, gfx::Rect(50, 50, 100, 100), root));
135 0,
136 gfx::Rect(50, 50, 100, 100),
137 root));
138 window->Show(); 132 window->Show();
139 window->SetName("foo"); 133 window->SetName("foo");
140 134
141 EXPECT_TRUE(test_api.GetCursorWindow()); 135 EXPECT_TRUE(test_api.GetCursorWindow());
142 EXPECT_EQ("50,50 100x100", window->bounds().ToString()); 136 EXPECT_EQ("50,50 100x100", window->bounds().ToString());
143 137
144 ui::test::EventGenerator generator(root); 138 ui::test::EventGenerator generator(root);
145 generator.MoveMouseToInHost(100, 100); 139 generator.MoveMouseToInHost(100, 100);
146 140
147 // Test if cursor movement is propertly reflected in mirror window. 141 // Test if cursor movement is propertly reflected in mirror window.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 299
306 TEST_F(MirrorOnBootTest, MAYBE_MirrorOnBoot) { 300 TEST_F(MirrorOnBootTest, MAYBE_MirrorOnBoot) {
307 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 301 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
308 EXPECT_TRUE(display_manager->IsInMirrorMode()); 302 EXPECT_TRUE(display_manager->IsInMirrorMode());
309 RunAllPendingInMessageLoop(); 303 RunAllPendingInMessageLoop();
310 test::MirrorWindowTestApi test_api; 304 test::MirrorWindowTestApi test_api;
311 EXPECT_TRUE(test_api.GetHost()); 305 EXPECT_TRUE(test_api.GetHost());
312 } 306 }
313 307
314 } // namespace ash 308 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/mirror_window_controller.cc ('k') | ash/display/mouse_cursor_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698