| OLD | NEW |
| 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/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
| 6 #include "ash/screen_util.h" | 6 #include "ash/screen_util.h" |
| 7 #include "ash/shelf/shelf.h" | 7 #include "ash/shelf/shelf.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/toast/toast_manager.h" | 10 #include "ash/system/toast/toast_manager.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 14 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 // Long duration so the timeout doesn't occur. | 18 // Long duration so the timeout doesn't occur. |
| 19 const int64_t kLongLongDuration = INT64_MAX; | 19 const int64_t kLongLongDuration = INT64_MAX; |
| 20 | 20 |
| 21 class DummyEvent : public ui::Event { | 21 class DummyEvent : public ui::Event { |
| 22 public: | 22 public: |
| 23 DummyEvent() : Event(ui::ET_UNKNOWN, base::TimeDelta(), 0) {} | 23 DummyEvent() : Event(ui::ET_UNKNOWN, base::TimeTicks(), 0) {} |
| 24 ~DummyEvent() override {} | 24 ~DummyEvent() override {} |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 class ToastManagerTest : public test::AshTestBase { | 27 class ToastManagerTest : public test::AshTestBase { |
| 28 public: | 28 public: |
| 29 ToastManagerTest() {} | 29 ToastManagerTest() {} |
| 30 ~ToastManagerTest() override {} | 30 ~ToastManagerTest() override {} |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 void SetUp() override { | 33 void SetUp() override { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 EXPECT_EQ("TEXT3", GetCurrentText()); | 299 EXPECT_EQ("TEXT3", GetCurrentText()); |
| 300 // Cancel the shown toast. | 300 // Cancel the shown toast. |
| 301 CancelToast(id3); | 301 CancelToast(id3); |
| 302 // Confirm that the shown toast disappears. | 302 // Confirm that the shown toast disappears. |
| 303 EXPECT_FALSE(GetCurrentOverlay()); | 303 EXPECT_FALSE(GetCurrentOverlay()); |
| 304 // Confirm that only 1 toast is shown. | 304 // Confirm that only 1 toast is shown. |
| 305 EXPECT_EQ(2, GetToastSerial()); | 305 EXPECT_EQ(2, GetToastSerial()); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace ash | 308 } // namespace ash |
| OLD | NEW |