| OLD | NEW |
| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) { | 598 TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) { |
| 599 ExpectPrefsUpdate(); | 599 ExpectPrefsUpdate(); |
| 600 ExpectScheduleUpdatePrefsOnNetworkThread(); | 600 ExpectScheduleUpdatePrefsOnNetworkThread(); |
| 601 | 601 |
| 602 IPAddressNumber address; | 602 IPAddressNumber address; |
| 603 EXPECT_FALSE(http_server_props_manager_->GetSupportsQuic(&address)); | 603 EXPECT_FALSE(http_server_props_manager_->GetSupportsQuic(&address)); |
| 604 | 604 |
| 605 IPAddressNumber actual_address; | 605 IPAddressNumber actual_address; |
| 606 CHECK(ParseIPLiteralToNumber("127.0.0.1", &actual_address)); | 606 CHECK(ParseIPLiteralToNumber("127.0.0.1", &actual_address)); |
| 607 http_server_props_manager_->SetSupportsQuic(true, actual_address); | 607 http_server_props_manager_->SetSupportsQuic(true, actual_address); |
| 608 // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once. |
| 609 http_server_props_manager_->SetSupportsQuic(true, actual_address); |
| 608 | 610 |
| 609 // Run the task. | 611 // Run the task. |
| 610 base::RunLoop().RunUntilIdle(); | 612 base::RunLoop().RunUntilIdle(); |
| 611 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 613 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 612 | 614 |
| 613 EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&address)); | 615 EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&address)); |
| 614 EXPECT_EQ(actual_address, address); | 616 EXPECT_EQ(actual_address, address); |
| 615 } | 617 } |
| 616 | 618 |
| 617 TEST_F(HttpServerPropertiesManagerTest, ServerNetworkStats) { | 619 TEST_F(HttpServerPropertiesManagerTest, ServerNetworkStats) { |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 // Run the task after shutdown, but before deletion. | 889 // Run the task after shutdown, but before deletion. |
| 888 base::RunLoop().RunUntilIdle(); | 890 base::RunLoop().RunUntilIdle(); |
| 889 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 891 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 890 http_server_props_manager_.reset(); | 892 http_server_props_manager_.reset(); |
| 891 base::RunLoop().RunUntilIdle(); | 893 base::RunLoop().RunUntilIdle(); |
| 892 } | 894 } |
| 893 | 895 |
| 894 } // namespace | 896 } // namespace |
| 895 | 897 |
| 896 } // namespace net | 898 } // namespace net |
| OLD | NEW |