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 "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 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 | 9 |
10 using extensions::Extension; | 10 using extensions::Extension; |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNormalNotification) { | 26 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNormalNotification) { |
27 scoped_refptr<extensions::NotificationShowFunction> | 27 scoped_refptr<extensions::NotificationShowFunction> |
28 notification_show_function(new extensions::NotificationShowFunction()); | 28 notification_show_function(new extensions::NotificationShowFunction()); |
29 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); | 29 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); |
30 | 30 |
31 notification_show_function->set_extension(empty_extension.get()); | 31 notification_show_function->set_extension(empty_extension.get()); |
32 notification_show_function->set_has_callback(true); | 32 notification_show_function->set_has_callback(true); |
33 | 33 |
34 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 34 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
35 notification_show_function, | 35 notification_show_function.get(), |
36 "[{" | 36 "[{" |
37 "\"iconUrl\": \"http://www.google.com/intl/en/chrome/assets/" | 37 "\"iconUrl\": \"http://www.google.com/intl/en/chrome/assets/" |
38 "common/images/chrome_logo_2x.png\"," | 38 "common/images/chrome_logo_2x.png\"," |
39 "\"title\": \"Attention!\"," | 39 "\"title\": \"Attention!\"," |
40 "\"message\": \"Check out Cirque du Soleil\"," | 40 "\"message\": \"Check out Cirque du Soleil\"," |
41 "\"replaceId\": \"12345678\"" | 41 "\"replaceId\": \"12345678\"" |
42 "}]", | 42 "}]", |
43 browser(), utils::NONE)); | 43 browser(), utils::NONE)); |
44 | 44 |
45 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); | 45 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); |
46 } | 46 } |
OLD | NEW |