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

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

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 namespace { 15 namespace {
16 16
17 class MockSSLConfigService : public SSLConfigService { 17 class MockSSLConfigService : public SSLConfigService {
18 public: 18 public:
19 explicit MockSSLConfigService(const SSLConfig& config) : config_(config) {} 19 explicit MockSSLConfigService(const SSLConfig& config) : config_(config) {}
20 20
21 // SSLConfigService implementation 21 // SSLConfigService implementation
22 virtual void GetSSLConfig(SSLConfig* config) override { 22 void GetSSLConfig(SSLConfig* config) override { *config = config_; }
23 *config = config_;
24 }
25 23
26 // Sets the SSLConfig to be returned by GetSSLConfig and processes any 24 // Sets the SSLConfig to be returned by GetSSLConfig and processes any
27 // updates. 25 // updates.
28 void SetSSLConfig(const SSLConfig& config) { 26 void SetSSLConfig(const SSLConfig& config) {
29 SSLConfig old_config = config_; 27 SSLConfig old_config = config_;
30 config_ = config; 28 config_ = config;
31 ProcessConfigUpdate(old_config, config_); 29 ProcessConfigUpdate(old_config, config_);
32 } 30 }
33 31
34 private: 32 private:
35 virtual ~MockSSLConfigService() {} 33 ~MockSSLConfigService() override {}
36 34
37 SSLConfig config_; 35 SSLConfig config_;
38 }; 36 };
39 37
40 class MockSSLConfigServiceObserver : public SSLConfigService::Observer { 38 class MockSSLConfigServiceObserver : public SSLConfigService::Observer {
41 public: 39 public:
42 MockSSLConfigServiceObserver() {} 40 MockSSLConfigServiceObserver() {}
43 virtual ~MockSSLConfigServiceObserver() {} 41 virtual ~MockSSLConfigServiceObserver() {}
44 42
45 MOCK_METHOD0(OnSSLConfigChanged, void()); 43 MOCK_METHOD0(OnSSLConfigChanged, void());
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // cipher suites disabled, triggers an update. 113 // cipher suites disabled, triggers an update.
116 disabled_ciphers.pop_back(); 114 disabled_ciphers.pop_back();
117 initial_config.disabled_cipher_suites = disabled_ciphers; 115 initial_config.disabled_cipher_suites = disabled_ciphers;
118 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1); 116 EXPECT_CALL(observer, OnSSLConfigChanged()).Times(1);
119 mock_service->SetSSLConfig(initial_config); 117 mock_service->SetSSLConfig(initial_config);
120 118
121 mock_service->RemoveObserver(&observer); 119 mock_service->RemoveObserver(&observer);
122 } 120 }
123 121
124 } // namespace net 122 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_config_service_defaults.h ('k') | net/test/embedded_test_server/embedded_test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698