OLD | NEW |
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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 #if !defined(OS_CHROMEOS) | 1154 #if !defined(OS_CHROMEOS) |
1155 init_params.native_widget = new DesktopNativeWidgetAura(&widget); | 1155 init_params.native_widget = new DesktopNativeWidgetAura(&widget); |
1156 #endif | 1156 #endif |
1157 widget.Init(init_params); | 1157 widget.Init(init_params); |
1158 widget.SetContentsView(contents_view); | 1158 widget.SetContentsView(contents_view); |
1159 widget.Show(); | 1159 widget.Show(); |
1160 widget.Activate(); | 1160 widget.Activate(); |
1161 contents_view->RequestFocus(); | 1161 contents_view->RequestFocus(); |
1162 EXPECT_TRUE(contents_view->HasFocus()); | 1162 EXPECT_TRUE(contents_view->HasFocus()); |
1163 | 1163 |
1164 // Show a bubble. | 1164 // Show a buble. |
1165 BubbleDelegateView* bubble_delegate_view = | 1165 BubbleDelegateView* bubble_delegate_view = |
1166 new BubbleDelegateView(contents_view, BubbleBorder::TOP_LEFT); | 1166 new BubbleDelegateView(contents_view, BubbleBorder::TOP_LEFT); |
1167 bubble_delegate_view->set_focusable(true); | 1167 bubble_delegate_view->set_focusable(true); |
1168 Widget* bubble_widget = | 1168 Widget* bubble_widget = |
1169 BubbleDelegateView::CreateBubble(bubble_delegate_view); | 1169 BubbleDelegateView::CreateBubble(bubble_delegate_view); |
1170 bubble_delegate_view->Show(); | 1170 bubble_delegate_view->Show(); |
1171 bubble_delegate_view->RequestFocus(); | 1171 bubble_delegate_view->RequestFocus(); |
1172 | 1172 |
1173 // |contents_view_| should no longer have focus. | 1173 // |contents_view_| should no longer have focus. |
1174 EXPECT_FALSE(contents_view->HasFocus()); | 1174 EXPECT_FALSE(contents_view->HasFocus()); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_BEGIN)); | 1370 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_BEGIN)); |
1371 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_UPDATE)); | 1371 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_UPDATE)); |
1372 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_END)); | 1372 EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_END)); |
1373 } | 1373 } |
1374 | 1374 |
1375 widget->CloseNow(); | 1375 widget->CloseNow(); |
1376 } | 1376 } |
1377 | 1377 |
1378 } // namespace | 1378 } // namespace |
1379 } // namespace views | 1379 } // namespace views |
OLD | NEW |