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

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

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 years 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/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 EXPECT_TRUE(window_state->IsMaximized()); 264 EXPECT_TRUE(window_state->IsMaximized());
265 generator.DoubleClickLeftButton(); 265 generator.DoubleClickLeftButton();
266 266
267 EXPECT_FALSE(window_state->IsMaximized()); 267 EXPECT_FALSE(window_state->IsMaximized());
268 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); 268 EXPECT_EQ("1,2 30x40", window->bounds().ToString());
269 269
270 // Double-clicking the middle button shouldn't toggle the maximized state. 270 // Double-clicking the middle button shouldn't toggle the maximized state.
271 WindowPropertyObserver observer(window.get()); 271 WindowPropertyObserver observer(window.get());
272 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), 272 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(),
273 generator.current_location(), 273 generator.current_location(),
274 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK); 274 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK,
275 ui::EF_MIDDLE_MOUSE_BUTTON);
275 aura::WindowEventDispatcher* dispatcher = root->GetDispatcher(); 276 aura::WindowEventDispatcher* dispatcher = root->GetDispatcher();
276 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press); 277 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press);
277 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), 278 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(),
278 generator.current_location(), 279 generator.current_location(),
279 ui::EF_IS_DOUBLE_CLICK); 280 ui::EF_IS_DOUBLE_CLICK,
281 ui::EF_MIDDLE_MOUSE_BUTTON);
280 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release); 282 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release);
281 283
282 EXPECT_FALSE(window_state->IsMaximized()); 284 EXPECT_FALSE(window_state->IsMaximized());
283 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); 285 EXPECT_EQ("1,2 30x40", window->bounds().ToString());
284 EXPECT_FALSE(observer.DidPropertyChange(aura::client::kShowStateKey)); 286 EXPECT_FALSE(observer.DidPropertyChange(aura::client::kShowStateKey));
285 } 287 }
286 288
287 TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) { 289 TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) {
288 aura::test::TestWindowDelegate wd; 290 aura::test::TestWindowDelegate wd;
289 gfx::Rect bounds(10, 20, 30, 40); 291 gfx::Rect bounds(10, 20, 30, 40);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->parent())); 341 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->parent()));
340 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); 342 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get());
341 aura::client::GetWindowMoveClient(window->parent()) 343 aura::client::GetWindowMoveClient(window->parent())
342 ->RunMoveLoop(window.release(), 344 ->RunMoveLoop(window.release(),
343 gfx::Vector2d(), 345 gfx::Vector2d(),
344 aura::client::WINDOW_MOVE_SOURCE_MOUSE); 346 aura::client::WINDOW_MOVE_SOURCE_MOUSE);
345 } 347 }
346 348
347 } // namespace internal 349 } // namespace internal
348 } // namespace ash 350 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | chrome/browser/ui/views/location_bar/star_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698