| 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 "chrome/browser/chromeos/ui/low_disk_notification.h" | 5 #include "chrome/browser/chromeos/ui/low_disk_notification.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" | 12 #include "chromeos/dbus/dbus_thread_manager.h" |
| 13 #include "chromeos/dbus/fake_cryptohome_client.h" | 13 #include "chromeos/dbus/fake_cryptohome_client.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/chromeos/resources/grit/ui_chromeos_resources.h" | |
| 18 #include "ui/message_center/fake_message_center.h" | 17 #include "ui/message_center/fake_message_center.h" |
| 19 #include "ui/message_center/message_center.h" | 18 #include "ui/message_center/message_center.h" |
| 20 | 19 |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| 23 // Copied from low_disk_notification.cc | 22 // Copied from low_disk_notification.cc |
| 24 const uint64_t kMediumNotification = (1 << 30) - 1; | 23 const uint64_t kMediumNotification = (1 << 30) - 1; |
| 25 const uint64_t kHighNotification = (512 << 20) - 1; | 24 const uint64_t kHighNotification = (512 << 20) - 1; |
| 26 | 25 |
| 27 } // namespace | 26 } // namespace |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 96 } |
| 98 | 97 |
| 99 TEST_F(LowDiskNotificationTest, MediumNotificationsAreNotShownAfterThrottling) { | 98 TEST_F(LowDiskNotificationTest, MediumNotificationsAreNotShownAfterThrottling) { |
| 100 low_disk_notification_->OnLowDiskSpace(kMediumNotification); | 99 low_disk_notification_->OnLowDiskSpace(kMediumNotification); |
| 101 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(15)); | 100 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(15)); |
| 102 low_disk_notification_->OnLowDiskSpace(kMediumNotification); | 101 low_disk_notification_->OnLowDiskSpace(kMediumNotification); |
| 103 EXPECT_EQ(1, notification_count_); | 102 EXPECT_EQ(1, notification_count_); |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace chromeos | 105 } // namespace chromeos |
| OLD | NEW |