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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_browsertest.cc

Issue 2733393003: Split browsing data masks between content and embedder (Closed)
Patch Set: Rebase (merged automatically) Created 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/barrier_closure.h" 11 #include "base/barrier_closure.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/run_loop.h" 16 #include "base/run_loop.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/test/histogram_tester.h" 18 #include "base/test/histogram_tester.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/browsing_data/browsing_data_helper.h" 21 #include "chrome/browser/browsing_data/browsing_data_helper.h"
22 #include "chrome/browser/browsing_data/browsing_data_remover.h" 22 #include "chrome/browser/browsing_data/browsing_data_remover.h"
23 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" 23 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
24 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" 24 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
25 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 26 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
26 #include "chrome/browser/engagement/site_engagement_score.h" 27 #include "chrome/browser/engagement/site_engagement_score.h"
27 #include "chrome/browser/engagement/site_engagement_service.h" 28 #include "chrome/browser/engagement/site_engagement_service.h"
28 #include "chrome/browser/gcm/fake_gcm_profile_service.h" 29 #include "chrome/browser/gcm/fake_gcm_profile_service.h"
29 #include "chrome/browser/gcm/gcm_profile_service_factory.h" 30 #include "chrome/browser/gcm/gcm_profile_service_factory.h"
30 #include "chrome/browser/lifetime/keep_alive_registry.h" 31 #include "chrome/browser/lifetime/keep_alive_registry.h"
31 #include "chrome/browser/lifetime/keep_alive_types.h" 32 #include "chrome/browser/lifetime/keep_alive_types.h"
32 #include "chrome/browser/notifications/message_center_display_service.h" 33 #include "chrome/browser/notifications/message_center_display_service.h"
33 #include "chrome/browser/notifications/notification_test_util.h" 34 #include "chrome/browser/notifications/notification_test_util.h"
34 #include "chrome/browser/notifications/platform_notification_service_impl.h" 35 #include "chrome/browser/notifications/platform_notification_service_impl.h"
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 IN_PROC_BROWSER_TEST_F( 2061 IN_PROC_BROWSER_TEST_F(
2061 PushMessagingBrowserTest, 2062 PushMessagingBrowserTest,
2062 ResetPushPermissionAfterClearingSiteDataUnderLegacyConditions) { 2063 ResetPushPermissionAfterClearingSiteDataUnderLegacyConditions) {
2063 std::string app_id; 2064 std::string app_id;
2064 ASSERT_NO_FATAL_FAILURE(SetupOrphanedPushSubscription(&app_id)); 2065 ASSERT_NO_FATAL_FAILURE(SetupOrphanedPushSubscription(&app_id));
2065 2066
2066 // Simulate a user clearing site data (including Service Workers, crucially). 2067 // Simulate a user clearing site data (including Service Workers, crucially).
2067 BrowsingDataRemover* remover = 2068 BrowsingDataRemover* remover =
2068 BrowsingDataRemoverFactory::GetForBrowserContext(GetBrowser()->profile()); 2069 BrowsingDataRemoverFactory::GetForBrowserContext(GetBrowser()->profile());
2069 BrowsingDataRemoverCompletionObserver observer(remover); 2070 BrowsingDataRemoverCompletionObserver observer(remover);
2070 remover->RemoveAndReply(base::Time(), base::Time::Max(), 2071 remover->RemoveAndReply(
2071 BrowsingDataRemover::REMOVE_SITE_DATA, 2072 base::Time(), base::Time::Max(),
2072 BrowsingDataHelper::UNPROTECTED_WEB, &observer); 2073 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA,
2074 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, &observer);
2073 observer.BlockUntilCompletion(); 2075 observer.BlockUntilCompletion();
2074 2076
2075 base::RunLoop run_loop; 2077 base::RunLoop run_loop;
2076 push_service()->SetContentSettingChangedCallbackForTesting( 2078 push_service()->SetContentSettingChangedCallbackForTesting(
2077 run_loop.QuitClosure()); 2079 run_loop.QuitClosure());
2078 // This shouldn't (asynchronously) cause a DCHECK. 2080 // This shouldn't (asynchronously) cause a DCHECK.
2079 // TODO(johnme): Get this test running on Android with legacy GCM 2081 // TODO(johnme): Get this test running on Android with legacy GCM
2080 // registrations, which have a different codepath due to sender_id being 2082 // registrations, which have a different codepath due to sender_id being
2081 // required for unsubscribing there. 2083 // required for unsubscribing there.
2082 HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile()) 2084 HostContentSettingsMapFactory::GetForProfile(GetBrowser()->profile())
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 push_service()->SetUnsubscribeCallbackForTesting(run_loop.QuitClosure()); 2247 push_service()->SetUnsubscribeCallbackForTesting(run_loop.QuitClosure());
2246 ASSERT_TRUE(RunScript("unsubscribePush()", &script_result)); 2248 ASSERT_TRUE(RunScript("unsubscribePush()", &script_result));
2247 EXPECT_EQ("unsubscribe result: true", script_result); 2249 EXPECT_EQ("unsubscribe result: true", script_result);
2248 // Background mode is only guaranteed to have updated once the unsubscribe 2250 // Background mode is only guaranteed to have updated once the unsubscribe
2249 // callback for testing has been run (PushSubscription.unsubscribe() usually 2251 // callback for testing has been run (PushSubscription.unsubscribe() usually
2250 // resolves before that, in order to avoid blocking on network retries etc). 2252 // resolves before that, in order to avoid blocking on network retries etc).
2251 run_loop.Run(); 2253 run_loop.Run();
2252 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive()); 2254 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive());
2253 } 2255 }
2254 #endif // BUILDFLAG(ENABLE_BACKGROUND) && !defined(OS_CHROMEOS) 2256 #endif // BUILDFLAG(ENABLE_BACKGROUND) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profiles_state.cc ('k') | chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698