OLD | NEW |
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 "net/sdch/sdch_owner.h" | 5 #include "net/sdch/sdch_owner.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 URLRequestJob* MaybeInterceptResponse( | 202 URLRequestJob* MaybeInterceptResponse( |
203 URLRequest* request, | 203 URLRequest* request, |
204 NetworkDelegate* network_delegate) const override { | 204 NetworkDelegate* network_delegate) const override { |
205 return nullptr; | 205 return nullptr; |
206 } | 206 } |
207 | 207 |
208 bool IsHandledProtocol(const std::string& scheme) const override { | 208 bool IsHandledProtocol(const std::string& scheme) const override { |
209 return scheme == "http"; | 209 return scheme == "http"; |
210 }; | 210 }; |
211 | 211 |
212 bool IsHandledURL(const GURL& url) const override { | |
213 return url.SchemeIs("http"); | |
214 } | |
215 | |
216 bool IsSafeRedirectTarget(const GURL& location) const override { | 212 bool IsSafeRedirectTarget(const GURL& location) const override { |
217 return false; | 213 return false; |
218 } | 214 } |
219 }; | 215 }; |
220 | 216 |
221 class MockSdchDictionaryFetcher : public SdchDictionaryFetcher { | 217 class MockSdchDictionaryFetcher : public SdchDictionaryFetcher { |
222 public: | 218 public: |
223 MockSdchDictionaryFetcher() : SdchDictionaryFetcher(&test_context_) {} | 219 MockSdchDictionaryFetcher() : SdchDictionaryFetcher(&test_context_) {} |
224 ~MockSdchDictionaryFetcher() {} | 220 ~MockSdchDictionaryFetcher() {} |
225 | 221 |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1007 |
1012 EXPECT_TRUE(CompleteLoadFromURL(url0, "0", true)); | 1008 EXPECT_TRUE(CompleteLoadFromURL(url0, "0", true)); |
1013 EXPECT_TRUE(CompleteLoadFromURL(url1, "1", false)); | 1009 EXPECT_TRUE(CompleteLoadFromURL(url1, "1", false)); |
1014 | 1010 |
1015 tester.ExpectTotalCount("Sdch3.NetworkBytesSpent", 1); | 1011 tester.ExpectTotalCount("Sdch3.NetworkBytesSpent", 1); |
1016 tester.ExpectUniqueSample("Sdch3.NetworkBytesSpent", | 1012 tester.ExpectUniqueSample("Sdch3.NetworkBytesSpent", |
1017 CreateDictionary(url1, "1").size(), 1); | 1013 CreateDictionary(url1, "1").size(), 1); |
1018 } | 1014 } |
1019 | 1015 |
1020 } // namespace net | 1016 } // namespace net |
OLD | NEW |