diff options
author | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 21:35:07 +0000 |
---|---|---|
committer | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 21:35:07 +0000 |
commit | 3555f599394ce2582cba3562859b54e53f3370a7 (patch) | |
tree | eb263fc0bc207393614da854a822eb0d63ecbfb8 | |
parent | 623d3ae5302a62c73cf6ad18245c76b481e5d4b0 (diff) | |
download | chromium_src-3555f599394ce2582cba3562859b54e53f3370a7.zip chromium_src-3555f599394ce2582cba3562859b54e53f3370a7.tar.gz chromium_src-3555f599394ce2582cba3562859b54e53f3370a7.tar.bz2 |
Re-commit the notification presenter changes (undo r47765).
This didn't cause a perf regression from what I can tell.
BUG=none
TEST=none
R=johnnyg@chromium.org
Review URL: http://codereview.chromium.org/2143008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48326 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/layout_tests/test_expectations.txt | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/notification_presenter.cc | 14 | ||||
-rw-r--r-- | webkit/tools/test_shell/notification_presenter.h | 4 |
3 files changed, 17 insertions, 9 deletions
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index f32ef1a..0ca4cc3 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -4,11 +4,3 @@ // // Only add expectations here to temporarily suppress messages on the bots // until the changes can be landed upstream. - -// temporarily mark these tests as failing until we can figure out why -// r46500 (and wk 58765) seems to have caused a perf regression -BUG43276 : fast/notifications/notifications-replace.html = FAIL -BUG43276 : fast/notifications/notifications-rtl.html = FAIL - -// Temporarily mark this as flaky because it is failing so often on the console. -BUG45106 : svg/clip-path/clip-path-evenodd-nonzero.svg = PASS FAIL 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_ |