| 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 | 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 } |
| OLD | NEW |