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

Side by Side Diff: ash/system/toast/toast_manager_unittest.cc

Issue 2171493002: Moves ToastManager from Shell to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove include Created 4 years, 5 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/shell.cc ('k') | ui/arc/notification/arc_notification_manager.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_constants.h" 5 #include "ash/common/shelf/shelf_constants.h"
6 #include "ash/common/shelf/wm_shelf.h" 6 #include "ash/common/shelf/wm_shelf.h"
7 #include "ash/common/system/toast/toast_manager.h" 7 #include "ash/common/system/toast/toast_manager.h"
8 #include "ash/common/wm_shell.h"
8 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
9 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
12 #include "base/run_loop.h" 13 #include "base/run_loop.h"
13 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
14 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 15 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
15 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
16 17
17 namespace ash { 18 namespace ash {
18 19
19 class DummyEvent : public ui::Event { 20 class DummyEvent : public ui::Event {
20 public: 21 public:
21 DummyEvent() : Event(ui::ET_UNKNOWN, base::TimeTicks(), 0) {} 22 DummyEvent() : Event(ui::ET_UNKNOWN, base::TimeTicks(), 0) {}
22 ~DummyEvent() override {} 23 ~DummyEvent() override {}
23 }; 24 };
24 25
25 class ToastManagerTest : public test::AshTestBase { 26 class ToastManagerTest : public test::AshTestBase {
26 public: 27 public:
27 ToastManagerTest() {} 28 ToastManagerTest() {}
28 ~ToastManagerTest() override {} 29 ~ToastManagerTest() override {}
29 30
30 private: 31 private:
31 void SetUp() override { 32 void SetUp() override {
32 test::AshTestBase::SetUp(); 33 test::AshTestBase::SetUp();
33 34
34 manager_ = Shell::GetInstance()->toast_manager(); 35 manager_ = WmShell::Get()->toast_manager();
35 36
36 manager_->ResetSerialForTesting(); 37 manager_->ResetSerialForTesting();
37 EXPECT_EQ(0, GetToastSerial()); 38 EXPECT_EQ(0, GetToastSerial());
38 } 39 }
39 40
40 protected: 41 protected:
41 ToastManager* manager() { return manager_; } 42 ToastManager* manager() { return manager_; }
42 43
43 int GetToastSerial() { return manager_->serial_for_testing(); } 44 int GetToastSerial() { return manager_->serial_for_testing(); }
44 45
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 EXPECT_EQ("TEXT3", GetCurrentText()); 295 EXPECT_EQ("TEXT3", GetCurrentText());
295 // Cancel the shown toast. 296 // Cancel the shown toast.
296 CancelToast(id3); 297 CancelToast(id3);
297 // Confirm that the shown toast disappears. 298 // Confirm that the shown toast disappears.
298 EXPECT_FALSE(GetCurrentOverlay()); 299 EXPECT_FALSE(GetCurrentOverlay());
299 // Confirm that only 1 toast is shown. 300 // Confirm that only 1 toast is shown.
300 EXPECT_EQ(2, GetToastSerial()); 301 EXPECT_EQ(2, GetToastSerial());
301 } 302 }
302 303
303 } // namespace ash 304 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ui/arc/notification/arc_notification_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698