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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceTest.cpp

Issue 2074003003: CHECK that Resource request/response urls are equalIgnoringFragmentIdentifer, not equal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/fetch/Resource.h" 5 #include "core/fetch/Resource.h"
6 6
7 #include "core/fetch/MemoryCache.h" 7 #include "core/fetch/MemoryCache.h"
8 #include "platform/SharedBuffer.h" 8 #include "platform/SharedBuffer.h"
9 #include "platform/network/ResourceRequest.h" 9 #include "platform/network/ResourceRequest.h"
10 #include "platform/network/ResourceResponse.h" 10 #include "platform/network/ResourceResponse.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 resource->finish(currentTime()); 106 resource->finish(currentTime());
107 resource->prune(); 107 resource->prune();
108 ASSERT_TRUE(resource->isPurgeable()); 108 ASSERT_TRUE(resource->isPurgeable());
109 bool didLock = resource->lock(); 109 bool didLock = resource->lock();
110 ASSERT_FALSE(didLock); 110 ASSERT_FALSE(didLock);
111 EXPECT_EQ(nullptr, resource->resourceBuffer()); 111 EXPECT_EQ(nullptr, resource->resourceBuffer());
112 EXPECT_EQ(size_t(0), resource->encodedSize()); 112 EXPECT_EQ(size_t(0), resource->encodedSize());
113 } 113 }
114 114
115 TEST(ResourceTest, RevalidateWithFragment)
116 {
117 KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html");
118 ResourceResponse response;
119 response.setURL(url);
120 response.setHTTPStatusCode(200);
121 Resource* resource = Resource::create(url, Resource::Raw);
122 resource->responseReceived(response, nullptr);
123 resource->finish();
124
125 // Revalidating with a url that differs by only the fragment
126 // shouldn't trigger a securiy check.
127 url.setFragmentIdentifier("bar");
128 resource->setRevalidatingRequest(ResourceRequest(url));
129 ResourceResponse revalidatingResponse;
130 revalidatingResponse.setURL(url);
131 revalidatingResponse.setHTTPStatusCode(304);
132 resource->responseReceived(revalidatingResponse, nullptr);
133 }
134
115 } // namespace blink 135 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698