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

Side by Side Diff: chrome/browser/extensions/api/notification/notification_apitest.cc

Issue 11116016: Hook up API to notification_ui_manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asargent review suggestion Created 8 years, 2 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 "chrome/browser/extensions/api/notification/notification_api.h" 5 #include "chrome/browser/extensions/api/notification/notification_api.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_function_test_utils.h" 7 #include "chrome/browser/extensions/extension_function_test_utils.h"
8 8
9 using extensions::Extension; 9 using extensions::Extension;
10 10
11 namespace utils = extension_function_test_utils; 11 namespace utils = extension_function_test_utils;
12 12
13 namespace { 13 namespace {
14 14
15 class NotificationApiTest : public PlatformAppApiTest { 15 class NotificationApiTest : public PlatformAppApiTest {
16 }; 16 };
17 17
18 } // namespace 18 } // namespace
19 19
20 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNothing) { 20 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNormalNotification) {
21 scoped_refptr<extensions::NotificationShowFunction> 21 scoped_refptr<extensions::NotificationShowFunction>
22 notification_show_function(new extensions::NotificationShowFunction()); 22 notification_show_function(new extensions::NotificationShowFunction());
23 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); 23 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
24 24
25 notification_show_function->set_extension(empty_extension.get()); 25 notification_show_function->set_extension(empty_extension.get());
26 notification_show_function->set_has_callback(true); 26 notification_show_function->set_has_callback(true);
27 27
28 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 28 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
29 notification_show_function, 29 notification_show_function,
30 "[{\"text\": \"Check out Cirque du Soleil\"}]", 30 "[{"
31 "\"iconUrl\": \"http://www.google.com/intl/en/chrome/assets/"
32 "common/images/chrome_logo_2x.png\","
33 "\"title\": \"Attention!\","
34 "\"message\": \"Check out Cirque du Soleil\","
35 "\"replaceId\": \"12345678\""
36 "}]",
31 browser(), utils::NONE)); 37 browser(), utils::NONE));
32 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType()); 38
39 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
33 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698