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

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

Issue 2525753002: Restore original opacity when exiting overview (Closed)
Patch Set: Created 4 years 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 | « ash/common/wm/overview/scoped_transform_overview_window.cc ('k') | no next file » | 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/aura/wm_window_aura.h" 8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/accessibility_delegate.h" 9 #include "ash/common/accessibility_delegate.h"
10 #include "ash/common/accessibility_types.h" 10 #include "ash/common/accessibility_types.h"
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 EXPECT_TRUE(GetWindowItemForWindow(grid_index, window1.get())->dimmed()); 1884 EXPECT_TRUE(GetWindowItemForWindow(grid_index, window1.get())->dimmed());
1885 EXPECT_TRUE(GetWindowItemForWindow(grid_index, window2.get())->dimmed()); 1885 EXPECT_TRUE(GetWindowItemForWindow(grid_index, window2.get())->dimmed());
1886 1886
1887 // All the items should match the empty string. The filter widget should also 1887 // All the items should match the empty string. The filter widget should also
1888 // disappear. 1888 // disappear.
1889 FilterItems(""); 1889 FilterItems("");
1890 EXPECT_FALSE(showing_filter_widget()); 1890 EXPECT_FALSE(showing_filter_widget());
1891 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window0.get())->dimmed()); 1891 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window0.get())->dimmed());
1892 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window1.get())->dimmed()); 1892 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window1.get())->dimmed());
1893 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window2.get())->dimmed()); 1893 EXPECT_FALSE(GetWindowItemForWindow(grid_index, window2.get())->dimmed());
1894
1895 FilterItems("Foo");
1896
1897 EXPECT_NE(1.0f, window0->layer()->GetTargetOpacity());
1898 EXPECT_NE(1.0f, window1->layer()->GetTargetOpacity());
1899 EXPECT_NE(1.0f, window2->layer()->GetTargetOpacity());
1900
1901 ToggleOverview();
1902
1903 EXPECT_EQ(1.0f, window0->layer()->GetTargetOpacity());
1904 EXPECT_EQ(1.0f, window1->layer()->GetTargetOpacity());
1905 EXPECT_EQ(1.0f, window2->layer()->GetTargetOpacity());
1894 } 1906 }
1895 1907
1896 // Tests selecting in the overview with dimmed and undimmed items. 1908 // Tests selecting in the overview with dimmed and undimmed items.
1897 TEST_F(WindowSelectorTest, TextFilteringSelection) { 1909 TEST_F(WindowSelectorTest, TextFilteringSelection) {
1898 gfx::Rect bounds(0, 0, 100, 100); 1910 gfx::Rect bounds(0, 0, 100, 100);
1899 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); 1911 std::unique_ptr<aura::Window> window2(CreateWindow(bounds));
1900 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 1912 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
1901 std::unique_ptr<aura::Window> window0(CreateWindow(bounds)); 1913 std::unique_ptr<aura::Window> window0(CreateWindow(bounds));
1902 base::string16 window2_title = base::UTF8ToUTF16("Rock and roll"); 1914 base::string16 window2_title = base::UTF8ToUTF16("Rock and roll");
1903 base::string16 window1_title = base::UTF8ToUTF16("Rock and"); 1915 base::string16 window1_title = base::UTF8ToUTF16("Rock and");
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 2137 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE));
2126 ASSERT_TRUE(resizer.get()); 2138 ASSERT_TRUE(resizer.get());
2127 gfx::Point location = resizer->GetInitialLocation(); 2139 gfx::Point location = resizer->GetInitialLocation();
2128 location.Offset(20, 20); 2140 location.Offset(20, 20);
2129 resizer->Drag(location, 0); 2141 resizer->Drag(location, 0);
2130 ToggleOverview(); 2142 ToggleOverview();
2131 resizer->RevertDrag(); 2143 resizer->RevertDrag();
2132 } 2144 }
2133 2145
2134 } // namespace ash 2146 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/scoped_transform_overview_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698