| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel)); | 1190 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel)); |
| 1191 | 1191 |
| 1192 // Clean up. | 1192 // Clean up. |
| 1193 toplevel->Close(); | 1193 toplevel->Close(); |
| 1194 RunPendingMessages(); | 1194 RunPendingMessages(); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 // Testing initial focus is assigned properly for normal top-level widgets, | 1197 // Testing initial focus is assigned properly for normal top-level widgets, |
| 1198 // and subclasses that specify a initially focused child view. | 1198 // and subclasses that specify a initially focused child view. |
| 1199 TEST_F(WidgetTestInteractive, InitialFocus) { | 1199 TEST_F(WidgetTestInteractive, InitialFocus) { |
| 1200 // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| 1201 // http://crbug.com/663809. |
| 1202 if (IsAuraMusClient()) |
| 1203 return; |
| 1204 |
| 1200 // By default, there is no initially focused view (even if there is a | 1205 // By default, there is no initially focused view (even if there is a |
| 1201 // focusable subview). | 1206 // focusable subview). |
| 1202 Widget* toplevel(CreateTopLevelPlatformWidget()); | 1207 Widget* toplevel(CreateTopLevelPlatformWidget()); |
| 1203 View* view = new View; | 1208 View* view = new View; |
| 1204 view->SetFocusBehavior(View::FocusBehavior::ALWAYS); | 1209 view->SetFocusBehavior(View::FocusBehavior::ALWAYS); |
| 1205 toplevel->GetContentsView()->AddChildView(view); | 1210 toplevel->GetContentsView()->AddChildView(view); |
| 1206 | 1211 |
| 1207 ShowSync(toplevel); | 1212 ShowSync(toplevel); |
| 1208 toplevel->Show(); | 1213 toplevel->Show(); |
| 1209 EXPECT_FALSE(view->HasFocus()); | 1214 EXPECT_FALSE(view->HasFocus()); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 | 1406 |
| 1402 TestCapture(true); | 1407 TestCapture(true); |
| 1403 } | 1408 } |
| 1404 #endif | 1409 #endif |
| 1405 | 1410 |
| 1406 // Test that no state is set if capture fails. | 1411 // Test that no state is set if capture fails. |
| 1407 TEST_F(WidgetCaptureTest, FailedCaptureRequestIsNoop) { | 1412 TEST_F(WidgetCaptureTest, FailedCaptureRequestIsNoop) { |
| 1408 // Fails on mus. http://crbug.com/611764 | 1413 // Fails on mus. http://crbug.com/611764 |
| 1409 if (IsMus()) | 1414 if (IsMus()) |
| 1410 return; | 1415 return; |
| 1416 // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| 1417 // http://crbug.com/663809. |
| 1418 if (IsAuraMusClient()) |
| 1419 return; |
| 1411 | 1420 |
| 1412 Widget widget; | 1421 Widget widget; |
| 1413 Widget::InitParams params = | 1422 Widget::InitParams params = |
| 1414 CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 1423 CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 1415 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 1424 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 1416 params.bounds = gfx::Rect(400, 400); | 1425 params.bounds = gfx::Rect(400, 400); |
| 1417 widget.Init(params); | 1426 widget.Init(params); |
| 1418 | 1427 |
| 1419 MouseView* mouse_view1 = new MouseView; | 1428 MouseView* mouse_view1 = new MouseView; |
| 1420 MouseView* mouse_view2 = new MouseView; | 1429 MouseView* mouse_view2 = new MouseView; |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1813 | 1822 |
| 1814 ui::KeyEvent key_event2(key_event); | 1823 ui::KeyEvent key_event2(key_event); |
| 1815 widget->OnKeyEvent(&key_event2); | 1824 widget->OnKeyEvent(&key_event2); |
| 1816 EXPECT_FALSE(key_event2.stopped_propagation()); | 1825 EXPECT_FALSE(key_event2.stopped_propagation()); |
| 1817 | 1826 |
| 1818 widget->CloseNow(); | 1827 widget->CloseNow(); |
| 1819 } | 1828 } |
| 1820 | 1829 |
| 1821 } // namespace test | 1830 } // namespace test |
| 1822 } // namespace views | 1831 } // namespace views |
| OLD | NEW |