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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 "\"expandedMessage\": \"This is a longer expanded message.\"," | 77 "\"expandedMessage\": \"This is a longer expanded message.\"," |
78 "\"imageUrl\": \"http://www.google.com/logos/2012/election12-hp.jpg\"," | 78 "\"imageUrl\": \"http://www.google.com/logos/2012/election12-hp.jpg\"," |
79 "\"replaceId\": \"12345678\"" | 79 "\"replaceId\": \"12345678\"" |
80 "}]", | 80 "}]", |
81 browser(), utils::NONE)); | 81 browser(), utils::NONE)); |
82 | 82 |
83 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); | 83 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); |
84 | 84 |
85 // TODO(miket): confirm that the show succeeded. | 85 // TODO(miket): confirm that the show succeeded. |
86 } | 86 } |
| 87 |
| 88 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestMultipleItemNotification) { |
| 89 scoped_refptr<extensions::NotificationShowFunction> |
| 90 notification_show_function(new extensions::NotificationShowFunction()); |
| 91 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); |
| 92 |
| 93 notification_show_function->set_extension(empty_extension.get()); |
| 94 notification_show_function->set_has_callback(true); |
| 95 |
| 96 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
| 97 notification_show_function, |
| 98 "[{" |
| 99 "\"notificationType\": \"multiple\"," |
| 100 "\"iconUrl\": \"https://code.google.com/p/chromium/logo\"," |
| 101 "\"title\": \"Multiple Item Notification Title\"," |
| 102 "\"message\": \"Multiple item notification message.\"," |
| 103 "\"priority\": 1," |
| 104 "\"timestamp\": \"Fri, 16 Nov 2012 01:17:15 GMT\"," |
| 105 "\"replaceId\": \"12345678\"" |
| 106 "}]", |
| 107 browser(), utils::NONE)); |
| 108 // TODO(dharcourt): [...], items = [{title: foo, message: bar}, ...], [...] |
| 109 |
| 110 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); |
| 111 |
| 112 // TODO(dharcourt): confirm that the show succeeded. |
| 113 } |
OLD | NEW |