| 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_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/browser/notifications/notification_object_proxy.h" | 11 #include "chrome/browser/notifications/notification_object_proxy.h" |
| 12 #include "chrome/browser/notifications/balloon.h" | 12 #include "chrome/browser/notifications/balloon.h" |
| 13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 | 14 |
| 15 // NotificationDelegate which does nothing, useful for testing when | 15 // NotificationDelegate which does nothing, useful for testing when |
| 16 // the notification events are not important. | 16 // the notification events are not important. |
| 17 class MockNotificationDelegate : public NotificationDelegate { | 17 class MockNotificationDelegate : public NotificationDelegate { |
| 18 public: | 18 public: |
| 19 explicit MockNotificationDelegate(const std::string& id); | 19 explicit MockNotificationDelegate(const std::string& id); |
| 20 virtual ~MockNotificationDelegate(); | |
| 21 | 20 |
| 22 // NotificationDelegate interface. | 21 // NotificationDelegate interface. |
| 23 virtual void Display() OVERRIDE {} | 22 virtual void Display() OVERRIDE {} |
| 24 virtual void Error() OVERRIDE {} | 23 virtual void Error() OVERRIDE {} |
| 25 virtual void Close(bool by_user) OVERRIDE {} | 24 virtual void Close(bool by_user) OVERRIDE {} |
| 26 virtual void Click() OVERRIDE {} | 25 virtual void Click() OVERRIDE {} |
| 27 virtual std::string id() const OVERRIDE; | 26 virtual std::string id() const OVERRIDE; |
| 28 | 27 |
| 29 private: | 28 private: |
| 29 virtual ~MockNotificationDelegate(); |
| 30 |
| 30 std::string id_; | 31 std::string id_; |
| 31 | 32 |
| 32 DISALLOW_COPY_AND_ASSIGN(MockNotificationDelegate); | 33 DISALLOW_COPY_AND_ASSIGN(MockNotificationDelegate); |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 // Mock implementation of Javascript object proxy which logs events that | 36 // Mock implementation of Javascript object proxy which logs events that |
| 36 // would have been fired on it. Useful for tests where the sequence of | 37 // would have been fired on it. Useful for tests where the sequence of |
| 37 // notification events needs to be verified. | 38 // notification events needs to be verified. |
| 38 // | 39 // |
| 39 // |Logger| class provided in template must implement method | 40 // |Logger| class provided in template must implement method |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 virtual void Close(bool by_user) OVERRIDE; | 86 virtual void Close(bool by_user) OVERRIDE; |
| 86 virtual gfx::Size GetSize() const OVERRIDE; | 87 virtual gfx::Size GetSize() const OVERRIDE; |
| 87 virtual BalloonHost* GetHost() const OVERRIDE; | 88 virtual BalloonHost* GetHost() const OVERRIDE; |
| 88 | 89 |
| 89 private: | 90 private: |
| 90 // Non-owned pointer. | 91 // Non-owned pointer. |
| 91 Balloon* balloon_; | 92 Balloon* balloon_; |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 95 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
| OLD | NEW |