OLD | NEW |
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 return true; | 356 return true; |
357 } | 357 } |
358 return false; | 358 return false; |
359 } | 359 } |
360 | 360 |
361 void NotificationsTest::DropOriginPreference(const GURL& origin) { | 361 void NotificationsTest::DropOriginPreference(const GURL& origin) { |
362 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), | 362 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), |
363 ContentSettingsPattern::FromURLNoWildcard(origin)); | 363 ContentSettingsPattern::FromURLNoWildcard(origin)); |
364 } | 364 } |
365 | 365 |
366 // If this flakes, use http://crbug.com/62311 and http://crbug.com/74428. | 366 // Flaky on Windows, Mac, Linux: http://crbug.com/437414. |
367 // Flaky on Windows: http://crbug.com/437414. | 367 IN_PROC_BROWSER_TEST_F(NotificationsTest, DISABLED_TestUserGestureInfobar) { |
368 #if defined(OS_WIN) | |
369 #define MAYBE_TestUserGestureInfobar DISABLED_TestUserGestureInfobar | |
370 #else | |
371 #define MAYBE_TestUserGestureInfobar TestUserGestureInfobar | |
372 #endif | |
373 | |
374 IN_PROC_BROWSER_TEST_F(NotificationsTest, MAYBE_TestUserGestureInfobar) { | |
375 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 368 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
376 | 369 |
377 ui_test_utils::NavigateToURL( | 370 ui_test_utils::NavigateToURL( |
378 browser(), | 371 browser(), |
379 embedded_test_server()->GetURL( | 372 embedded_test_server()->GetURL( |
380 "/notifications/notifications_request_function.html")); | 373 "/notifications/notifications_request_function.html")); |
381 | 374 |
382 // Request permission by calling request() while eval'ing an inline script; | 375 // Request permission by calling request() while eval'ing an inline script; |
383 // That's considered a user gesture to webkit, and should produce an infobar. | 376 // That's considered a user gesture to webkit, and should produce an infobar. |
384 bool result; | 377 bool result; |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 true); // by_user | 914 true); // by_user |
922 | 915 |
923 ASSERT_EQ(0, GetNotificationCount()); | 916 ASSERT_EQ(0, GetNotificationCount()); |
924 | 917 |
925 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did | 918 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did |
926 // crash. Work around this timing issue by creating another notification, | 919 // crash. Work around this timing issue by creating another notification, |
927 // which requires interaction with the renderer process. | 920 // which requires interaction with the renderer process. |
928 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); | 921 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); |
929 EXPECT_NE("-1", result); | 922 EXPECT_NE("-1", result); |
930 } | 923 } |
OLD | NEW |