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

Side by Side Diff: net/http/http_server_properties_manager_unittest.cc

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment 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
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_stream_factory_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/http/http_server_properties_manager.h" 5 #include "net/http/http_server_properties_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 virtual ~TestingHttpServerPropertiesManager() {} 39 virtual ~TestingHttpServerPropertiesManager() {}
40 40
41 // Make these methods public for testing. 41 // Make these methods public for testing.
42 using HttpServerPropertiesManager::ScheduleUpdateCacheOnPrefThread; 42 using HttpServerPropertiesManager::ScheduleUpdateCacheOnPrefThread;
43 using HttpServerPropertiesManager::ScheduleUpdatePrefsOnNetworkThread; 43 using HttpServerPropertiesManager::ScheduleUpdatePrefsOnNetworkThread;
44 44
45 // Post tasks without a delay during tests. 45 // Post tasks without a delay during tests.
46 virtual void StartPrefsUpdateTimerOnNetworkThread( 46 virtual void StartPrefsUpdateTimerOnNetworkThread(
47 base::TimeDelta delay) OVERRIDE { 47 base::TimeDelta delay) override {
48 HttpServerPropertiesManager::StartPrefsUpdateTimerOnNetworkThread( 48 HttpServerPropertiesManager::StartPrefsUpdateTimerOnNetworkThread(
49 base::TimeDelta()); 49 base::TimeDelta());
50 } 50 }
51 51
52 void UpdateCacheFromPrefsOnUIConcrete() { 52 void UpdateCacheFromPrefsOnUIConcrete() {
53 HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread(); 53 HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread();
54 } 54 }
55 55
56 // Post tasks without a delay during tests. 56 // Post tasks without a delay during tests.
57 virtual void StartCacheUpdateTimerOnPrefThread( 57 virtual void StartCacheUpdateTimerOnPrefThread(
58 base::TimeDelta delay) OVERRIDE { 58 base::TimeDelta delay) override {
59 HttpServerPropertiesManager::StartCacheUpdateTimerOnPrefThread( 59 HttpServerPropertiesManager::StartCacheUpdateTimerOnPrefThread(
60 base::TimeDelta()); 60 base::TimeDelta());
61 } 61 }
62 62
63 void UpdatePrefsFromCacheOnNetworkThreadConcrete( 63 void UpdatePrefsFromCacheOnNetworkThreadConcrete(
64 const base::Closure& callback) { 64 const base::Closure& callback) {
65 HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread(callback); 65 HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread(callback);
66 } 66 }
67 67
68 MOCK_METHOD0(UpdateCacheFromPrefsOnPrefThread, void()); 68 MOCK_METHOD0(UpdateCacheFromPrefsOnPrefThread, void());
(...skipping 12 matching lines...) Expand all
81 net::SupportsQuicMap* supports_quic_map)); 81 net::SupportsQuicMap* supports_quic_map));
82 82
83 private: 83 private:
84 DISALLOW_COPY_AND_ASSIGN(TestingHttpServerPropertiesManager); 84 DISALLOW_COPY_AND_ASSIGN(TestingHttpServerPropertiesManager);
85 }; 85 };
86 86
87 class HttpServerPropertiesManagerTest : public testing::Test { 87 class HttpServerPropertiesManagerTest : public testing::Test {
88 protected: 88 protected:
89 HttpServerPropertiesManagerTest() {} 89 HttpServerPropertiesManagerTest() {}
90 90
91 virtual void SetUp() OVERRIDE { 91 virtual void SetUp() override {
92 pref_service_.registry()->RegisterDictionaryPref(kTestHttpServerProperties); 92 pref_service_.registry()->RegisterDictionaryPref(kTestHttpServerProperties);
93 http_server_props_manager_.reset( 93 http_server_props_manager_.reset(
94 new StrictMock<TestingHttpServerPropertiesManager>( 94 new StrictMock<TestingHttpServerPropertiesManager>(
95 &pref_service_, 95 &pref_service_,
96 kTestHttpServerProperties, 96 kTestHttpServerProperties,
97 base::MessageLoop::current()->message_loop_proxy())); 97 base::MessageLoop::current()->message_loop_proxy()));
98 ExpectCacheUpdate(); 98 ExpectCacheUpdate();
99 base::RunLoop().RunUntilIdle(); 99 base::RunLoop().RunUntilIdle();
100 } 100 }
101 101
102 virtual void TearDown() OVERRIDE { 102 virtual void TearDown() override {
103 if (http_server_props_manager_.get()) 103 if (http_server_props_manager_.get())
104 http_server_props_manager_->ShutdownOnPrefThread(); 104 http_server_props_manager_->ShutdownOnPrefThread();
105 base::RunLoop().RunUntilIdle(); 105 base::RunLoop().RunUntilIdle();
106 http_server_props_manager_.reset(); 106 http_server_props_manager_.reset();
107 } 107 }
108 108
109 void ExpectCacheUpdate() { 109 void ExpectCacheUpdate() {
110 EXPECT_CALL(*http_server_props_manager_, UpdateCacheFromPrefsOnPrefThread()) 110 EXPECT_CALL(*http_server_props_manager_, UpdateCacheFromPrefsOnPrefThread())
111 .WillOnce(Invoke(http_server_props_manager_.get(), 111 .WillOnce(Invoke(http_server_props_manager_.get(),
112 &TestingHttpServerPropertiesManager:: 112 &TestingHttpServerPropertiesManager::
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // Run the task after shutdown, but before deletion. 529 // Run the task after shutdown, but before deletion.
530 base::RunLoop().RunUntilIdle(); 530 base::RunLoop().RunUntilIdle();
531 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 531 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
532 http_server_props_manager_.reset(); 532 http_server_props_manager_.reset();
533 base::RunLoop().RunUntilIdle(); 533 base::RunLoop().RunUntilIdle();
534 } 534 }
535 535
536 } // namespace 536 } // namespace
537 537
538 } // namespace net 538 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_stream_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698