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

Side by Side Diff: ash/shelf/shelf_view_unittest.cc

Issue 2750483005: Moves app_list() and related functions from Shell to WmShell (Closed)
Patch Set: dont explicitly delete Created 3 years, 9 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 | « ash/common/wm_shell.cc ('k') | ash/shell.h » ('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 (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 "ash/common/shelf/shelf_view.h" 5 #include "ash/common/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 EXPECT_TRUE(shelf_view_->ShouldHideTooltip( 1469 EXPECT_TRUE(shelf_view_->ShouldHideTooltip(
1470 gfx::Point(all_area.x() - 1, all_area.y()))); 1470 gfx::Point(all_area.x() - 1, all_area.y())));
1471 EXPECT_TRUE(shelf_view_->ShouldHideTooltip( 1471 EXPECT_TRUE(shelf_view_->ShouldHideTooltip(
1472 gfx::Point(all_area.x(), all_area.y() - 1))); 1472 gfx::Point(all_area.x(), all_area.y() - 1)));
1473 EXPECT_TRUE(shelf_view_->ShouldHideTooltip( 1473 EXPECT_TRUE(shelf_view_->ShouldHideTooltip(
1474 gfx::Point(all_area.x(), all_area.bottom()))); 1474 gfx::Point(all_area.x(), all_area.bottom())));
1475 } 1475 }
1476 1476
1477 TEST_F(ShelfViewTest, ShouldHideTooltipWithAppListWindowTest) { 1477 TEST_F(ShelfViewTest, ShouldHideTooltipWithAppListWindowTest) {
1478 // Trigger mock notifications that the app list was shown. 1478 // Trigger mock notifications that the app list was shown.
1479 WmShell::Get()->app_list()->OnTargetVisibilityChanged(true); 1479 Shell::Get()->app_list()->OnTargetVisibilityChanged(true);
1480 WmShell::Get()->app_list()->OnVisibilityChanged(true, GetPrimaryDisplayId()); 1480 Shell::Get()->app_list()->OnVisibilityChanged(true, GetPrimaryDisplayId());
1481 AppListButton* app_list_button = shelf_view_->GetAppListButton(); 1481 AppListButton* app_list_button = shelf_view_->GetAppListButton();
1482 app_list_button->OnAppListShown(); 1482 app_list_button->OnAppListShown();
1483 1483
1484 // The tooltip shouldn't hide if the mouse is on normal buttons. 1484 // The tooltip shouldn't hide if the mouse is on normal buttons.
1485 for (int i = 1; i < test_api_->GetButtonCount(); i++) { 1485 for (int i = 1; i < test_api_->GetButtonCount(); i++) {
1486 ShelfButton* button = test_api_->GetButton(i); 1486 ShelfButton* button = test_api_->GetButton(i);
1487 if (!button) 1487 if (!button)
1488 continue; 1488 continue;
1489 1489
1490 EXPECT_FALSE(shelf_view_->ShouldHideTooltip( 1490 EXPECT_FALSE(shelf_view_->ShouldHideTooltip(
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 auto browser_button_ink_drop = 2035 auto browser_button_ink_drop =
2036 base::MakeUnique<InkDropSpy>(base::MakeUnique<views::InkDropImpl>( 2036 base::MakeUnique<InkDropSpy>(base::MakeUnique<views::InkDropImpl>(
2037 browser_button_, browser_button_->size())); 2037 browser_button_, browser_button_->size()));
2038 browser_button_ink_drop_ = browser_button_ink_drop.get(); 2038 browser_button_ink_drop_ = browser_button_ink_drop.get();
2039 views::test::InkDropHostViewTestApi(browser_button_) 2039 views::test::InkDropHostViewTestApi(browser_button_)
2040 .SetInkDrop(std::move(browser_button_ink_drop)); 2040 .SetInkDrop(std::move(browser_button_ink_drop));
2041 } 2041 }
2042 2042
2043 void ShowAppList() { 2043 void ShowAppList() {
2044 // Trigger a mock notification that the app list was shown. 2044 // Trigger a mock notification that the app list was shown.
2045 WmShell::Get()->app_list()->OnTargetVisibilityChanged(true); 2045 Shell::Get()->app_list()->OnTargetVisibilityChanged(true);
2046 app_list_button_->OnAppListShown(); 2046 app_list_button_->OnAppListShown();
2047 } 2047 }
2048 2048
2049 void DismissAppList() { 2049 void DismissAppList() {
2050 // Trigger a mock notification that the app list was dismissed. 2050 // Trigger a mock notification that the app list was dismissed.
2051 WmShell::Get()->app_list()->OnTargetVisibilityChanged(false); 2051 Shell::Get()->app_list()->OnTargetVisibilityChanged(false);
2052 app_list_button_->OnAppListDismissed(); 2052 app_list_button_->OnAppListDismissed();
2053 } 2053 }
2054 2054
2055 void FinishAppListVisibilityChange() { 2055 void FinishAppListVisibilityChange() {
2056 // Trigger a mock notification that the app list finished animating. 2056 // Trigger a mock notification that the app list finished animating.
2057 app_list::AppList* app_list = WmShell::Get()->app_list(); 2057 app_list::AppList* app_list = Shell::Get()->app_list();
2058 app_list->OnVisibilityChanged(app_list->GetTargetVisibility(), 2058 app_list->OnVisibilityChanged(app_list->GetTargetVisibility(),
2059 GetPrimaryDisplayId()); 2059 GetPrimaryDisplayId());
2060 } 2060 }
2061 2061
2062 AppListButton* app_list_button_ = nullptr; 2062 AppListButton* app_list_button_ = nullptr;
2063 InkDropSpy* app_list_button_ink_drop_ = nullptr; 2063 InkDropSpy* app_list_button_ink_drop_ = nullptr;
2064 ShelfButton* browser_button_ = nullptr; 2064 ShelfButton* browser_button_ = nullptr;
2065 InkDropSpy* browser_button_ink_drop_ = nullptr; 2065 InkDropSpy* browser_button_ink_drop_ = nullptr;
2066 2066
2067 private: 2067 private:
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 EXPECT_EQ(views::InkDropState::ACTIVATED, 3012 EXPECT_EQ(views::InkDropState::ACTIVATED,
3013 overflow_button_ink_drop_->GetTargetInkDropState()); 3013 overflow_button_ink_drop_->GetTargetInkDropState());
3014 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), 3014 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(),
3015 IsEmpty()); 3015 IsEmpty());
3016 3016
3017 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); 3017 ASSERT_TRUE(test_api_->IsShowingOverflowBubble());
3018 } 3018 }
3019 3019
3020 } // namespace test 3020 } // namespace test
3021 } // namespace ash 3021 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.cc ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698