OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/notifications/desktop_notifications_unittest.h
" | 5 #include "chrome/browser/chromeos/notifications/desktop_notifications_unittest.h
" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/prefs/browser_prefs.h" | 9 #include "chrome/browser/prefs/browser_prefs.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
11 #include "content/common/desktop_notification_messages.h" | 11 #include "content/common/desktop_notification_messages.h" |
12 | 12 |
| 13 using content::BrowserThread; |
| 14 |
13 namespace chromeos { | 15 namespace chromeos { |
14 | 16 |
15 // static | 17 // static |
16 std::string DesktopNotificationsTest::log_output_; | 18 std::string DesktopNotificationsTest::log_output_; |
17 | 19 |
18 class MockNotificationUI : public BalloonCollectionImpl::NotificationUI { | 20 class MockNotificationUI : public BalloonCollectionImpl::NotificationUI { |
19 public: | 21 public: |
20 virtual void Add(Balloon* balloon) {} | 22 virtual void Add(Balloon* balloon) {} |
21 virtual bool Update(Balloon* balloon) { return false; } | 23 virtual bool Update(Balloon* balloon) { return false; } |
22 virtual void Remove(Balloon* balloon) {} | 24 virtual void Remove(Balloon* balloon) {} |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 265 |
264 MessageLoopForUI::current()->RunAllPending(); | 266 MessageLoopForUI::current()->RunAllPending(); |
265 EXPECT_EQ(1, balloon_collection_->count()); | 267 EXPECT_EQ(1, balloon_collection_->count()); |
266 Balloon* balloon = (*balloon_collection_->balloons().begin()); | 268 Balloon* balloon = (*balloon_collection_->balloons().begin()); |
267 GURL data_url = balloon->notification().content_url(); | 269 GURL data_url = balloon->notification().content_url(); |
268 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); | 270 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); |
269 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); | 271 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); |
270 } | 272 } |
271 | 273 |
272 } // namespace chromeos | 274 } // namespace chromeos |
OLD | NEW |