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

Unified Diff: trunk/src/chrome/browser/extensions/api/notification_provider/notification_provider_apitest.cc

Issue 447543003: Revert 287692 "Add a browser test for functions in notification ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | trunk/src/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/extensions/api/notification_provider/notification_provider_apitest.cc
===================================================================
--- trunk/src/chrome/browser/extensions/api/notification_provider/notification_provider_apitest.cc (revision 287721)
+++ trunk/src/chrome/browser/extensions/api/notification_provider/notification_provider_apitest.cc (working copy)
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/api/notification_provider/notification_provider_api.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/extensions/extension_apitest.h"
@@ -10,27 +11,16 @@
typedef ExtensionApiTest NotificationProviderApiTest;
-namespace {
-
-void CreateNotificationOptionsForTest(
- extensions::api::notifications::NotificationOptions* options) {
- options->type = extensions::api::notifications::ParseTemplateType("basic");
- options->icon_url = scoped_ptr<std::string>(new std::string("icon.png"));
- options->title = scoped_ptr<std::string>(new std::string("Title"));
- options->message =
- scoped_ptr<std::string>(new std::string("Here goes the message"));
- return;
-}
-
-} // namespace
-
IN_PROC_BROWSER_TEST_F(NotificationProviderApiTest, Events) {
std::string sender_id1 = "SenderId1";
std::string notification_id1 = "NotificationId1";
- scoped_ptr<extensions::api::notifications::NotificationOptions> options(
- new extensions::api::notifications::NotificationOptions());
- CreateNotificationOptionsForTest(options.get());
+ extensions::api::notifications::NotificationOptions options;
+ options.type = extensions::api::notifications::ParseTemplateType("basic");
+ options.icon_url = scoped_ptr<std::string>(new std::string("icon.png"));
+ options.title = scoped_ptr<std::string>(new std::string("Title"));
+ options.message =
+ scoped_ptr<std::string>(new std::string("Here goes the message"));
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
@@ -44,37 +34,11 @@
new extensions::NotificationProviderEventRouter(browser()->profile()));
event_router->CreateNotification(
- extension->id(), sender_id1, notification_id1, *options.get());
+ extension->id(), sender_id1, notification_id1, options);
event_router->UpdateNotification(
- extension->id(), sender_id1, notification_id1, *options.release());
+ extension->id(), sender_id1, notification_id1, options);
event_router->ClearNotification(
extension->id(), sender_id1, notification_id1);
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}
-
-IN_PROC_BROWSER_TEST_F(NotificationProviderApiTest, TestBasicUsage) {
- // set up content of a notification
- std::string sender_id1 = "SenderId";
- std::string notification_id1 = "NotificationId";
-
- scoped_ptr<extensions::api::notifications::NotificationOptions> options(
- new extensions::api::notifications::NotificationOptions());
- CreateNotificationOptionsForTest(options.get());
-
- ResultCatcher catcher;
- catcher.RestrictToProfile(browser()->profile());
-
- // Test notification provider extension
- const extensions::Extension* extension = LoadExtension(
- test_data_dir_.AppendASCII("notification_provider/basic_usage"));
- ASSERT_TRUE(extension);
-
- scoped_ptr<extensions::NotificationProviderEventRouter> event_router(
- new extensions::NotificationProviderEventRouter(browser()->profile()));
-
- event_router->CreateNotification(
- extension->id(), sender_id1, notification_id1, *options.release());
-
- EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
-}
« no previous file with comments | « no previous file | trunk/src/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698