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

Side by Side Diff: ui/views/corewm/desktop_capture_controller_unittest.cc

Issue 128753002: Remove SetHostSize/Bounds from RootWindow in favor of just calling SetBounds() on host() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: weirdness Created 6 years, 11 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
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 "ui/views/corewm/capture_controller.h" 5 #include "ui/views/corewm/capture_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/aura/test/event_generator.h" 10 #include "ui/aura/test/event_generator.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 generator1.MoveMouseToCenterOf(w1->GetNativeView()); 72 generator1.MoveMouseToCenterOf(w1->GetNativeView());
73 generator1.PressLeftButton(); 73 generator1.PressLeftButton();
74 EXPECT_FALSE(w1->HasCapture()); 74 EXPECT_FALSE(w1->HasCapture());
75 aura::RootWindow* w1_root = w1->GetNativeView()->GetDispatcher(); 75 aura::RootWindow* w1_root = w1->GetNativeView()->GetDispatcher();
76 EXPECT_TRUE(w1_root->mouse_pressed_handler() != NULL); 76 EXPECT_TRUE(w1_root->mouse_pressed_handler() != NULL);
77 EXPECT_TRUE(w1_root->mouse_moved_handler() != NULL); 77 EXPECT_TRUE(w1_root->mouse_moved_handler() != NULL);
78 w2->SetCapture(w2->GetRootView()); 78 w2->SetCapture(w2->GetRootView());
79 EXPECT_TRUE(w2->HasCapture()); 79 EXPECT_TRUE(w2->HasCapture());
80 EXPECT_TRUE(w1_root->mouse_pressed_handler() == NULL); 80 EXPECT_TRUE(w1_root->mouse_pressed_handler() == NULL);
81 EXPECT_TRUE(w1_root->mouse_moved_handler() == NULL); 81 EXPECT_TRUE(w1_root->mouse_moved_handler() == NULL);
82 w2->ReleaseCapture();
82 } 83 }
83 84
84 // Tests aura::Window capture and whether gesture events are sent to the window 85 // Tests aura::Window capture and whether gesture events are sent to the window
85 // which has capture. 86 // which has capture.
86 // The test case creates two visible widgets and sets capture to the underlying 87 // The test case creates two visible widgets and sets capture to the underlying
87 // aura::Windows one by one. It then sends a gesture event and validates whether 88 // aura::Windows one by one. It then sends a gesture event and validates whether
88 // the window which had capture receives the gesture. 89 // the window which had capture receives the gesture.
89 // TODO(sky): move this test, it should be part of ScopedCaptureClient tests. 90 // TODO(sky): move this test, it should be part of ScopedCaptureClient tests.
90 TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { 91 TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) {
91 scoped_ptr<aura::client::ScreenPositionClient> desktop_position_client1; 92 scoped_ptr<aura::client::ScreenPositionClient> desktop_position_client1;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 root2->DispatchGestureEvent(&g1); 162 root2->DispatchGestureEvent(&g1);
162 EXPECT_TRUE(v2->received_gesture_event()); 163 EXPECT_TRUE(v2->received_gesture_event());
163 EXPECT_FALSE(v1->received_gesture_event()); 164 EXPECT_FALSE(v1->received_gesture_event());
164 165
165 widget1->CloseNow(); 166 widget1->CloseNow();
166 widget2->CloseNow(); 167 widget2->CloseNow();
167 RunPendingMessages(); 168 RunPendingMessages();
168 } 169 }
169 170
170 } // namespace views 171 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/capture_controller_unittest.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_position_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698