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

Side by Side Diff: chrome/browser/net/chrome_network_delegate_unittest.cc

Issue 1615773005: Rename first-party-only cookies to same-site cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests. Created 4 years, 11 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 (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 "chrome/browser/net/chrome_network_delegate.h" 5 #include "chrome/browser/net/chrome_network_delegate.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 "DataUse.TrafficSize.User.Upstream.Foreground.NotCellular", 2); 280 "DataUse.TrafficSize.User.Upstream.Foreground.NotCellular", 2);
281 histogram_tester.ExpectTotalCount( 281 histogram_tester.ExpectTotalCount(
282 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0); 282 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0);
283 histogram_tester.ExpectTotalCount( 283 histogram_tester.ExpectTotalCount(
284 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0); 284 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0);
285 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0); 285 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0);
286 } 286 }
287 287
288 #endif 288 #endif
289 289
290 TEST_F(ChromeNetworkDelegateTest, DisableFirstPartyOnlyCookiesIffFlagDisabled) { 290 TEST_F(ChromeNetworkDelegateTest, DisableSameSiteCookiesIffFlagDisabled) {
291 Initialize(); 291 Initialize();
292 EXPECT_FALSE(network_delegate()->AreExperimentalCookieFeaturesEnabled()); 292 EXPECT_FALSE(network_delegate()->AreExperimentalCookieFeaturesEnabled());
293 } 293 }
294 294
295 TEST_F(ChromeNetworkDelegateTest, EnableFirstPartyOnlyCookiesIffFlagEnabled) { 295 TEST_F(ChromeNetworkDelegateTest, EnableSameSiteCookiesIffFlagEnabled) {
296 base::CommandLine::ForCurrentProcess()->AppendSwitch( 296 base::CommandLine::ForCurrentProcess()->AppendSwitch(
297 switches::kEnableExperimentalWebPlatformFeatures); 297 switches::kEnableExperimentalWebPlatformFeatures);
298 Initialize(); 298 Initialize();
299 EXPECT_TRUE(network_delegate()->AreExperimentalCookieFeaturesEnabled()); 299 EXPECT_TRUE(network_delegate()->AreExperimentalCookieFeaturesEnabled());
300 } 300 }
301 301
302 TEST_F(ChromeNetworkDelegateTest, ReportDataUseToAggregator) { 302 TEST_F(ChromeNetworkDelegateTest, ReportDataUseToAggregator) {
303 FakeDataUseAggregator fake_aggregator; 303 FakeDataUseAggregator fake_aggregator;
304 Initialize(); 304 Initialize();
305 305
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 kBlockedFirstPartySite)); 537 kBlockedFirstPartySite));
538 538
539 cookie_settings_->SetCookieSetting( 539 cookie_settings_->SetCookieSetting(
540 ContentSettingsPattern::FromURL(kBlockedFirstPartySite), 540 ContentSettingsPattern::FromURL(kBlockedFirstPartySite),
541 ContentSettingsPattern::Wildcard(), 541 ContentSettingsPattern::Wildcard(),
542 CONTENT_SETTING_BLOCK); 542 CONTENT_SETTING_BLOCK);
543 // Privacy mode is disabled as kAllowedSite is still getting cookies 543 // Privacy mode is disabled as kAllowedSite is still getting cookies
544 EXPECT_FALSE(network_delegate_->CanEnablePrivacyMode(kAllowedSite, 544 EXPECT_FALSE(network_delegate_->CanEnablePrivacyMode(kAllowedSite,
545 kBlockedFirstPartySite)); 545 kBlockedFirstPartySite));
546 } 546 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/cookies_tree_model.cc ('k') | ios/net/cookies/cookie_store_ios_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698