| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h" | 14 #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h" |
| 15 #include "chrome/browser/notifications/balloon.h" | 15 #include "chrome/browser/notifications/balloon.h" |
| 16 #include "chrome/browser/notifications/desktop_notification_service.h" | 16 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 17 #include "chrome/browser/notifications/notification.h" | 17 #include "chrome/browser/notifications/notification.h" |
| 18 #include "chrome/browser/notifications/notification_test_util.h" | 18 #include "chrome/browser/notifications/notification_test_util.h" |
| 19 #include "chrome/browser/notifications/notification_ui_manager.h" | 19 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 20 #include "chrome/browser/notifications/notifications_prefs_cache.h" | 20 #include "chrome/browser/notifications/notifications_prefs_cache.h" |
| 21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 22 #include "chrome/test/base/testing_browser_process_test.h" | |
| 23 #include "chrome/test/base/testing_pref_service.h" | 22 #include "chrome/test/base/testing_pref_service.h" |
| 24 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 25 #include "content/browser/browser_thread.h" | 24 #include "content/browser/browser_thread.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 26 |
| 28 struct DesktopNotificationHostMsg_Show_Params; | 27 struct DesktopNotificationHostMsg_Show_Params; |
| 29 | 28 |
| 30 namespace chromeos { | 29 namespace chromeos { |
| 31 | 30 |
| 32 class DesktopNotificationsTest; | 31 class DesktopNotificationsTest; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 51 std::set<Balloon*>& balloons() { return balloons_; } | 50 std::set<Balloon*>& balloons() { return balloons_; } |
| 52 int count() const { return balloons_.size(); } | 51 int count() const { return balloons_.size(); } |
| 53 | 52 |
| 54 // Returns the highest y-coordinate of all the balloons in the collection. | 53 // Returns the highest y-coordinate of all the balloons in the collection. |
| 55 int UppermostVerticalPosition(); | 54 int UppermostVerticalPosition(); |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 std::set<Balloon*> balloons_; | 57 std::set<Balloon*> balloons_; |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 class DesktopNotificationsTest : public TestingBrowserProcessTest { | 60 class DesktopNotificationsTest : public testing::Test { |
| 62 public: | 61 public: |
| 63 DesktopNotificationsTest(); | 62 DesktopNotificationsTest(); |
| 64 virtual ~DesktopNotificationsTest(); | 63 virtual ~DesktopNotificationsTest(); |
| 65 | 64 |
| 66 static void log(const std::string& message) { | 65 static void log(const std::string& message) { |
| 67 log_output_.append(message); | 66 log_output_.append(message); |
| 68 } | 67 } |
| 69 | 68 |
| 70 Profile* profile() { return profile_.get(); } | 69 Profile* profile() { return profile_.get(); } |
| 71 | 70 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Real DesktopNotificationService | 108 // Real DesktopNotificationService |
| 110 scoped_ptr<DesktopNotificationService> service_; | 109 scoped_ptr<DesktopNotificationService> service_; |
| 111 | 110 |
| 112 // Contains the cumulative output of the unit test. | 111 // Contains the cumulative output of the unit test. |
| 113 static std::string log_output_; | 112 static std::string log_output_; |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace chromeos | 115 } // namespace chromeos |
| 117 | 116 |
| 118 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_
H_ | 117 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_
H_ |
| OLD | NEW |