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

Unified Diff: net/base/sdch_manager_unittest.cc

Issue 593863002: Enable SDCH over HTTPS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct test default assumptions. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_manager_unittest.cc
diff --git a/net/base/sdch_manager_unittest.cc b/net/base/sdch_manager_unittest.cc
index 83418adde7dc782bef8702fb9744fcbeb6bd2abd..9f6ec39c24304684cfc2053e5a22e742938debcc 100644
--- a/net/base/sdch_manager_unittest.cc
+++ b/net/base/sdch_manager_unittest.cc
@@ -24,15 +24,19 @@ static const char kTestVcdiffDictionary[] = "DictionaryFor"
class SdchManagerTest : public testing::Test {
protected:
SdchManagerTest()
- : sdch_manager_(new SdchManager) {
+ : sdch_manager_(new SdchManager),
+ default_support_(false),
+ default_https_support_(false) {
+ default_support_ = sdch_manager_->sdch_enabled();
+ default_https_support_ = sdch_manager_->secure_scheme_supported();
}
SdchManager* sdch_manager() { return sdch_manager_.get(); }
// Reset globals back to default state.
virtual void TearDown() {
- SdchManager::EnableSdchSupport(true);
- SdchManager::EnableSecureSchemeSupport(false);
+ SdchManager::EnableSdchSupport(default_support_);
+ SdchManager::EnableSecureSchemeSupport(default_https_support_);
}
// Attempt to add a dictionary to the manager and probe for success or
@@ -51,6 +55,8 @@ class SdchManagerTest : public testing::Test {
private:
scoped_ptr<SdchManager> sdch_manager_;
+ bool default_support_;
+ bool default_https_support_;
};
//------------------------------------------------------------------------------
@@ -192,6 +198,7 @@ TEST_F(SdchManagerTest, CanUseHTTPSDictionaryOverHTTPSIfEnabled) {
std::string dictionary_domain("x.y.z.google.com");
std::string dictionary_text(NewSdchDictionary(dictionary_domain));
+ SdchManager::EnableSecureSchemeSupport(false);
EXPECT_FALSE(AddSdchDictionary(dictionary_text,
GURL("https://" + dictionary_domain)));
SdchManager::EnableSecureSchemeSupport(true);
@@ -467,11 +474,11 @@ TEST_F(SdchManagerTest, HttpsCorrectlySupported) {
GURL secure_url("https://www.google.com");
EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url));
- EXPECT_FALSE(sdch_manager()->IsInSupportedDomain(secure_url));
+ EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(secure_url));
- SdchManager::EnableSecureSchemeSupport(true);
+ SdchManager::EnableSecureSchemeSupport(false);
EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url));
- EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(secure_url));
+ EXPECT_FALSE(sdch_manager()->IsInSupportedDomain(secure_url));
}
TEST_F(SdchManagerTest, ClearDictionaryData) {
@@ -509,4 +516,3 @@ TEST_F(SdchManagerTest, ClearDictionaryData) {
}
} // namespace net
-
« no previous file with comments | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698