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

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

Issue 2243563002: Show small notification icons in notification tray (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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>
11 11
12 #include "ash/common/shelf/app_list_button.h" 12 #include "ash/common/shelf/app_list_button.h"
13 #include "ash/common/shelf/overflow_bubble.h" 13 #include "ash/common/shelf/overflow_bubble.h"
14 #include "ash/common/shelf/overflow_bubble_view.h" 14 #include "ash/common/shelf/overflow_bubble_view.h"
15 #include "ash/common/shelf/shelf_button.h" 15 #include "ash/common/shelf/shelf_button.h"
16 #include "ash/common/shelf/shelf_constants.h" 16 #include "ash/common/shelf/shelf_constants.h"
17 #include "ash/common/shelf/shelf_icon_observer.h" 17 #include "ash/common/shelf/shelf_icon_observer.h"
18 #include "ash/common/shelf/shelf_menu_model.h" 18 #include "ash/common/shelf/shelf_menu_model.h"
19 #include "ash/common/shelf/shelf_model.h" 19 #include "ash/common/shelf/shelf_model.h"
20 #include "ash/common/shelf/shelf_tooltip_manager.h" 20 #include "ash/common/shelf/shelf_tooltip_manager.h"
21 #include "ash/common/shelf/wm_shelf.h" 21 #include "ash/common/shelf/wm_shelf.h"
22 #include "ash/common/shell_window_ids.h" 22 #include "ash/common/shell_window_ids.h"
23 #include "ash/common/system/web_notification/web_notification_tray.h"
23 #include "ash/common/test/material_design_controller_test_api.h" 24 #include "ash/common/test/material_design_controller_test_api.h"
24 #include "ash/common/wm_shell.h" 25 #include "ash/common/wm_shell.h"
25 #include "ash/shelf/shelf_widget.h" 26 #include "ash/shelf/shelf_widget.h"
26 #include "ash/shell.h" 27 #include "ash/shell.h"
27 #include "ash/test/ash_test_base.h" 28 #include "ash/test/ash_test_base.h"
28 #include "ash/test/ash_test_helper.h" 29 #include "ash/test/ash_test_helper.h"
29 #include "ash/test/overflow_bubble_view_test_api.h" 30 #include "ash/test/overflow_bubble_view_test_api.h"
30 #include "ash/test/shelf_test_api.h" 31 #include "ash/test/shelf_test_api.h"
31 #include "ash/test/shelf_view_test_api.h" 32 #include "ash/test/shelf_view_test_api.h"
32 #include "ash/test/test_shelf_delegate.h" 33 #include "ash/test/test_shelf_delegate.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 307
307 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {} 308 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {}
308 ~ShelfViewTest() override {} 309 ~ShelfViewTest() override {}
309 310
310 void SetUp() override { 311 void SetUp() override {
311 AshTestBase::SetUp(); 312 AshTestBase::SetUp();
312 model_ = WmShell::Get()->shelf_model(); 313 model_ = WmShell::Get()->shelf_model();
313 Shelf* shelf = Shelf::ForPrimaryDisplay(); 314 Shelf* shelf = Shelf::ForPrimaryDisplay();
314 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); 315 shelf_view_ = ShelfTestAPI(shelf).shelf_view();
315 316
317 WebNotificationTray::DisableAnimationsForTest(true);
318
316 // The bounds should be big enough for 4 buttons + overflow chevron. 319 // The bounds should be big enough for 4 buttons + overflow chevron.
317 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE)); 320 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE));
318 321
319 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); 322 test_api_.reset(new ShelfViewTestAPI(shelf_view_));
320 test_api_->SetAnimationDuration(1); // Speeds up animation for test. 323 test_api_->SetAnimationDuration(1); // Speeds up animation for test.
321 324
322 ReplaceShelfDelegate(); 325 ReplaceShelfDelegate();
323 326
324 // Add browser shortcut shelf item at index 0 for test. 327 // Add browser shortcut shelf item at index 0 for test.
325 AddBrowserShortcut(); 328 AddBrowserShortcut();
326 } 329 }
327 330
328 void TearDown() override { 331 void TearDown() override {
332 WebNotificationTray::DisableAnimationsForTest(false); // Reenable animation
333
329 shelf_delegate_ = nullptr; 334 shelf_delegate_ = nullptr;
330 test_api_.reset(); 335 test_api_.reset();
331 AshTestBase::TearDown(); 336 AshTestBase::TearDown();
332 } 337 }
333 338
334 protected: 339 protected:
335 void CreateAndSetShelfItemDelegateForID(ShelfID id) { 340 void CreateAndSetShelfItemDelegateForID(ShelfID id) {
336 std::unique_ptr<ShelfItemDelegate> delegate( 341 std::unique_ptr<ShelfItemDelegate> delegate(
337 new TestShelfItemDelegate(NULL)); 342 new TestShelfItemDelegate(NULL));
338 model_->SetShelfItemDelegate(id, std::move(delegate)); 343 model_->SetShelfItemDelegate(id, std::move(delegate));
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 test_api_->CloseMenu(); 2571 test_api_->CloseMenu();
2567 EXPECT_EQ(views::InkDropState::HIDDEN, 2572 EXPECT_EQ(views::InkDropState::HIDDEN,
2568 browser_button_ink_drop_->GetTargetInkDropState()); 2573 browser_button_ink_drop_->GetTargetInkDropState());
2569 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), 2574 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(),
2570 ElementsAre(views::InkDropState::ACTIVATED, 2575 ElementsAre(views::InkDropState::ACTIVATED,
2571 views::InkDropState::DEACTIVATED)); 2576 views::InkDropState::DEACTIVATED));
2572 } 2577 }
2573 2578
2574 } // namespace test 2579 } // namespace test
2575 } // namespace ash 2580 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/web_notification/web_notification_tray.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698