diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 21:37:50 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 21:37:50 +0000 |
commit | 2d8a77e2993b6adf54db93fb2a42b95c3b206990 (patch) | |
tree | 1666b69dc347d0a4269df57c6c606d676d85d317 /webkit | |
parent | 58174a72e2dc05e3240b38bc4be8edd28d129856 (diff) | |
download | chromium_src-2d8a77e2993b6adf54db93fb2a42b95c3b206990.zip chromium_src-2d8a77e2993b6adf54db93fb2a42b95c3b206990.tar.gz chromium_src-2d8a77e2993b6adf54db93fb2a42b95c3b206990.tar.bz2 |
Add support for RTL and replace ID to the test shell notification presenter,
to support the latest webkit interface and tests.
BUG=none
TEST=webkit notifications layout tests.
Review URL: http://codereview.chromium.org/1936003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/test_shell/notification_presenter.cc | 14 | ||||
-rw-r--r-- | webkit/tools/test_shell/notification_presenter.h | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/notification_presenter.cc b/webkit/tools/test_shell/notification_presenter.cc index e0402d29..163b181 100644 --- a/webkit/tools/test_shell/notification_presenter.cc +++ b/webkit/tools/test_shell/notification_presenter.cc @@ -26,11 +26,23 @@ void TestNotificationPresenter::grantPermission(const std::string& origin) { // The output from all these methods matches what DumpRenderTree produces. bool TestNotificationPresenter::show(const WebNotification& notification) { + if (!notification.replaceId().isEmpty()) { + std::string replace_id(notification.replaceId().utf8()); + if (replacements_.find(replace_id) != replacements_.end()) + printf("REPLACING NOTIFICATION %s\n", + replacements_.find(replace_id)->second.c_str()); + + WebString identifier = notification.isHTML() ? + notification.url().spec().utf16() : notification.title(); + replacements_[replace_id] = identifier.utf8(); + } + if (notification.isHTML()) { printf("DESKTOP NOTIFICATION: contents at %s\n", notification.url().spec().data()); } else { - printf("DESKTOP NOTIFICATION: icon %s, title %s, text %s\n", + printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n", + notification.dir() == "rtl" ? "(RTL)" : "", notification.iconURL().isEmpty() ? "" : notification.iconURL().spec().data(), notification.title().isEmpty() ? "" : diff --git a/webkit/tools/test_shell/notification_presenter.h b/webkit/tools/test_shell/notification_presenter.h index 07d7978..f5b3b07 100644 --- a/webkit/tools/test_shell/notification_presenter.h +++ b/webkit/tools/test_shell/notification_presenter.h @@ -5,6 +5,7 @@ #ifndef WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_ #define WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_ +#include <map> #include <set> #include <string> @@ -40,6 +41,9 @@ class TestNotificationPresenter : public WebKit::WebNotificationPresenter { // List of allowed origins. std::set<std::string> allowed_origins_; + + // Map of active replacement IDs to the titles of those notifications + std::map<std::string, std::string> replacements_; }; #endif // WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_ |