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

Unified Diff: chrome/browser/notifications/notification_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_browsertest.cc
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc
index a0eabf48ceb6f2e07860de3e5592f2d9ad0e96a2..eccbfad034600802dd0f40b7b8aa189767ef9e49 100644
--- a/chrome/browser/notifications/notification_browsertest.cc
+++ b/chrome/browser/notifications/notification_browsertest.cc
@@ -392,7 +392,7 @@ void NotificationsTest::DropOriginPreference(const GURL& origin) {
// Flaky on Windows, Mac, Linux: http://crbug.com/437414.
IN_PROC_BROWSER_TEST_F(NotificationsTest, DISABLED_TestUserGestureInfobar) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
ui_test_utils::NavigateToURL(
browser(),
@@ -413,7 +413,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, DISABLED_TestUserGestureInfobar) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateSimpleNotification) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Creates a simple notification.
AllowAllOrigins();
@@ -451,7 +451,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, NotificationBlockerTest) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseNotification) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Creates a notification and closes it.
AllowAllOrigins();
@@ -471,7 +471,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseNotification) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCancelNotification) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Creates a notification and cancels it in the origin page.
AllowAllOrigins();
@@ -487,7 +487,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCancelNotification) {
// Requests notification privileges and verifies the prompt appears.
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestPermissionRequestUIAppears) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
EXPECT_TRUE(RequestPermissionAndWait(browser()));
@@ -495,7 +495,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestPermissionRequestUIAppears) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowOnPermissionRequestUI) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Tries to create a notification & clicks 'allow' on the prompt.
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -510,7 +510,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowOnPermissionRequestUI) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyOnPermissionRequestUI) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test that no notification is created when Deny is chosen from prompt.
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -523,7 +523,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyOnPermissionRequestUI) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestClosePermissionRequestUI) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test that no notification is created when prompt is dismissed.
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -536,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestClosePermissionRequestUI) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowNotificationsFromAllSites) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that all domains can be allowed to show notifications.
SetDefaultContentSetting(CONTENT_SETTING_ALLOW);
@@ -549,7 +549,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowNotificationsFromAllSites) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyNotificationsFromAllSites) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that no domain can show notifications.
SetDefaultContentSetting(CONTENT_SETTING_BLOCK);
@@ -562,7 +562,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyNotificationsFromAllSites) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyDomainAndAllowAll) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that denying a domain and allowing all shouldn't show
// notifications from the denied domain.
@@ -578,7 +578,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyDomainAndAllowAll) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowDomainAndDenyAll) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that allowing a domain and denying all others should show
// notifications from the allowed domain.
@@ -594,7 +594,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowDomainAndDenyAll) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyAndThenAllowDomain) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that denying and again allowing should show notifications.
DenyOrigin(GetTestPageURL().GetOrigin());
@@ -614,7 +614,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyAndThenAllowDomain) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateDenyCloseNotifications) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify able to create, deny, and close the notification.
AllowAllOrigins();
@@ -640,7 +640,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateDenyCloseNotifications) {
IN_PROC_BROWSER_TEST_F(
NotificationsTest,
DISABLED_TestOriginPrefsNotSavedInIncognito) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Verify that allow/deny origin preferences are not saved in incognito.
Browser* incognito = CreateIncognitoBrowser();
@@ -667,7 +667,7 @@ IN_PROC_BROWSER_TEST_F(
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestIncognitoNotification) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test notifications in incognito window.
Browser* browser = CreateIncognitoBrowser();
@@ -679,7 +679,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestIncognitoNotification) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseTabWithPermissionRequestUI) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test that user can close tab when bubble present.
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -702,7 +702,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCloseTabWithPermissionRequestUI) {
IN_PROC_BROWSER_TEST_F(NotificationsTest,
MAYBE_TestCrashRendererNotificationRemain) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test crashing renderer does not close or crash notification.
AllowAllOrigins();
@@ -720,7 +720,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest,
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationReplacement) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test that we can replace a notification using the replaceId.
AllowAllOrigins();
@@ -746,7 +746,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationReplacement) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestLastUsage) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
HostContentSettingsMap* settings_map =
HostContentSettingsMapFactory::GetForProfile(browser()->profile());
@@ -781,7 +781,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestLastUsage) {
IN_PROC_BROWSER_TEST_F(NotificationsTest,
TestNotificationReplacementReappearance) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
// Test that we can replace a notification using the tag, and that it will
// cause the notification to reappear as a popup again.
@@ -816,7 +816,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest,
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationValidIcon) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
AllowAllOrigins();
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -837,7 +837,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationValidIcon) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationInvalidIcon) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
AllowAllOrigins();
ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
@@ -868,7 +868,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationInvalidIcon) {
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationDoubleClose) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(embedded_test_server()->Start());
AllowAllOrigins();
ui_test_utils::NavigateToURL(
« no previous file with comments | « chrome/browser/media/media_browsertest.cc ('k') | chrome/browser/notifications/platform_notification_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698