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

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

Issue 2209443006: Show small notification icons in notification tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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/shelf/shelf_view.h" 5 #include "ash/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_menu_model.h" 17 #include "ash/common/shelf/shelf_menu_model.h"
18 #include "ash/common/shelf/shelf_model.h" 18 #include "ash/common/shelf/shelf_model.h"
19 #include "ash/common/shelf/shelf_tooltip_manager.h" 19 #include "ash/common/shelf/shelf_tooltip_manager.h"
20 #include "ash/common/shell_window_ids.h" 20 #include "ash/common/shell_window_ids.h"
21 #include "ash/common/system/web_notification/web_notification_tray.h"
21 #include "ash/common/test/material_design_controller_test_api.h" 22 #include "ash/common/test/material_design_controller_test_api.h"
22 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
23 #include "ash/root_window_controller.h" 24 #include "ash/root_window_controller.h"
24 #include "ash/shelf/shelf.h" 25 #include "ash/shelf/shelf.h"
25 #include "ash/shelf/shelf_icon_observer.h" 26 #include "ash/shelf/shelf_icon_observer.h"
26 #include "ash/shelf/shelf_widget.h" 27 #include "ash/shelf/shelf_widget.h"
27 #include "ash/shell.h" 28 #include "ash/shell.h"
28 #include "ash/test/ash_test_base.h" 29 #include "ash/test/ash_test_base.h"
29 #include "ash/test/ash_test_helper.h" 30 #include "ash/test/ash_test_helper.h"
30 #include "ash/test/overflow_bubble_view_test_api.h" 31 #include "ash/test/overflow_bubble_view_test_api.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 311
311 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {} 312 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {}
312 ~ShelfViewTest() override {} 313 ~ShelfViewTest() override {}
313 314
314 void SetUp() override { 315 void SetUp() override {
315 AshTestBase::SetUp(); 316 AshTestBase::SetUp();
316 model_ = WmShell::Get()->shelf_model(); 317 model_ = WmShell::Get()->shelf_model();
317 Shelf* shelf = Shelf::ForPrimaryDisplay(); 318 Shelf* shelf = Shelf::ForPrimaryDisplay();
318 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); 319 shelf_view_ = ShelfTestAPI(shelf).shelf_view();
319 320
321 WebNotificationTray::DisableAnimationsForTest();
322
320 // The bounds should be big enough for 4 buttons + overflow chevron. 323 // The bounds should be big enough for 4 buttons + overflow chevron.
321 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE)); 324 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE));
322 325
323 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); 326 test_api_.reset(new ShelfViewTestAPI(shelf_view_));
324 test_api_->SetAnimationDuration(1); // Speeds up animation for test. 327 test_api_->SetAnimationDuration(1); // Speeds up animation for test.
325 328
326 ReplaceShelfDelegate(); 329 ReplaceShelfDelegate();
327 330
328 // Add browser shortcut shelf item at index 0 for test. 331 // Add browser shortcut shelf item at index 0 for test.
329 AddBrowserShortcut(); 332 AddBrowserShortcut();
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2563 test_api_->CloseMenu(); 2566 test_api_->CloseMenu();
2564 EXPECT_EQ(views::InkDropState::HIDDEN, 2567 EXPECT_EQ(views::InkDropState::HIDDEN,
2565 browser_button_ink_drop_->GetTargetInkDropState()); 2568 browser_button_ink_drop_->GetTargetInkDropState());
2566 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), 2569 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(),
2567 ElementsAre(views::InkDropState::ACTIVATED, 2570 ElementsAre(views::InkDropState::ACTIVATED,
2568 views::InkDropState::DEACTIVATED)); 2571 views::InkDropState::DEACTIVATED));
2569 } 2572 }
2570 2573
2571 } // namespace test 2574 } // namespace test
2572 } // namespace ash 2575 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698