Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: chrome/browser/notifications/notification_browsertest.cc

Issue 433273002: NotificationObjectProxy should own the DesktopNotificationDelegateImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass as scoped_ptr Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <deque> 5 #include <deque>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 NEW_BACKGROUND_TAB, 736 NEW_BACKGROUND_TAB,
737 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 737 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
738 browser()->tab_strip_model()->ActivateTabAt(0, true); 738 browser()->tab_strip_model()->ActivateTabAt(0, true);
739 ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); 739 ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
740 CreateSimpleNotification(browser(), true); 740 CreateSimpleNotification(browser(), true);
741 ASSERT_EQ(1, GetNotificationCount()); 741 ASSERT_EQ(1, GetNotificationCount());
742 CrashTab(browser(), 0); 742 CrashTab(browser(), 0);
743 ASSERT_EQ(1, GetNotificationCount()); 743 ASSERT_EQ(1, GetNotificationCount());
744 } 744 }
745 745
746 // See http://crbug.com/366539 746 IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationReplacement) {
747 #if defined(OS_LINUX)
748 #define MAYBE_TestNotificationReplacement DISABLED_TestNotificationReplacement
749 #else
750 #define MAYBE_TestNotificationReplacement TestNotificationReplacement
751 #endif
752
753 IN_PROC_BROWSER_TEST_F(NotificationsTest, MAYBE_TestNotificationReplacement) {
754 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 747 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
755 748
756 // Test that we can replace a notification using the replaceId. 749 // Test that we can replace a notification using the replaceId.
757 AllowAllOrigins(); 750 AllowAllOrigins();
758 751
759 ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); 752 ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
760 753
761 std::string result = CreateNotification( 754 std::string result = CreateNotification(
762 browser(), true, "abc.png", "Title1", "Body1", "chat"); 755 browser(), true, "abc.png", "Title1", "Body1", "chat");
763 EXPECT_NE("-1", result); 756 EXPECT_NE("-1", result);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 795
803 result = CreateSimpleNotification(browser(), true); 796 result = CreateSimpleNotification(browser(), true);
804 EXPECT_NE("-1", result); 797 EXPECT_NE("-1", result);
805 798
806 EXPECT_EQ(settings_map->GetLastUsage(GetTestPageURL().GetOrigin(), 799 EXPECT_EQ(settings_map->GetLastUsage(GetTestPageURL().GetOrigin(),
807 GetTestPageURL().GetOrigin(), 800 GetTestPageURL().GetOrigin(),
808 CONTENT_SETTINGS_TYPE_NOTIFICATIONS) 801 CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
809 .ToDoubleT(), 802 .ToDoubleT(),
810 13); 803 13);
811 } 804 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.cc ('k') | chrome/browser/notifications/notification_object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698