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

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

Issue 1694923004: Use GURLs instead of patterns in SetContentSetting in notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: remove patterns_ Created 4 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <deque> 5 #include <deque>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 ContentSettingsPattern::FromURLNoWildcard(origin); 380 ContentSettingsPattern::FromURLNoWildcard(origin);
381 for (ContentSettingsForOneType::const_iterator it = settings.begin(); 381 for (ContentSettingsForOneType::const_iterator it = settings.begin();
382 it != settings.end(); ++it) { 382 it != settings.end(); ++it) {
383 if (it->primary_pattern == pattern) 383 if (it->primary_pattern == pattern)
384 return true; 384 return true;
385 } 385 }
386 return false; 386 return false;
387 } 387 }
388 388
389 void NotificationsTest::DropOriginPreference(const GURL& origin) { 389 void NotificationsTest::DropOriginPreference(const GURL& origin) {
390 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), 390 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin);
391 ContentSettingsPattern::FromURLNoWildcard(origin));
392 } 391 }
393 392
394 // Flaky on Windows, Mac, Linux: http://crbug.com/437414. 393 // Flaky on Windows, Mac, Linux: http://crbug.com/437414.
395 IN_PROC_BROWSER_TEST_F(NotificationsTest, DISABLED_TestUserGestureInfobar) { 394 IN_PROC_BROWSER_TEST_F(NotificationsTest, DISABLED_TestUserGestureInfobar) {
396 ASSERT_TRUE(embedded_test_server()->Start()); 395 ASSERT_TRUE(embedded_test_server()->Start());
397 396
398 ui_test_utils::NavigateToURL( 397 ui_test_utils::NavigateToURL(
399 browser(), 398 browser(),
400 embedded_test_server()->GetURL( 399 embedded_test_server()->GetURL(
401 "/notifications/notifications_request_function.html")); 400 "/notifications/notifications_request_function.html"));
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 true); // by_user 875 true); // by_user
877 876
878 ASSERT_EQ(0, GetNotificationCount()); 877 ASSERT_EQ(0, GetNotificationCount());
879 878
880 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did 879 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did
881 // crash. Work around this timing issue by creating another notification, 880 // crash. Work around this timing issue by creating another notification,
882 // which requires interaction with the renderer process. 881 // which requires interaction with the renderer process.
883 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); 882 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat");
884 EXPECT_NE("-1", result); 883 EXPECT_NE("-1", result);
885 } 884 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698