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

Side by Side Diff: ash/common/system/tray/tray_details_view_unittest.cc

Issue 2371113003: Do not give instant focus if a view's toplevelwidget is not active (Closed)
Patch Set: based on comments Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/common/system/tray/tray_details_view.h" 5 #include "ash/common/system/tray/tray_details_view.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/system/tray/hover_highlight_view.h" 8 #include "ash/common/system/tray/hover_highlight_view.h"
9 #include "ash/common/system/tray/special_popup_row.h" 9 #include "ash/common/system/tray/special_popup_row.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 RunAllPendingInMessageLoop(); 164 RunAllPendingInMessageLoop();
165 165
166 // Show the detailed view of item 2. 166 // Show the detailed view of item 2.
167 tray->ShowDetailedView(test_item_2, 0, true, BUBBLE_USE_EXISTING); 167 tray->ShowDetailedView(test_item_2, 0, true, BUBBLE_USE_EXISTING);
168 EXPECT_TRUE(test_item_2->detailed_view()); 168 EXPECT_TRUE(test_item_2->detailed_view());
169 RunAllPendingInMessageLoop(); 169 RunAllPendingInMessageLoop();
170 EXPECT_FALSE(test_item_2->default_view()); 170 EXPECT_FALSE(test_item_2->default_view());
171 171
172 // Transition back to default view, the default view of item 2 should have 172 // Transition back to default view, the default view of item 2 should have
173 // focus. 173 // focus.
174 tray->GetSystemBubble()->bubble_view()->set_can_activate(true);
174 if (MaterialDesignController::IsSystemTrayMenuMaterial()) 175 if (MaterialDesignController::IsSystemTrayMenuMaterial())
175 FocusBackButton(test_item_2->detailed_view()); 176 FocusBackButton(test_item_2->detailed_view());
176 else 177 else
177 test_item_2->detailed_view()->FocusTitleRow(); 178 test_item_2->detailed_view()->FocusTitleRow();
178 TransitionFromDetailedToDefaultView(test_item_2->detailed_view()); 179 TransitionFromDetailedToDefaultView(test_item_2->detailed_view());
179 RunAllPendingInMessageLoop(); 180 RunAllPendingInMessageLoop();
180 181
181 EXPECT_TRUE(test_item_2->default_view()); 182 EXPECT_TRUE(test_item_2->default_view());
182 EXPECT_FALSE(test_item_2->detailed_view()); 183 EXPECT_FALSE(test_item_2->detailed_view());
183 EXPECT_TRUE(test_item_2->default_view()->HasFocus()); 184 EXPECT_TRUE(test_item_2->default_view()->HasFocus());
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 gfx::Rect bounds = button->GetBoundsInScreen(); 299 gfx::Rect bounds = button->GetBoundsInScreen();
299 gfx::Point initial_point(bounds.x() - 1, bounds.y()); 300 gfx::Point initial_point(bounds.x() - 1, bounds.y());
300 generator.set_current_location(initial_point); 301 generator.set_current_location(initial_point);
301 generator.MoveMouseBy(1, 0); 302 generator.MoveMouseBy(1, 0);
302 RunAllPendingInMessageLoop(); 303 RunAllPendingInMessageLoop();
303 EXPECT_TRUE(button->background()); 304 EXPECT_TRUE(button->background());
304 } 305 }
305 306
306 } // namespace test 307 } // namespace test
307 } // namespace ash 308 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698