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

Side by Side Diff: ui/views/bubble/bubble_delegate_unittest.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "ui/base/hit_test.h" 8 #include "ui/base/hit_test.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/views/bubble/bubble_delegate.h" 10 #include "ui/views/bubble/bubble_delegate.h"
11 #include "ui/views/bubble/bubble_frame_view.h" 11 #include "ui/views/bubble/bubble_frame_view.h"
12 #include "ui/views/controls/button/label_button.h" 12 #include "ui/views/controls/button/label_button.h"
13 #include "ui/views/test/test_widget_observer.h" 13 #include "ui/views/test/test_widget_observer.h"
14 #include "ui/views/test/views_test_base.h" 14 #include "ui/views/test/views_test_base.h"
15 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
16 #include "ui/views/widget/widget_observer.h" 16 #include "ui/views/widget/widget_observer.h"
17 17
18 namespace views { 18 namespace views {
19 19
20 namespace { 20 namespace {
21 21
22 class TestBubbleDelegateView : public BubbleDelegateView { 22 class TestBubbleDelegateView : public BubbleDelegateView {
23 public: 23 public:
24 TestBubbleDelegateView(View* anchor_view) 24 TestBubbleDelegateView(View* anchor_view)
25 : BubbleDelegateView(anchor_view, BubbleBorder::TOP_LEFT), 25 : BubbleDelegateView(anchor_view, BubbleBorder::TOP_LEFT),
26 view_(new View()) { 26 view_(new View()) {
27 view_->SetFocusable(true); 27 view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
28 AddChildView(view_); 28 AddChildView(view_);
29 } 29 }
30 ~TestBubbleDelegateView() override {} 30 ~TestBubbleDelegateView() override {}
31 31
32 void SetAnchorRectForTest(gfx::Rect rect) { 32 void SetAnchorRectForTest(gfx::Rect rect) {
33 SetAnchorRect(rect); 33 SetAnchorRect(rect);
34 } 34 }
35 35
36 void SetAnchorViewForTest(View* view) { 36 void SetAnchorViewForTest(View* view) {
37 SetAnchorView(view); 37 SetAnchorView(view);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 close_button, 314 close_button,
315 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), 315 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0),
316 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); 316 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE));
317 EXPECT_TRUE(bubble_widget->IsClosed()); 317 EXPECT_TRUE(bubble_widget->IsClosed());
318 EXPECT_EQ(BubbleDelegateView::CloseReason::CLOSE_BUTTON, 318 EXPECT_EQ(BubbleDelegateView::CloseReason::CLOSE_BUTTON,
319 bubble_delegate->close_reason()); 319 bubble_delegate->close_reason());
320 } 320 }
321 } 321 }
322 322
323 } // namespace views 323 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698