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

Side by Side Diff: net/ssl/ssl_config_service_unittest.cc

Issue 200693006: Remove --enable-unrestricted-ssl3-fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/ssl/ssl_config_service.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl/ssl_config_service.h" 5 #include "net/ssl/ssl_config_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(0); 62 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(0);
63 mock_service->SetSSLConfig(initial_config); 63 mock_service->SetSSLConfig(initial_config);
64 64
65 mock_service->RemoveObserver(&observer); 65 mock_service->RemoveObserver(&observer);
66 } 66 }
67 67
68 TEST(SSLConfigServiceTest, ConfigUpdatesNotifyObservers) { 68 TEST(SSLConfigServiceTest, ConfigUpdatesNotifyObservers) {
69 SSLConfig initial_config; 69 SSLConfig initial_config;
70 initial_config.rev_checking_enabled = true; 70 initial_config.rev_checking_enabled = true;
71 initial_config.false_start_enabled = false; 71 initial_config.false_start_enabled = false;
72 initial_config.unrestricted_ssl3_fallback_enabled = false;
73 initial_config.version_min = SSL_PROTOCOL_VERSION_SSL3; 72 initial_config.version_min = SSL_PROTOCOL_VERSION_SSL3;
74 initial_config.version_max = SSL_PROTOCOL_VERSION_TLS1_1; 73 initial_config.version_max = SSL_PROTOCOL_VERSION_TLS1_1;
75 74
76 scoped_refptr<MockSSLConfigService> mock_service( 75 scoped_refptr<MockSSLConfigService> mock_service(
77 new MockSSLConfigService(initial_config)); 76 new MockSSLConfigService(initial_config));
78 MockSSLConfigServiceObserver observer; 77 MockSSLConfigServiceObserver observer;
79 mock_service->AddObserver(&observer); 78 mock_service->AddObserver(&observer);
80 79
81 // Test that the basic boolean preferences trigger updates. 80 // Test that the basic boolean preferences trigger updates.
82 initial_config.rev_checking_enabled = false; 81 initial_config.rev_checking_enabled = false;
83 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 82 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
84 mock_service->SetSSLConfig(initial_config); 83 mock_service->SetSSLConfig(initial_config);
85 84
86 initial_config.false_start_enabled = true; 85 initial_config.false_start_enabled = true;
87 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 86 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
88 mock_service->SetSSLConfig(initial_config); 87 mock_service->SetSSLConfig(initial_config);
89 88
90 initial_config.unrestricted_ssl3_fallback_enabled = true;
91 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
92 mock_service->SetSSLConfig(initial_config);
93
94 // Test that changing the SSL version range triggers updates. 89 // Test that changing the SSL version range triggers updates.
95 initial_config.version_min = SSL_PROTOCOL_VERSION_TLS1; 90 initial_config.version_min = SSL_PROTOCOL_VERSION_TLS1;
96 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 91 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
97 mock_service->SetSSLConfig(initial_config); 92 mock_service->SetSSLConfig(initial_config);
98 93
99 initial_config.version_max = SSL_PROTOCOL_VERSION_SSL3; 94 initial_config.version_max = SSL_PROTOCOL_VERSION_SSL3;
100 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 95 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
101 mock_service->SetSSLConfig(initial_config); 96 mock_service->SetSSLConfig(initial_config);
102 97
103 // Test that disabling certain cipher suites triggers an update. 98 // Test that disabling certain cipher suites triggers an update.
(...skipping 16 matching lines...) Expand all
120 // cipher suites disabled, triggers an update. 115 // cipher suites disabled, triggers an update.
121 disabled_ciphers.pop_back(); 116 disabled_ciphers.pop_back();
122 initial_config.disabled_cipher_suites = disabled_ciphers; 117 initial_config.disabled_cipher_suites = disabled_ciphers;
123 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 118 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
124 mock_service->SetSSLConfig(initial_config); 119 mock_service->SetSSLConfig(initial_config);
125 120
126 mock_service->RemoveObserver(&observer); 121 mock_service->RemoveObserver(&observer);
127 } 122 }
128 123
129 } // namespace net 124 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_config_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698