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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 ui_test_utils::NavigateToURL(incognito, GetTestPageURL()); | 661 ui_test_utils::NavigateToURL(incognito, GetTestPageURL()); |
662 ASSERT_TRUE(RequestPermissionAndWait(incognito)); | 662 ASSERT_TRUE(RequestPermissionAndWait(incognito)); |
663 | 663 |
664 ContentSettingsForOneType settings; | 664 ContentSettingsForOneType settings; |
665 GetPrefsByContentSetting(CONTENT_SETTING_BLOCK, &settings); | 665 GetPrefsByContentSetting(CONTENT_SETTING_BLOCK, &settings); |
666 EXPECT_EQ(0U, settings.size()); | 666 EXPECT_EQ(0U, settings.size()); |
667 GetPrefsByContentSetting(CONTENT_SETTING_ALLOW, &settings); | 667 GetPrefsByContentSetting(CONTENT_SETTING_ALLOW, &settings); |
668 EXPECT_EQ(0U, settings.size()); | 668 EXPECT_EQ(0U, settings.size()); |
669 } | 669 } |
670 | 670 |
671 IN_PROC_BROWSER_TEST_F(NotificationsTest, TestIncognitoNotification) { | |
672 ASSERT_TRUE(embedded_test_server()->Start()); | |
673 | |
674 // Test notifications in incognito window. | |
675 Browser* browser = CreateIncognitoBrowser(); | |
676 ui_test_utils::NavigateToURL(browser, GetTestPageURL()); | |
677 browser->tab_strip_model()->ActivateTabAt(0, true); | |
678 ASSERT_TRUE(RequestAndAcceptPermission(browser)); | |
679 CreateSimpleNotification(browser, true); | |
680 ASSERT_EQ(1, GetNotificationCount()); | |
681 } | |
682 | |
683 IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseTabWithPermissionRequestUI) { | 671 IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseTabWithPermissionRequestUI) { |
684 ASSERT_TRUE(embedded_test_server()->Start()); | 672 ASSERT_TRUE(embedded_test_server()->Start()); |
685 | 673 |
686 // Test that user can close tab when bubble present. | 674 // Test that user can close tab when bubble present. |
687 ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); | 675 ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); |
688 EXPECT_TRUE(RequestPermissionAndWait(browser())); | 676 EXPECT_TRUE(RequestPermissionAndWait(browser())); |
689 content::WebContentsDestroyedWatcher destroyed_watcher( | 677 content::WebContentsDestroyedWatcher destroyed_watcher( |
690 browser()->tab_strip_model()->GetWebContentsAt(0)); | 678 browser()->tab_strip_model()->GetWebContentsAt(0)); |
691 browser()->tab_strip_model()->CloseWebContentsAt(0, | 679 browser()->tab_strip_model()->CloseWebContentsAt(0, |
692 TabStripModel::CLOSE_NONE); | 680 TabStripModel::CLOSE_NONE); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 true); // by_user | 877 true); // by_user |
890 | 878 |
891 ASSERT_EQ(0, GetNotificationCount()); | 879 ASSERT_EQ(0, GetNotificationCount()); |
892 | 880 |
893 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did | 881 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did |
894 // crash. Work around this timing issue by creating another notification, | 882 // crash. Work around this timing issue by creating another notification, |
895 // which requires interaction with the renderer process. | 883 // which requires interaction with the renderer process. |
896 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); | 884 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); |
897 EXPECT_NE("-1", result); | 885 EXPECT_NE("-1", result); |
898 } | 886 } |
OLD | NEW |