Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc

Issue 2903011: Fix valgrind failure in notifications tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/notifications/desktop_notifications_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos/notifications/desktop_notifications_unittest.h " 5 #include "chrome/browser/chromeos/notifications/desktop_notifications_unittest.h "
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 // static 9 // static
10 std::string DesktopNotificationsTest::log_output_; 10 std::string DesktopNotificationsTest::log_output_;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 ViewHostMsg_ShowNotification_Params 98 ViewHostMsg_ShowNotification_Params
99 DesktopNotificationsTest::StandardTestNotification() { 99 DesktopNotificationsTest::StandardTestNotification() {
100 ViewHostMsg_ShowNotification_Params params; 100 ViewHostMsg_ShowNotification_Params params;
101 params.notification_id = 0; 101 params.notification_id = 0;
102 params.origin = GURL("http://www.google.com"); 102 params.origin = GURL("http://www.google.com");
103 params.is_html = false; 103 params.is_html = false;
104 params.icon_url = GURL("/icon.png"); 104 params.icon_url = GURL("/icon.png");
105 params.title = ASCIIToUTF16("Title"); 105 params.title = ASCIIToUTF16("Title");
106 params.body = ASCIIToUTF16("Text"); 106 params.body = ASCIIToUTF16("Text");
107 params.direction = WebKit::WebTextDirectionDefault;
107 return params; 108 return params;
108 } 109 }
109 110
110 TEST_F(DesktopNotificationsTest, TestShow) { 111 TEST_F(DesktopNotificationsTest, TestShow) {
111 ViewHostMsg_ShowNotification_Params params = StandardTestNotification(); 112 ViewHostMsg_ShowNotification_Params params = StandardTestNotification();
112 params.notification_id = 1; 113 params.notification_id = 1;
113 EXPECT_TRUE(service_->ShowDesktopNotification( 114 EXPECT_TRUE(service_->ShowDesktopNotification(
114 params, 0, 0, DesktopNotificationService::PageNotification)); 115 params, 0, 0, DesktopNotificationService::PageNotification));
115 116
116 MessageLoopForUI::current()->RunAllPending(); 117 MessageLoopForUI::current()->RunAllPending();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 264
264 MessageLoopForUI::current()->RunAllPending(); 265 MessageLoopForUI::current()->RunAllPending();
265 EXPECT_EQ(1, balloon_collection_->count()); 266 EXPECT_EQ(1, balloon_collection_->count());
266 Balloon* balloon = (*balloon_collection_->balloons().begin()); 267 Balloon* balloon = (*balloon_collection_->balloons().begin());
267 GURL data_url = balloon->notification().content_url(); 268 GURL data_url = balloon->notification().content_url();
268 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>")); 269 EXPECT_EQ(std::string::npos, data_url.spec().find("<script>"));
269 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>")); 270 EXPECT_EQ(std::string::npos, data_url.spec().find("<i>"));
270 } 271 }
271 272
272 } // namespace chromeos 273 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/desktop_notifications_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698