OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/controls/menu/menu_runner.h" | 5 #include "ui/views/controls/menu/menu_runner.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 MenuRunner* runner_; | 210 MenuRunner* runner_; |
211 Widget* owner_; | 211 Widget* owner_; |
212 | 212 |
213 DISALLOW_COPY_AND_ASSIGN(MenuLauncherEventHandler); | 213 DISALLOW_COPY_AND_ASSIGN(MenuLauncherEventHandler); |
214 }; | 214 }; |
215 | 215 |
216 } // namespace | 216 } // namespace |
217 | 217 |
218 // Tests that when a mouse press launches a menu, that the target widget does | 218 // Tests that when a mouse press launches a menu, that the target widget does |
219 // not take explicit capture, nor closes the menu. | 219 // not take explicit capture, nor closes the menu. |
220 // Disabled on Mac (GetGlobalCapture() not yet implemented). | 220 TEST_F(MenuRunnerTest, WidgetDoesntTakeCapture) { |
221 // http://crbug.com//622979. | |
222 #if defined(OS_MACOSX) | |
223 #define MAYBE_WidgetDoesntTakeCapture DISABLED_WidgetDoesntTakeCapture | |
224 #else | |
225 #define MAYBE_WidgetDoesntTakeCapture WidgetDoesntTakeCapture | |
226 #endif | |
227 TEST_F(MenuRunnerTest, MAYBE_WidgetDoesntTakeCapture) { | |
228 Widget* widget = new Widget; | 221 Widget* widget = new Widget; |
229 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW); | 222 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW); |
230 widget->Init(params); | 223 widget->Init(params); |
231 widget->Show(); | 224 widget->Show(); |
232 widget->SetSize(gfx::Size(300, 300)); | 225 widget->SetSize(gfx::Size(300, 300)); |
233 | 226 |
234 EventCountView* event_count_view = new EventCountView(); | 227 EventCountView* event_count_view = new EventCountView(); |
235 event_count_view->SetBounds(0, 0, 300, 300); | 228 event_count_view->SetBounds(0, 0, 300, 300); |
236 widget->GetRootView()->AddChildView(event_count_view); | 229 widget->GetRootView()->AddChildView(event_count_view); |
237 | 230 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 menu_runner->OnMenuClosed(internal::MenuControllerDelegate::NOTIFY_DELEGATE, | 285 menu_runner->OnMenuClosed(internal::MenuControllerDelegate::NOTIFY_DELEGATE, |
293 nullptr, 0); | 286 nullptr, 0); |
294 | 287 |
295 // This should not access the destroyed MenuController | 288 // This should not access the destroyed MenuController |
296 menu_runner2->Release(); | 289 menu_runner2->Release(); |
297 menu_runner->Release(); | 290 menu_runner->Release(); |
298 } | 291 } |
299 | 292 |
300 } // namespace test | 293 } // namespace test |
301 } // namespace views | 294 } // namespace views |
OLD | NEW |