| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/notifications/NotificationData.h" | 5 #include "modules/notifications/NotificationData.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "core/testing/NullExecutionContext.h" | 8 #include "core/testing/NullExecutionContext.h" |
| 9 #include "modules/notifications/Notification.h" | 9 #include "modules/notifications/Notification.h" |
| 10 #include "modules/notifications/NotificationOptions.h" | 10 #include "modules/notifications/NotificationOptions.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 for (const String& direction : mappings.keys()) { | 262 for (const String& direction : mappings.keys()) { |
| 263 NotificationOptions options; | 263 NotificationOptions options; |
| 264 options.setDir(direction); | 264 options.setDir(direction); |
| 265 | 265 |
| 266 DummyExceptionStateForTesting exceptionState; | 266 DummyExceptionStateForTesting exceptionState; |
| 267 WebNotificationData notificationData = createWebNotificationData( | 267 WebNotificationData notificationData = createWebNotificationData( |
| 268 getExecutionContext(), kNotificationTitle, options, exceptionState); | 268 getExecutionContext(), kNotificationTitle, options, exceptionState); |
| 269 ASSERT_FALSE(exceptionState.hadException()); | 269 ASSERT_FALSE(exceptionState.hadException()); |
| 270 | 270 |
| 271 EXPECT_EQ(mappings.get(direction), notificationData.direction); | 271 EXPECT_EQ(mappings.at(direction), notificationData.direction); |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 TEST_F(NotificationDataTest, MaximumActionCount) { | 275 TEST_F(NotificationDataTest, MaximumActionCount) { |
| 276 HeapVector<NotificationAction> actions; | 276 HeapVector<NotificationAction> actions; |
| 277 for (size_t i = 0; i < Notification::maxActions() + 2; ++i) { | 277 for (size_t i = 0; i < Notification::maxActions() + 2; ++i) { |
| 278 NotificationAction action; | 278 NotificationAction action; |
| 279 action.setAction(String::number(i)); | 279 action.setAction(String::number(i)); |
| 280 action.setTitle(kNotificationActionTitle); | 280 action.setTitle(kNotificationActionTitle); |
| 281 | 281 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 294 ASSERT_EQ(Notification::maxActions(), notificationData.actions.size()); | 294 ASSERT_EQ(Notification::maxActions(), notificationData.actions.size()); |
| 295 | 295 |
| 296 for (size_t i = 0; i < Notification::maxActions(); ++i) { | 296 for (size_t i = 0; i < Notification::maxActions(); ++i) { |
| 297 WebString expectedAction = String::number(i); | 297 WebString expectedAction = String::number(i); |
| 298 EXPECT_EQ(expectedAction, notificationData.actions[i].action); | 298 EXPECT_EQ(expectedAction, notificationData.actions[i].action); |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace | 302 } // namespace |
| 303 } // namespace blink | 303 } // namespace blink |
| OLD | NEW |