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

Side by Side Diff: chrome/browser/extensions/notifications_apitest.cc

Issue 187803005: Remove uses of the Legacy Notification API and tests on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 6
7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h"
8 #include "chrome/browser/notifications/desktop_notification_service.h" 8 #include "chrome/browser/notifications/desktop_notification_service.h"
9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 23 matching lines...) Expand all
34 if (extension) 34 if (extension)
35 page_complete.Wait(); 35 page_complete.Wait();
36 return extension; 36 return extension;
37 } 37 }
38 }; 38 };
39 39
40 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsNoPermission) { 40 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsNoPermission) {
41 ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_; 41 ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_;
42 } 42 }
43 43
44 // This test verifies that on RichNotification-enabled platforms HTML
45 // notificaitons are disabled.
46 #if defined(RUN_MESSAGE_CENTER_TESTS)
47 #define MAYBE_NoHTMLNotifications NoHTMLNotifications
48 #else
49 #define MAYBE_NoHTMLNotifications DISABLED_NoHTMLNotifications
50 #endif
51 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_NoHTMLNotifications) {
52 ASSERT_TRUE(message_center::IsRichNotificationEnabled());
53 ASSERT_TRUE(RunExtensionTest("notifications/no_html")) << message_;
54 }
55
56 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsHasPermission) { 44 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsHasPermission) {
57 DesktopNotificationServiceFactory::GetForProfile(browser()->profile()) 45 DesktopNotificationServiceFactory::GetForProfile(browser()->profile())
58 ->GrantPermission(GURL( 46 ->GrantPermission(GURL(
59 "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel")); 47 "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel"));
60 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs")) 48 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs"))
61 << message_; 49 << message_;
62 } 50 }
63 51
64 // MessaceCenter-specific test. 52 // MessaceCenter-specific test.
65 #if defined(RUN_MESSAGE_CENTER_TESTS) 53 #if defined(RUN_MESSAGE_CENTER_TESTS)
66 #define MAYBE_NotificationsAllowUnload NotificationsAllowUnload 54 #define MAYBE_NotificationsAllowUnload NotificationsAllowUnload
67 #else 55 #else
68 #define MAYBE_NotificationsAllowUnload DISABLED_NotificationsAllowUnload 56 #define MAYBE_NotificationsAllowUnload DISABLED_NotificationsAllowUnload
69 #endif 57 #endif
70 58
71 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) { 59 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) {
72 const extensions::Extension* extension = 60 const extensions::Extension* extension =
73 LoadExtensionAndWait("notifications/api/unload"); 61 LoadExtensionAndWait("notifications/api/unload");
74 ASSERT_TRUE(extension) << message_; 62 ASSERT_TRUE(extension) << message_;
75 63
76 // Lazy Background Page has been shut down. 64 // Lazy Background Page has been shut down.
77 extensions::ProcessManager* pm = 65 extensions::ProcessManager* pm =
78 extensions::ExtensionSystem::Get(profile())->process_manager(); 66 extensions::ExtensionSystem::Get(profile())->process_manager();
79 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); 67 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id()));
80 } 68 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698