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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_apitest.cc

Issue 12313115: Take notification API out of experimental. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed one pathname. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/notifications/notifications_apitest.cc
diff --git a/chrome/browser/extensions/api/notification/notification_apitest.cc b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
similarity index 81%
rename from chrome/browser/extensions/api/notification/notification_apitest.cc
rename to chrome/browser/extensions/api/notifications/notifications_apitest.cc
index 21e1937240c55d1161d381d8c74f1f7667f6ac10..7ff5df5d184f515e36fb10b9b1cd5a1ead75c50a 100644
--- a/chrome/browser/extensions/api/notification/notification_apitest.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
@@ -3,11 +3,12 @@
// found in the LICENSE file.
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/extensions/api/notification/notification_api.h"
+#include "chrome/browser/extensions/api/notifications/notifications_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/features/feature.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
#include "ui/message_center/message_center.h"
@@ -19,7 +20,7 @@ namespace utils = extension_function_test_utils;
namespace {
-class NotificationApiTest : public ExtensionApiTest {
+class NotificationsApiTest : public ExtensionApiTest {
public:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
ExtensionApiTest::SetUpCommandLine(command_line);
@@ -42,15 +43,15 @@ class NotificationApiTest : public ExtensionApiTest {
} // namespace
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
- // Create a new notification. A lingering output of this block is the
- // notification ID, which we'll use in later parts of this test.
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestIdUsage) {
+ // Create a new notifications. A lingering output of this block is the
+ // notifications ID, which we'll use in later parts of this test.
std::string notification_id;
scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
{
- scoped_refptr<extensions::NotificationCreateFunction>
+ scoped_refptr<extensions::NotificationsCreateFunction>
notification_function(
- new extensions::NotificationCreateFunction());
+ new extensions::NotificationsCreateFunction());
notification_function->set_extension(empty_extension.get());
notification_function->set_has_callback(true);
@@ -71,11 +72,11 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
ASSERT_TRUE(notification_id.length() > 0);
}
- // Update the existing notification.
+ // Update the existing notifications.
{
- scoped_refptr<extensions::NotificationUpdateFunction>
+ scoped_refptr<extensions::NotificationsUpdateFunction>
notification_function(
- new extensions::NotificationUpdateFunction());
+ new extensions::NotificationsUpdateFunction());
notification_function->set_extension(empty_extension.get());
notification_function->set_has_callback(true);
@@ -97,17 +98,17 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
ASSERT_TRUE(copy_bool_value);
// TODO(miket): add a testing method to query the message from the
- // displayed notification, and assert it matches the updated message.
+ // displayed notifications, and assert it matches the updated message.
//
// TODO(miket): add a method to count the number of outstanding
// notifications, and confirm it remains at one at this point.
}
- // Update a nonexistent notification.
+ // Update a nonexistent notifications.
{
- scoped_refptr<extensions::NotificationUpdateFunction>
+ scoped_refptr<extensions::NotificationsUpdateFunction>
notification_function(
- new extensions::NotificationUpdateFunction());
+ new extensions::NotificationsUpdateFunction());
notification_function->set_extension(empty_extension.get());
notification_function->set_has_callback(true);
@@ -129,11 +130,11 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
ASSERT_FALSE(copy_bool_value);
}
- // Clear a nonexistent notification.
+ // Clear a nonexistent notifications.
{
- scoped_refptr<extensions::NotificationClearFunction>
+ scoped_refptr<extensions::NotificationsClearFunction>
notification_function(
- new extensions::NotificationClearFunction());
+ new extensions::NotificationsClearFunction());
notification_function->set_extension(empty_extension.get());
notification_function->set_has_callback(true);
@@ -148,11 +149,11 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
ASSERT_FALSE(copy_bool_value);
}
- // Clear the notification we created.
+ // Clear the notifications we created.
{
- scoped_refptr<extensions::NotificationClearFunction>
+ scoped_refptr<extensions::NotificationsClearFunction>
notification_function(
- new extensions::NotificationClearFunction());
+ new extensions::NotificationsClearFunction());
notification_function->set_extension(empty_extension.get());
notification_function->set_has_callback(true);
@@ -168,10 +169,10 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestIdUsage) {
}
}
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestBaseFormatNotification) {
- scoped_refptr<extensions::NotificationCreateFunction>
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestBaseFormatNotification) {
+ scoped_refptr<extensions::NotificationsCreateFunction>
notification_create_function(
- new extensions::NotificationCreateFunction());
+ new extensions::NotificationsCreateFunction());
scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
notification_create_function->set_extension(empty_extension.get());
@@ -207,10 +208,10 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestBaseFormatNotification) {
ASSERT_TRUE(notification_id.length() > 0);
}
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestMultipleItemNotification) {
- scoped_refptr<extensions::NotificationCreateFunction>
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestMultipleItemNotification) {
+ scoped_refptr<extensions::NotificationsCreateFunction>
notification_create_function(
- new extensions::NotificationCreateFunction());
+ new extensions::NotificationsCreateFunction());
scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
notification_create_function->set_extension(empty_extension.get());
@@ -223,7 +224,7 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestMultipleItemNotification) {
"\"templateType\": \"list\","
"\"iconUrl\": \"an/image/that/does/not/exist.png\","
"\"title\": \"Multiple Item Notification Title\","
- "\"message\": \"Multiple item notification message.\","
+ "\"message\": \"Multiple item notifications message.\","
dharcourt 2013/03/04 23:46:27 Nit: Should be "Multiple item notification message
"\"items\": ["
" {\"title\": \"Brett Boe\","
" \"message\": \"This is an important message!\"},"
@@ -248,23 +249,23 @@ IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestMultipleItemNotification) {
ASSERT_TRUE(notification_id.length() > 0);
}
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestEvents) {
- ASSERT_TRUE(RunExtensionTest("notification/api/events")) << message_;
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestEvents) {
+ ASSERT_TRUE(RunExtensionTest("notifications/api/events")) << message_;
}
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestCSP) {
- ASSERT_TRUE(RunExtensionTest("notification/api/csp")) << message_;
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestCSP) {
+ ASSERT_TRUE(RunExtensionTest("notifications/api/csp")) << message_;
}
#ifdef ENABLE_MESSAGE_CENTER
#if !defined(OS_WIN) || !defined(USE_ASH)
-IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestByUser) {
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) {
if (!message_center::IsRichNotificationEnabled())
return;
const extensions::Extension* extension =
- LoadExtensionAndWait("notification/api/by_user");
+ LoadExtensionAndWait("notifications/api/by_user");
ASSERT_TRUE(extension) << message_;
{

Powered by Google App Engine
This is Rietveld 408576698