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

Unified Diff: components/ssl_config/ssl_config_service_manager_pref_unittest.cc

Issue 2056343006: Remove DHE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment 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 side-by-side diff with in-line comments
Download patch
Index: components/ssl_config/ssl_config_service_manager_pref_unittest.cc
diff --git a/components/ssl_config/ssl_config_service_manager_pref_unittest.cc b/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
index 07aaef88f48dbed2b72f3e8318ce3ea3400e32f3..b17d4c5da55945e9c2de5e53030622bce733240c 100644
--- a/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
+++ b/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
@@ -5,6 +5,7 @@
#include <memory>
#include <utility>
+#include "base/feature_list.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -197,3 +198,26 @@ TEST_F(SSLConfigServiceManagerPrefTest, NoTLS1Fallback) {
// The command-line option must not have been honored.
EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min);
}
+
+// Tests that DHE may be re-enabled via features.
+TEST_F(SSLConfigServiceManagerPrefTest, DHEFeature) {
+ // Toggle the feature.
+ base::FeatureList::ClearInstanceForTesting();
Ryan Sleevi 2016/06/15 01:23:25 Doesn't the end of this test leave DHE enabled? Wh
davidben 2016/06/15 19:21:20 The whole point of this test is to make sure the F
davidben 2016/06/15 19:49:18 I started trying to put this together, but there's
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine("DHECiphers", std::string());
+ base::FeatureList::SetInstance(std::move(feature_list));
+
+ TestingPrefServiceSimple local_state;
+ SSLConfigServiceManager::RegisterPrefs(local_state.registry());
+
+ std::unique_ptr<SSLConfigServiceManager> config_manager(
+ SSLConfigServiceManager::CreateDefaultManager(
+ &local_state, base::ThreadTaskRunnerHandle::Get()));
+ scoped_refptr<SSLConfigService> config_service(config_manager->Get());
+ ASSERT_TRUE(config_service.get());
+
+ // The feature should have switched the default version_fallback_min value.
+ SSLConfig ssl_config;
+ config_service->GetSSLConfig(&ssl_config);
+ EXPECT_TRUE(ssl_config.dhe_enabled);
+}

Powered by Google App Engine
This is Rietveld 408576698