| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 notification1_->OnFetchComplete(GURL(kIconUrl1), &bitmap); | 324 notification1_->OnFetchComplete(GURL(kIconUrl1), &bitmap); |
| 325 | 325 |
| 326 // When we call OnFetchComplete on the last bitmap, show should be called. | 326 // When we call OnFetchComplete on the last bitmap, show should be called. |
| 327 notification1_->OnFetchComplete(GURL(kImageUrl1), &bitmap); | 327 notification1_->OnFetchComplete(GURL(kImageUrl1), &bitmap); |
| 328 | 328 |
| 329 notification1_->OnFetchComplete(GURL(kButtonOneIconUrl), &bitmap); | 329 notification1_->OnFetchComplete(GURL(kButtonOneIconUrl), &bitmap); |
| 330 | 330 |
| 331 notification1_->OnFetchComplete(GURL(kButtonTwoIconUrl), &bitmap); | 331 notification1_->OnFetchComplete(GURL(kButtonTwoIconUrl), &bitmap); |
| 332 | 332 |
| 333 // Expect that the app icon has some data in it. |
| 334 EXPECT_FALSE(notification1_->GetAppIcon().IsEmpty()); |
| 335 EXPECT_FALSE(notification_manager()->notification().small_image().IsEmpty()); |
| 336 |
| 333 // Since we check Show() thoroughly in its own test, we only check cursorily. | 337 // Since we check Show() thoroughly in its own test, we only check cursorily. |
| 334 EXPECT_EQ(message_center::NOTIFICATION_TYPE_IMAGE, | 338 EXPECT_EQ(message_center::NOTIFICATION_TYPE_IMAGE, |
| 335 notification_manager()->notification().type()); | 339 notification_manager()->notification().type()); |
| 336 EXPECT_EQ(std::string(kTitle1), | 340 EXPECT_EQ(std::string(kTitle1), |
| 337 base::UTF16ToUTF8(notification_manager()->notification().title())); | 341 base::UTF16ToUTF8(notification_manager()->notification().title())); |
| 338 EXPECT_EQ( | 342 EXPECT_EQ( |
| 339 std::string(kText1), | 343 std::string(kText1), |
| 340 base::UTF16ToUTF8(notification_manager()->notification().message())); | 344 base::UTF16ToUTF8(notification_manager()->notification().message())); |
| 341 | 345 |
| 342 // TODO(petewil): Check that the bitmap in the notification is what we expect. | 346 // TODO(petewil): Check that the bitmap in the notification is what we expect. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 EXPECT_EQ(std::string(kTitle1), | 395 EXPECT_EQ(std::string(kTitle1), |
| 392 base::UTF16ToUTF8(notification_manager()->notification().title())); | 396 base::UTF16ToUTF8(notification_manager()->notification().title())); |
| 393 EXPECT_EQ( | 397 EXPECT_EQ( |
| 394 std::string(kText1), | 398 std::string(kText1), |
| 395 base::UTF16ToUTF8(notification_manager()->notification().message())); | 399 base::UTF16ToUTF8(notification_manager()->notification().message())); |
| 396 } | 400 } |
| 397 | 401 |
| 398 // TODO(petewil): Add a test for a notification being read and or deleted. | 402 // TODO(petewil): Add a test for a notification being read and or deleted. |
| 399 | 403 |
| 400 } // namespace notifier | 404 } // namespace notifier |
| OLD | NEW |