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

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

Issue 1159853005: HttpServerProperties - Don't persist if SetSupportsSpdy is called with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@persist_SET_SERVER_NETWORK_STATS
Patch Set: Minor cleanup Created 5 years, 6 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.cc ('k') | no next file » | 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/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 ExpectScheduleUpdatePrefsOnNetworkThread(); 382 ExpectScheduleUpdatePrefsOnNetworkThread();
383 383
384 // Post an update task to the network thread. SetSupportsSpdy calls 384 // Post an update task to the network thread. SetSupportsSpdy calls
385 // ScheduleUpdatePrefsOnNetworkThread. 385 // ScheduleUpdatePrefsOnNetworkThread.
386 386
387 // Add mail.google.com:443 as a supporting spdy server. 387 // Add mail.google.com:443 as a supporting spdy server.
388 HostPortPair spdy_server_mail("mail.google.com", 443); 388 HostPortPair spdy_server_mail("mail.google.com", 443);
389 EXPECT_FALSE( 389 EXPECT_FALSE(
390 http_server_props_manager_->SupportsRequestPriority(spdy_server_mail)); 390 http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
391 http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true); 391 http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
392 // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
393 http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
392 394
393 // Run the task. 395 // Run the task.
394 base::RunLoop().RunUntilIdle(); 396 base::RunLoop().RunUntilIdle();
395 397
396 EXPECT_TRUE( 398 EXPECT_TRUE(
397 http_server_props_manager_->SupportsRequestPriority(spdy_server_mail)); 399 http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
398 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 400 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
399 } 401 }
400 402
401 TEST_F(HttpServerPropertiesManagerTest, SetSpdySetting) { 403 TEST_F(HttpServerPropertiesManagerTest, SetSpdySetting) {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 // Run the task after shutdown, but before deletion. 819 // Run the task after shutdown, but before deletion.
818 base::RunLoop().RunUntilIdle(); 820 base::RunLoop().RunUntilIdle();
819 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 821 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
820 http_server_props_manager_.reset(); 822 http_server_props_manager_.reset();
821 base::RunLoop().RunUntilIdle(); 823 base::RunLoop().RunUntilIdle();
822 } 824 }
823 825
824 } // namespace 826 } // namespace
825 827
826 } // namespace net 828 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698