Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 9 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestBasicUsage) { | 112 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestBasicUsage) { |
| 113 ASSERT_TRUE(RunExtensionTest("notifications/api/basic_usage")) << message_; | 113 ASSERT_TRUE(RunExtensionTest("notifications/api/basic_usage")) << message_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestEvents) { | 116 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestEvents) { |
| 117 ASSERT_TRUE(RunExtensionTest("notifications/api/events")) << message_; | 117 ASSERT_TRUE(RunExtensionTest("notifications/api/events")) << message_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestCSP) { | 120 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestCSP) { |
| 121 ASSERT_TRUE(RunExtensionTest("notifications/api/csp")) << message_; | 121 ASSERT_TRUE(RunExtensionTest("notifications/api/csp")) << message_; |
| 122 SetIgnoreCSPErrorMessages(true); | |
|
asargent_no_longer_on_chrome
2016/05/31 19:24:11
Please add a comment with a link to crbug.com/6161
wychen
2016/06/08 05:41:57
Done.
| |
| 122 } | 123 } |
| 123 | 124 |
| 124 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) { | 125 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) { |
| 125 const extensions::Extension* extension = | 126 const extensions::Extension* extension = |
| 126 LoadExtensionAndWait("notifications/api/by_user"); | 127 LoadExtensionAndWait("notifications/api/by_user"); |
| 127 ASSERT_TRUE(extension) << message_; | 128 ASSERT_TRUE(extension) << message_; |
| 128 | 129 |
| 129 { | 130 { |
| 130 ResultCatcher catcher; | 131 ResultCatcher catcher; |
| 131 const std::string notification_id = | 132 const std::string notification_id = |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 ASSERT_TRUE(extension) << message_; | 296 ASSERT_TRUE(extension) << message_; |
| 296 | 297 |
| 297 const message_center::NotificationList::Notifications& notifications = | 298 const message_center::NotificationList::Notifications& notifications = |
| 298 g_browser_process->message_center()->GetVisibleNotifications(); | 299 g_browser_process->message_center()->GetVisibleNotifications(); |
| 299 ASSERT_EQ(1u, notifications.size()); | 300 ASSERT_EQ(1u, notifications.size()); |
| 300 message_center::Notification* notification = *(notifications.begin()); | 301 message_center::Notification* notification = *(notifications.begin()); |
| 301 ASSERT_EQ(extension->url(), notification->origin_url()); | 302 ASSERT_EQ(extension->url(), notification->origin_url()); |
| 302 | 303 |
| 303 EXPECT_TRUE(notification->never_timeout()); | 304 EXPECT_TRUE(notification->never_timeout()); |
| 304 } | 305 } |
| OLD | NEW |