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

Unified Diff: chrome/browser/net/http_server_properties_manager_unittest.cc

Issue 11238034: Added completion notification to Profile's ClearNetworkingHistorySince. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed IO/UI typo and rebased. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/http_server_properties_manager_unittest.cc
diff --git a/chrome/browser/net/http_server_properties_manager_unittest.cc b/chrome/browser/net/http_server_properties_manager_unittest.cc
index b60b59ca9c9b5ff96b5c31425a01cd20184f3694..ab4bb319d39264f691006d4cd1b49e670cd44959 100644
--- a/chrome/browser/net/http_server_properties_manager_unittest.cc
+++ b/chrome/browser/net/http_server_properties_manager_unittest.cc
@@ -54,12 +54,12 @@ class TestingHttpServerPropertiesManager : public HttpServerPropertiesManager {
base::TimeDelta());
}
- void UpdatePrefsFromCacheOnIOConcrete() {
- HttpServerPropertiesManager::UpdatePrefsFromCacheOnIO();
+ void UpdatePrefsFromCacheOnIOConcrete(const base::Closure& callback) {
+ HttpServerPropertiesManager::UpdatePrefsFromCacheOnIO(callback);
}
MOCK_METHOD0(UpdateCacheFromPrefsOnUI, void());
- MOCK_METHOD0(UpdatePrefsFromCacheOnIO, void());
+ MOCK_METHOD1(UpdatePrefsFromCacheOnIO, void(const base::Closure&));
MOCK_METHOD5(UpdateCacheFromPrefsOnIO,
void(std::vector<std::string>* spdy_servers,
net::SpdySettingsMap* spdy_settings_map,
@@ -109,7 +109,7 @@ class HttpServerPropertiesManagerTest : public testing::Test {
}
void ExpectPrefsUpdate() {
- EXPECT_CALL(*http_server_props_manager_, UpdatePrefsFromCacheOnIO())
+ EXPECT_CALL(*http_server_props_manager_, UpdatePrefsFromCacheOnIO(_))
.WillOnce(
Invoke(http_server_props_manager_.get(),
&TestingHttpServerPropertiesManager::
@@ -353,11 +353,10 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
ExpectPrefsUpdate();
- // Clear http server data.
- http_server_props_manager_->Clear();
- // Run the task.
- loop_.RunAllPending();
+ // Clear http server data, time out if we do not get a completion callback.
+ http_server_props_manager_->Clear(MessageLoop::QuitClosure());
+ loop_.Run();
EXPECT_FALSE(http_server_props_manager_->SupportsSpdy(spdy_server_mail));
EXPECT_FALSE(
@@ -434,7 +433,7 @@ TEST_F(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdatePrefs1) {
TEST_F(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdatePrefs2) {
// This posts a task to the UI thread.
- http_server_props_manager_->UpdatePrefsFromCacheOnIOConcrete();
+ http_server_props_manager_->UpdatePrefsFromCacheOnIOConcrete(base::Closure());
// Shutdown comes before the task is executed.
http_server_props_manager_->ShutdownOnUIThread();
// Run the task after shutdown, but before deletion.
« no previous file with comments | « chrome/browser/net/http_server_properties_manager.cc ('k') | chrome/browser/profiles/off_the_record_profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698