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 "ui/views/accessible_pane_view.h" | 5 #include "ui/views/accessible_pane_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ui/base/accelerators/accelerator.h" | 9 #include "ui/base/accelerators/accelerator.h" |
10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 widget_bar->Activate(); | 130 widget_bar->Activate(); |
131 | 131 |
132 // Set pane focus succeeds, focus on child. | 132 // Set pane focus succeeds, focus on child. |
133 EXPECT_TRUE(test_view_bar->SetPaneFocusAndFocusDefault()); | 133 EXPECT_TRUE(test_view_bar->SetPaneFocusAndFocusDefault()); |
134 EXPECT_FALSE(test_view_main->HasFocus()); | 134 EXPECT_FALSE(test_view_main->HasFocus()); |
135 EXPECT_FALSE(widget_main->IsActive()); | 135 EXPECT_FALSE(widget_main->IsActive()); |
136 EXPECT_EQ(test_view_bar, test_view_bar->GetPaneFocusTraversable()); | 136 EXPECT_EQ(test_view_bar, test_view_bar->GetPaneFocusTraversable()); |
137 EXPECT_EQ(test_view_bar->child_button(), | 137 EXPECT_EQ(test_view_bar->child_button(), |
138 test_view_bar->GetWidget()->GetFocusManager()->GetFocusedView()); | 138 test_view_bar->GetWidget()->GetFocusManager()->GetFocusedView()); |
139 | 139 |
140 if (!IsMus() && !IsAuraMusClient()) { | 140 if (!IsMus()) { |
141 // Deactivate() is only reliable on Ash. On Windows it uses | 141 // Deactivate() is only reliable on Ash. On Windows it uses |
142 // ::GetNextWindow() to simply activate another window, and which one is not | 142 // ::GetNextWindow() to simply activate another window, and which one is not |
143 // predictable. On Mac, Deactivate() is not implemented. Note that | 143 // predictable. On Mac, Deactivate() is not implemented. Note that |
144 // TestBarView calls set_allow_deactivate_on_esc(true), which is only | 144 // TestBarView calls set_allow_deactivate_on_esc(true), which is only |
145 // otherwise used in Ash. | 145 // otherwise used in Ash. |
146 #if !defined(OS_MACOSX) || defined(USE_ASH) | 146 #if !defined(OS_MACOSX) || defined(USE_ASH) |
147 // Esc should deactivate the widget. | 147 // Esc should deactivate the widget. |
148 test_view_bar->AcceleratorPressed(test_view_bar->escape_key()); | 148 test_view_bar->AcceleratorPressed(test_view_bar->escape_key()); |
149 EXPECT_TRUE(widget_main->IsActive()); | 149 EXPECT_TRUE(widget_main->IsActive()); |
150 EXPECT_FALSE(widget_bar->IsActive()); | 150 EXPECT_FALSE(widget_bar->IsActive()); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 228 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
229 | 229 |
230 // ESC | 230 // ESC |
231 test_view->AcceleratorPressed(test_view->escape_key()); | 231 test_view->AcceleratorPressed(test_view->escape_key()); |
232 EXPECT_EQ(original_test_view->third_child_button(), | 232 EXPECT_EQ(original_test_view->third_child_button(), |
233 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 233 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
234 widget->CloseNow(); | 234 widget->CloseNow(); |
235 widget.reset(); | 235 widget.reset(); |
236 } | 236 } |
237 } // namespace views | 237 } // namespace views |
OLD | NEW |