summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notification_test_util.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-01-07 14:18:56 +0000
committerBen Murdoch <benm@google.com>2011-01-11 10:23:13 +0000
commit201ade2fbba22bfb27ae029f4d23fca6ded109a0 (patch)
treeb793f4ed916f73cf18357ea467ff3deb5ffb5b52 /chrome/browser/notifications/notification_test_util.h
parentd8c4c37a7d0961944bfdfaa117d5c68c8e129c97 (diff)
downloadexternal_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.zip
external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.gz
external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.bz2
Merge chromium at 9.0.597.55: Initial merge by git.
Change-Id: Id686a88437441ec7e17abb3328a404c7b6c3c6ad
Diffstat (limited to 'chrome/browser/notifications/notification_test_util.h')
-rw-r--r--chrome/browser/notifications/notification_test_util.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/browser/notifications/notification_test_util.h b/chrome/browser/notifications/notification_test_util.h
index 4cbf600..fbaec4e 100644
--- a/chrome/browser/notifications/notification_test_util.h
+++ b/chrome/browser/notifications/notification_test_util.h
@@ -6,6 +6,8 @@
#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
#pragma once
+#include <string>
+
#include "chrome/browser/notifications/notification_object_proxy.h"
#include "chrome/browser/notifications/balloon.h"
#include "gfx/size.h"
@@ -14,7 +16,7 @@
// the notification events are not important.
class MockNotificationDelegate : public NotificationDelegate {
public:
- explicit MockNotificationDelegate(std::string id) : id_(id) {}
+ explicit MockNotificationDelegate(const std::string& id) : id_(id) {}
virtual ~MockNotificationDelegate() {}
// NotificationDelegate interface.
@@ -26,6 +28,8 @@ class MockNotificationDelegate : public NotificationDelegate {
private:
std::string id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockNotificationDelegate);
};
// Mock implementation of Javascript object proxy which logs events that
@@ -35,10 +39,11 @@ class MockNotificationDelegate : public NotificationDelegate {
// |Logger| class provided in template must implement method
// static void log(string);
template<class Logger>
-class LoggingNotificationProxyBase : public NotificationObjectProxy {
+class LoggingNotificationDelegate : public NotificationDelegate {
public:
- LoggingNotificationProxyBase() :
- NotificationObjectProxy(0, 0, 0, false) {}
+ explicit LoggingNotificationDelegate(std::string id)
+ : notification_id_(id) {
+ }
// NotificationObjectProxy override
virtual void Display() {
@@ -47,12 +52,22 @@ class LoggingNotificationProxyBase : public NotificationObjectProxy {
virtual void Error() {
Logger::log("notification error\n");
}
+ virtual void Click() {
+ Logger::log("notification clicked\n");
+ }
virtual void Close(bool by_user) {
if (by_user)
Logger::log("notification closed by user\n");
else
Logger::log("notification closed by script\n");
}
+ virtual std::string id() const {
+ return notification_id_;
+ }
+ private:
+ std::string notification_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoggingNotificationDelegate);
};
// Test version of a balloon view which doesn't do anything