| 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.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 class HttpServerPropertiesManagerTest : public testing::Test { | 79 class HttpServerPropertiesManagerTest : public testing::Test { |
| 80 protected: | 80 protected: |
| 81 HttpServerPropertiesManagerTest() | 81 HttpServerPropertiesManagerTest() |
| 82 : ui_thread_(BrowserThread::UI, &loop_), | 82 : ui_thread_(BrowserThread::UI, &loop_), |
| 83 io_thread_(BrowserThread::IO, &loop_) { | 83 io_thread_(BrowserThread::IO, &loop_) { |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void SetUp() OVERRIDE { | 86 virtual void SetUp() OVERRIDE { |
| 87 pref_service_.RegisterDictionaryPref(prefs::kHttpServerProperties); | 87 pref_service_.registrar()->RegisterDictionaryPref( |
| 88 prefs::kHttpServerProperties); |
| 88 http_server_props_manager_.reset( | 89 http_server_props_manager_.reset( |
| 89 new StrictMock<TestingHttpServerPropertiesManager>(&pref_service_)); | 90 new StrictMock<TestingHttpServerPropertiesManager>(&pref_service_)); |
| 90 ExpectCacheUpdate(); | 91 ExpectCacheUpdate(); |
| 91 loop_.RunUntilIdle(); | 92 loop_.RunUntilIdle(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 virtual void TearDown() OVERRIDE { | 95 virtual void TearDown() OVERRIDE { |
| 95 if (http_server_props_manager_.get()) | 96 if (http_server_props_manager_.get()) |
| 96 http_server_props_manager_->ShutdownOnUIThread(); | 97 http_server_props_manager_->ShutdownOnUIThread(); |
| 97 loop_.RunUntilIdle(); | 98 loop_.RunUntilIdle(); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // Run the task after shutdown, but before deletion. | 440 // Run the task after shutdown, but before deletion. |
| 440 loop_.RunUntilIdle(); | 441 loop_.RunUntilIdle(); |
| 441 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 442 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 442 http_server_props_manager_.reset(); | 443 http_server_props_manager_.reset(); |
| 443 loop_.RunUntilIdle(); | 444 loop_.RunUntilIdle(); |
| 444 } | 445 } |
| 445 | 446 |
| 446 } // namespace | 447 } // namespace |
| 447 | 448 |
| 448 } // namespace chrome_browser_net | 449 } // namespace chrome_browser_net |
| OLD | NEW |