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

Side by Side Diff: ash/wm/workspace/workspace_event_handler_unittest.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 1 month 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
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/wm/workspace/workspace_event_handler.h" 5 #include "ash/wm/workspace/workspace_event_handler.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 "ash/wm/property_util.h" 9 #include "ash/wm/property_util.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 scoped_ptr<aura::Window> window2( 147 scoped_ptr<aura::Window> window2(
148 CreateTestWindow(&wd2, gfx::Rect(0, 0, 500, 500))); 148 CreateTestWindow(&wd2, gfx::Rect(0, 0, 500, 500)));
149 149
150 aura::test::TestWindowDelegate wd; 150 aura::test::TestWindowDelegate wd;
151 const gfx::Rect bounds(10, 20, 30, 40); 151 const gfx::Rect bounds(10, 20, 30, 40);
152 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); 152 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds));
153 wd.set_window_component(HTCAPTION); 153 wd.set_window_component(HTCAPTION);
154 aura::test::EventGenerator generator(window->GetRootWindow()); 154 aura::test::EventGenerator generator(window->GetRootWindow());
155 generator.MoveMouseToCenterOf(window.get()); 155 generator.MoveMouseToCenterOf(window.get());
156 generator.PressLeftButton(); 156 generator.PressLeftButton();
157 generator.MoveMouseTo(generator.current_location().Add(gfx::Point(50, 50))); 157 generator.MoveMouseTo(
158 generator.current_location().Add(gfx::Vector2d(50, 50)));
158 DCHECK_NE(bounds.origin().ToString(), window->bounds().origin().ToString()); 159 DCHECK_NE(bounds.origin().ToString(), window->bounds().origin().ToString());
159 window.reset(); 160 window.reset();
160 generator.MoveMouseTo(generator.current_location().Add(gfx::Point(50, 50))); 161 generator.MoveMouseTo(
162 generator.current_location().Add(gfx::Vector2d(50, 50)));
161 } 163 }
162 164
163 // Verifies deleting the window while in a run loop doesn't crash. 165 // Verifies deleting the window while in a run loop doesn't crash.
164 TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) { 166 TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) {
165 aura::test::TestWindowDelegate wd; 167 aura::test::TestWindowDelegate wd;
166 const gfx::Rect bounds(10, 20, 30, 40); 168 const gfx::Rect bounds(10, 20, 30, 40);
167 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); 169 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds));
168 wd.set_window_component(HTCAPTION); 170 wd.set_window_component(HTCAPTION);
169 171
170 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->parent())); 172 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->parent()));
171 MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); 173 MessageLoop::current()->DeleteSoon(FROM_HERE, window.get());
172 aura::client::GetWindowMoveClient(window->parent())->RunMoveLoop( 174 aura::client::GetWindowMoveClient(window->parent())->RunMoveLoop(
173 window.release(), gfx::Point()); 175 window.release(), gfx::Vector2d());
174 } 176 }
175 177
176 } // namespace internal 178 } // namespace internal
177 } // namespace ash 179 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698