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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 403493006: Visual improvements to text filtering in Ash overview mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: modified test Created 6 years, 4 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 | Annotate | Revision Log
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/drag_drop/drag_drop_controller.h" 8 #include "ash/drag_drop/drag_drop_controller.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 ScopedVector<aura::Window> windows; 890 ScopedVector<aura::Window> windows;
891 for (size_t i = test_windows; i > 0; i--) 891 for (size_t i = test_windows; i > 0; i--)
892 windows.push_back(CreateWindowWithId(gfx::Rect(0, 0, 100, 100), i)); 892 windows.push_back(CreateWindowWithId(gfx::Rect(0, 0, 100, 100), i));
893 893
894 ui::KeyboardCode arrow_keys[] = { 894 ui::KeyboardCode arrow_keys[] = {
895 ui::VKEY_RIGHT, 895 ui::VKEY_RIGHT,
896 ui::VKEY_DOWN, 896 ui::VKEY_DOWN,
897 ui::VKEY_LEFT, 897 ui::VKEY_LEFT,
898 ui::VKEY_UP 898 ui::VKEY_UP
899 }; 899 };
900 // Expected window layout: 900 // Expected window layout, assuming that the text filtering feature is
901 // enabled by default (i.e., --ash-disable-text-filtering-in-overview-mode
902 // is not being used).
flackr 2014/08/08 17:43:59 Could you extend this to still have 3 rows (with 1
tdanderson 2014/08/08 19:25:44 Done.
903 // +-------+ +-------+ +-------+ +-------+
904 // | 1 | | 2 | | 3 | | 4 |
905 // +-------+ +-------+ +-------+ +-------+
901 // +-------+ +-------+ +-------+ 906 // +-------+ +-------+ +-------+
902 // | 1 | | 2 | | 3 | 907 // | 5 | | 6 | | 7 |
903 // +-------+ +-------+ +-------+ 908 // +-------+ +-------+ +-------+
904 // +-------+ +-------+ +-------+
905 // | 4 | | 5 | | 6 |
906 // +-------+ +-------+ +-------+
907 // +-------+
908 // | 7 |
909 // +-------+
910 // Index for each window during a full loop plus wrapping around. 909 // Index for each window during a full loop plus wrapping around.
911 int index_path_for_direction[][test_windows + 1] = { 910 int index_path_for_direction[][test_windows + 1] = {
912 {1, 2, 3, 4, 5, 6, 7, 1}, // Right 911 {1, 2, 3, 4, 5, 6, 7, 1}, // Right
913 {1, 4, 7, 2, 5, 3, 6, 1}, // Down 912 {1, 5, 2, 6, 3, 7, 4, 1}, // Down
914 {7, 6, 5, 4, 3, 2, 1, 7}, // Left 913 {7, 6, 5, 4, 3, 2, 1, 7}, // Left
915 {6, 3, 5, 2, 7, 4, 1, 6} // Up 914 {4, 7, 3, 6, 2, 5, 1, 4} // Up
916 }; 915 };
917 916
918 for (size_t key_index = 0; key_index < arraysize(arrow_keys); key_index++) { 917 for (size_t key_index = 0; key_index < arraysize(arrow_keys); key_index++) {
919 ToggleOverview(); 918 ToggleOverview();
920 for (size_t i = 0; i < test_windows + 1; i++) { 919 for (size_t i = 0; i < test_windows + 1; i++) {
921 SendKey(arrow_keys[key_index]); 920 SendKey(arrow_keys[key_index]);
922 // TODO(flackr): Add a more readable error message by constructing a 921 // TODO(flackr): Add a more readable error message by constructing a
923 // string from the window IDs. 922 // string from the window IDs.
924 EXPECT_EQ(GetSelectedWindow()->id(), 923 EXPECT_EQ(GetSelectedWindow()->id(),
925 index_path_for_direction[key_index][i]); 924 index_path_for_direction[key_index][i]);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 // Dimming all the items should hide the selection widget. 1129 // Dimming all the items should hide the selection widget.
1131 FilterItems("Pop"); 1130 FilterItems("Pop");
1132 EXPECT_FALSE(selection_widget_active()); 1131 EXPECT_FALSE(selection_widget_active());
1133 1132
1134 // Undimming one window should automatically select it. 1133 // Undimming one window should automatically select it.
1135 FilterItems("Rock and roll"); 1134 FilterItems("Rock and roll");
1136 EXPECT_EQ(GetSelectedWindow(), window2.get()); 1135 EXPECT_EQ(GetSelectedWindow(), window2.get());
1137 } 1136 }
1138 1137
1139 } // namespace ash 1138 } // namespace ash
OLDNEW
« ash/wm/overview/window_selector.cc ('K') | « ash/wm/overview/window_selector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698