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 <limits.h> | 5 #include <limits.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 : sdch_manager_(new SdchManager), | 27 : sdch_manager_(new SdchManager), |
28 default_support_(false), | 28 default_support_(false), |
29 default_https_support_(false) { | 29 default_https_support_(false) { |
30 default_support_ = sdch_manager_->sdch_enabled(); | 30 default_support_ = sdch_manager_->sdch_enabled(); |
31 default_https_support_ = sdch_manager_->secure_scheme_supported(); | 31 default_https_support_ = sdch_manager_->secure_scheme_supported(); |
32 } | 32 } |
33 | 33 |
34 SdchManager* sdch_manager() { return sdch_manager_.get(); } | 34 SdchManager* sdch_manager() { return sdch_manager_.get(); } |
35 | 35 |
36 // Reset globals back to default state. | 36 // Reset globals back to default state. |
37 virtual void TearDown() { | 37 void TearDown() override { |
38 SdchManager::EnableSdchSupport(default_support_); | 38 SdchManager::EnableSdchSupport(default_support_); |
39 SdchManager::EnableSecureSchemeSupport(default_https_support_); | 39 SdchManager::EnableSecureSchemeSupport(default_https_support_); |
40 } | 40 } |
41 | 41 |
42 // Attempt to add a dictionary to the manager and probe for success or | 42 // Attempt to add a dictionary to the manager and probe for success or |
43 // failure. | 43 // failure. |
44 bool AddSdchDictionary(const std::string& dictionary_text, | 44 bool AddSdchDictionary(const std::string& dictionary_text, |
45 const GURL& gurl) { | 45 const GURL& gurl) { |
46 std::string list; | 46 std::string list; |
47 sdch_manager_->GetAvailDictionaryList(gurl, &list); | 47 sdch_manager_->GetAvailDictionaryList(gurl, &list); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 dictionary = NULL; | 563 dictionary = NULL; |
564 sdch_manager()->GetVcdiffDictionary( | 564 sdch_manager()->GetVcdiffDictionary( |
565 server_hash, | 565 server_hash, |
566 GURL("http://" + dictionary_domain + "/random_url"), | 566 GURL("http://" + dictionary_domain + "/random_url"), |
567 &dictionary); | 567 &dictionary); |
568 EXPECT_FALSE(dictionary.get()); | 568 EXPECT_FALSE(dictionary.get()); |
569 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(blacklist_url)); | 569 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(blacklist_url)); |
570 } | 570 } |
571 | 571 |
572 } // namespace net | 572 } // namespace net |
OLD | NEW |