| 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 | 9 |
| 10 // static | 10 // static |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 BalloonCollectionImpl::OnBalloonClosed(source); | 50 BalloonCollectionImpl::OnBalloonClosed(source); |
| 51 break; | 51 break; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 int MockBalloonCollection::UppermostVerticalPosition() { | 56 int MockBalloonCollection::UppermostVerticalPosition() { |
| 57 int min = 0; | 57 int min = 0; |
| 58 std::deque<Balloon*>::iterator iter; | 58 std::deque<Balloon*>::iterator iter; |
| 59 for (iter = balloons_.begin(); iter != balloons_.end(); ++iter) { | 59 for (iter = balloons_.begin(); iter != balloons_.end(); ++iter) { |
| 60 int pos = (*iter)->position().y(); | 60 int pos = (*iter)->GetPosition().y(); |
| 61 if (iter == balloons_.begin() || pos < min) | 61 if (iter == balloons_.begin() || pos < min) |
| 62 min = pos; | 62 min = pos; |
| 63 } | 63 } |
| 64 return min; | 64 return min; |
| 65 } | 65 } |
| 66 | 66 |
| 67 DesktopNotificationsTest::DesktopNotificationsTest() | 67 DesktopNotificationsTest::DesktopNotificationsTest() |
| 68 : ui_thread_(ChromeThread::UI, &message_loop_) { | 68 : ui_thread_(ChromeThread::UI, &message_loop_) { |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 MessageLoopForUI::current()->RunAllPending(); | 287 MessageLoopForUI::current()->RunAllPending(); |
| 288 EXPECT_EQ(1, balloon_collection_->count()); | 288 EXPECT_EQ(1, balloon_collection_->count()); |
| 289 Balloon* balloon = (*balloon_collection_->balloons().begin()); | 289 Balloon* balloon = (*balloon_collection_->balloons().begin()); |
| 290 GURL data_url = balloon->notification().content_url(); | 290 GURL data_url = balloon->notification().content_url(); |
| 291 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); | 291 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); |
| 292 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); | 292 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); |
| 293 // URL-encoded versions of tags should also not be found. | 293 // URL-encoded versions of tags should also not be found. |
| 294 EXPECT_EQ(std::string::npos, data_url.spec().find("%3cscript%3e")); | 294 EXPECT_EQ(std::string::npos, data_url.spec().find("%3cscript%3e")); |
| 295 EXPECT_EQ(std::string::npos, data_url.spec().find("%3ci%3e")); | 295 EXPECT_EQ(std::string::npos, data_url.spec().find("%3ci%3e")); |
| 296 } | 296 } |
| OLD | NEW |