| Index: chrome/browser/push_messaging/push_messaging_browsertest.cc
|
| diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc
|
| index cd5b4409920819a6829f7bd93962cce33e2499ba..eca944fa3f2bab2d740ad1c1252467c9cf7d4e51 100644
|
| --- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
|
| +++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
|
| @@ -1153,6 +1153,9 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| message_loop_runner->QuitClosure());
|
|
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_PUSH_MESSAGING);
|
| +
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
|
|
|
| message_loop_runner->Run();
|
| @@ -1184,6 +1187,10 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| GURL origin = https_server()->GetURL("/").GetOrigin();
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->SetContentSettingDefaultScope(origin, origin,
|
| + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
|
| + std::string(), CONTENT_SETTING_DEFAULT);
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->SetContentSettingDefaultScope(origin, origin,
|
| CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| std::string(), CONTENT_SETTING_DEFAULT);
|
|
|
| @@ -1216,7 +1223,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| GURL origin = https_server()->GetURL("/").GetOrigin();
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->SetContentSettingDefaultScope(origin, origin,
|
| - CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
|
| std::string(), CONTENT_SETTING_BLOCK);
|
|
|
| message_loop_runner->Run();
|
| @@ -1336,13 +1343,17 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| scoped_refptr<content::MessageLoopRunner> message_loop_runner =
|
| new content::MessageLoopRunner;
|
| push_service()->SetContentSettingChangedCallbackForTesting(
|
| - base::BarrierClosure(1, message_loop_runner->QuitClosure()));
|
| + base::BarrierClosure(2, message_loop_runner->QuitClosure()));
|
|
|
| GURL origin = https_server()->GetURL("/").GetOrigin();
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->SetContentSettingDefaultScope(origin, GURL(),
|
| CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| std::string(), CONTENT_SETTING_ALLOW);
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->SetContentSettingDefaultScope(origin, origin,
|
| + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
|
| + std::string(), CONTENT_SETTING_ALLOW);
|
|
|
| message_loop_runner->Run();
|
|
|
| @@ -1372,16 +1383,26 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| scoped_refptr<content::MessageLoopRunner> message_loop_runner =
|
| new content::MessageLoopRunner;
|
| push_service()->SetContentSettingChangedCallbackForTesting(
|
| - base::BarrierClosure(2, message_loop_runner->QuitClosure()));
|
| + base::BarrierClosure(4, message_loop_runner->QuitClosure()));
|
|
|
| GURL origin = https_server()->GetURL("/").GetOrigin();
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| CONTENT_SETTING_ALLOW);
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->SetContentSettingCustomScope(
|
| + ContentSettingsPattern::FromString("https://*"),
|
| + ContentSettingsPattern::FromString("https://*"),
|
| + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, std::string(),
|
| + CONTENT_SETTING_ALLOW);
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->SetContentSettingDefaultScope(origin, GURL(),
|
| CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| std::string(), CONTENT_SETTING_DEFAULT);
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->SetContentSettingDefaultScope(origin, origin,
|
| + CONTENT_SETTINGS_TYPE_PUSH_MESSAGING,
|
| + std::string(), CONTENT_SETTING_DEFAULT);
|
|
|
| message_loop_runner->Run();
|
|
|
| @@ -1431,6 +1452,8 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
|
| // codepath due to sender_id being required for unsubscribing there.
|
| HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
|
| + HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
|
| + ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_PUSH_MESSAGING);
|
|
|
| run_loop.Run();
|
|
|
|
|