Commit c5abe245 authored by Shivani Sharma's avatar Shivani Sharma Committed by Commit Bot

Net unittests fix for append frame origin by default

This CL fixes net unittests so that they work if append frame origin
is enabled by default.

Bug: 1026388
Change-Id: Ia307269236e7e58184f4394502eed4e29c0e2246
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930945
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718365}
parent 93f1c757
...@@ -10275,7 +10275,8 @@ TEST_F(HttpCacheTest, SplitCache) { ...@@ -10275,7 +10275,8 @@ TEST_F(HttpCacheTest, SplitCache) {
// Now request with a.com as the top frame origin. It shouldn't be cached // Now request with a.com as the top frame origin. It shouldn't be cached
// since the cached resource has a different top frame origin. // since the cached resource has a different top frame origin.
trans_info.network_isolation_key = NetworkIsolationKey(origin_a, origin_a); net::NetworkIsolationKey key_a(origin_a, origin_a);
trans_info.network_isolation_key = key_a;
RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction, RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
trans_info, &response); trans_info, &response);
EXPECT_FALSE(response.was_cached); EXPECT_FALSE(response.was_cached);
...@@ -10301,7 +10302,7 @@ TEST_F(HttpCacheTest, SplitCache) { ...@@ -10301,7 +10302,7 @@ TEST_F(HttpCacheTest, SplitCache) {
EXPECT_TRUE(response.was_cached); EXPECT_TRUE(response.was_cached);
// a.com should still be cached. // a.com should still be cached.
trans_info.network_isolation_key = NetworkIsolationKey(origin_a, origin_b); trans_info.network_isolation_key = key_a;
RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction, RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
trans_info, &response); trans_info, &response);
EXPECT_TRUE(response.was_cached); EXPECT_TRUE(response.was_cached);
......
...@@ -2273,6 +2273,10 @@ TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc3) { ...@@ -2273,6 +2273,10 @@ TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc3) {
TEST_F(AlternateProtocolServerPropertiesTest, TEST_F(AlternateProtocolServerPropertiesTest,
GetAlternativeServiceInfoAsValue) { GetAlternativeServiceInfoAsValue) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(
features::kAppendFrameOriginToNetworkIsolationKey);
base::Time::Exploded now_exploded; base::Time::Exploded now_exploded;
now_exploded.year = 2018; now_exploded.year = 2018;
now_exploded.month = 1; now_exploded.month = 1;
......
...@@ -95,8 +95,9 @@ TEST(ClientSocketPool, GroupIdOperators) { ...@@ -95,8 +95,9 @@ TEST(ClientSocketPool, GroupIdOperators) {
TEST(ClientSocketPool, GroupIdToString) { TEST(ClientSocketPool, GroupIdToString) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature( feature_list.InitWithFeatures(
features::kPartitionConnectionsByNetworkIsolationKey); {features::kPartitionConnectionsByNetworkIsolationKey},
{features::kAppendFrameOriginToNetworkIsolationKey});
EXPECT_EQ("foo:80 <null>", EXPECT_EQ("foo:80 <null>",
ClientSocketPool::GroupId( ClientSocketPool::GroupId(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment