| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/notifications/desktop_notifications_unittest.h" | 5 #include "chrome/browser/notifications/desktop_notifications_unittest.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/common/render_messages_params.h" |
| 9 | 10 |
| 10 // static | 11 // static |
| 11 const int MockBalloonCollection::kMockBalloonSpace = 5; | 12 const int MockBalloonCollection::kMockBalloonSpace = 5; |
| 12 | 13 |
| 13 // static | 14 // static |
| 14 std::string DesktopNotificationsTest::log_output_; | 15 std::string DesktopNotificationsTest::log_output_; |
| 15 | 16 |
| 16 void MockBalloonCollection::Add(const Notification& notification, | 17 void MockBalloonCollection::Add(const Notification& notification, |
| 17 Profile* profile) { | 18 Profile* profile) { |
| 18 // Swap in the logging proxy for the purpose of logging calls that | 19 // Swap in the logging proxy for the purpose of logging calls that |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 MessageLoopForUI::current()->RunAllPending(); | 319 MessageLoopForUI::current()->RunAllPending(); |
| 319 EXPECT_EQ(1, balloon_collection_->count()); | 320 EXPECT_EQ(1, balloon_collection_->count()); |
| 320 Balloon* balloon = (*balloon_collection_->balloons().begin()); | 321 Balloon* balloon = (*balloon_collection_->balloons().begin()); |
| 321 GURL data_url = balloon->notification().content_url(); | 322 GURL data_url = balloon->notification().content_url(); |
| 322 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); | 323 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); |
| 323 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); | 324 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); |
| 324 // URL-encoded versions of tags should also not be found. | 325 // URL-encoded versions of tags should also not be found. |
| 325 EXPECT_EQ(std::string::npos, data_url.spec().find("%3cscript%3e")); | 326 EXPECT_EQ(std::string::npos, data_url.spec().find("%3cscript%3e")); |
| 326 EXPECT_EQ(std::string::npos, data_url.spec().find("%3ci%3e")); | 327 EXPECT_EQ(std::string::npos, data_url.spec().find("%3ci%3e")); |
| 327 } | 328 } |
| OLD | NEW |