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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_browsertest.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 RequestAndAcceptPermission(); 280 RequestAndAcceptPermission();
281 281
282 // Creates a simple notification. 282 // Creates a simple notification.
283 std::string script_result; 283 std::string script_result;
284 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result)); 284 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result));
285 285
286 net::HostPortPair host_port = ServerHostPort(); 286 net::HostPortPair host_port = ServerHostPort();
287 287
288 const Notification& notification = ui_manager()->GetNotificationAt(0); 288 const Notification& notification = ui_manager()->GetNotificationAt(0);
289 289
290 EXPECT_EQ(base::UTF8ToUTF16(host_port.ToString()), 290 EXPECT_TRUE(notification.context_message().empty());
291 notification.context_message()); 291 EXPECT_EQ("https://" + host_port.ToString() + "/",
292 notification.origin_url().spec());
292 } 293 }
293 294
294 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, 295 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
295 CheckFilePermissionNotGranted) { 296 CheckFilePermissionNotGranted) {
296 // TODO(felt): This DCHECKs when bubbles are enabled, when the file_url is 297 // TODO(felt): This DCHECKs when bubbles are enabled, when the file_url is
297 // persisted. crbug.com/502057 298 // persisted. crbug.com/502057
298 if (PermissionBubbleManager::Enabled()) 299 if (PermissionBubbleManager::Enabled())
299 return; 300 return;
300 301
301 // TODO(dewittj): It currently isn't possible to get the notification 302 // TODO(dewittj): It currently isn't possible to get the notification
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 372
372 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); 373 ASSERT_EQ(1u, ui_manager()->GetNotificationCount());
373 374
374 const Notification& notification = ui_manager()->GetNotificationAt(0); 375 const Notification& notification = ui_manager()->GetNotificationAt(0);
375 EXPECT_FALSE(notification.icon().IsEmpty()); 376 EXPECT_FALSE(notification.icon().IsEmpty());
376 377
377 EXPECT_EQ("Blob Title", base::UTF16ToUTF8(notification.title())); 378 EXPECT_EQ("Blob Title", base::UTF16ToUTF8(notification.title()));
378 EXPECT_EQ(kIconWidth, notification.icon().Width()); 379 EXPECT_EQ(kIconWidth, notification.icon().Width());
379 EXPECT_EQ(kIconHeight, notification.icon().Height()); 380 EXPECT_EQ(kIconHeight, notification.icon().Height());
380 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698