OLD | NEW |
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 "chrome/browser/net/http_server_properties_manager.h" | 5 #include "chrome/browser/net/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 19 matching lines...) Expand all Loading... |
30 explicit TestingHttpServerPropertiesManager(PrefService* pref_service) | 30 explicit TestingHttpServerPropertiesManager(PrefService* pref_service) |
31 : HttpServerPropertiesManager(pref_service) { | 31 : HttpServerPropertiesManager(pref_service) { |
32 InitializeOnIOThread(); | 32 InitializeOnIOThread(); |
33 } | 33 } |
34 | 34 |
35 virtual ~TestingHttpServerPropertiesManager() { | 35 virtual ~TestingHttpServerPropertiesManager() { |
36 } | 36 } |
37 | 37 |
38 // Make these methods public for testing. | 38 // Make these methods public for testing. |
39 using HttpServerPropertiesManager::ScheduleUpdateCacheOnUI; | 39 using HttpServerPropertiesManager::ScheduleUpdateCacheOnUI; |
40 using HttpServerPropertiesManager::ScheduleUpdatePrefsOnIO; | 40 //using HttpServerPropertiesManager::ScheduleUpdatePrefsOnIO; |
41 | 41 |
| 42 /* |
42 // Post tasks without a delay during tests. | 43 // Post tasks without a delay during tests. |
43 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay) OVERRIDE { | 44 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay) OVERRIDE { |
44 HttpServerPropertiesManager::StartPrefsUpdateTimerOnIO( | 45 HttpServerPropertiesManager::StartPrefsUpdateTimerOnIO( |
45 base::TimeDelta()); | 46 base::TimeDelta()); |
46 } | 47 } |
| 48 */ |
47 | 49 |
48 void UpdateCacheFromPrefsOnUIConcrete() { | 50 void UpdateCacheFromPrefsOnUIConcrete() { |
49 HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI(); | 51 HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI(); |
50 } | 52 } |
51 | 53 |
52 // Post tasks without a delay during tests. | 54 // Post tasks without a delay during tests. |
53 virtual void StartCacheUpdateTimerOnUI(base::TimeDelta delay) OVERRIDE { | 55 virtual void StartCacheUpdateTimerOnUI(base::TimeDelta delay) OVERRIDE { |
54 HttpServerPropertiesManager::StartCacheUpdateTimerOnUI( | 56 HttpServerPropertiesManager::StartCacheUpdateTimerOnUI( |
55 base::TimeDelta()); | 57 base::TimeDelta()); |
56 } | 58 } |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // Run the task after shutdown, but before deletion. | 478 // Run the task after shutdown, but before deletion. |
477 loop_.RunUntilIdle(); | 479 loop_.RunUntilIdle(); |
478 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 480 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
479 http_server_props_manager_.reset(); | 481 http_server_props_manager_.reset(); |
480 loop_.RunUntilIdle(); | 482 loop_.RunUntilIdle(); |
481 } | 483 } |
482 | 484 |
483 } // namespace | 485 } // namespace |
484 | 486 |
485 } // namespace chrome_browser_net | 487 } // namespace chrome_browser_net |
OLD | NEW |