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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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_network_transaction_unittest.cc ('k') | net/http/transport_security_persister.cc » ('j') | 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 "3.1\"}],\"network_stats\":{\"srtt\":42}},\"www.google.com:80\":" 701 "3.1\"}],\"network_stats\":{\"srtt\":42}},\"www.google.com:80\":"
702 "{\"alternative_service\":[{\"port\":443,\"probability\":1.0," 702 "{\"alternative_service\":[{\"port\":443,\"probability\":1.0,"
703 "\"protocol_str\":\"npn-h2\"}]}},\"supports_quic\":" 703 "\"protocol_str\":\"npn-h2\"}]}},\"supports_quic\":"
704 "{\"address\":\"127.0.0.1\",\"used_quic\":true},\"version\":3}"; 704 "{\"address\":\"127.0.0.1\",\"used_quic\":true},\"version\":3}";
705 705
706 const base::Value* http_server_properties = 706 const base::Value* http_server_properties =
707 pref_service_.GetUserPref(kTestHttpServerProperties); 707 pref_service_.GetUserPref(kTestHttpServerProperties);
708 ASSERT_NE(nullptr, http_server_properties); 708 ASSERT_NE(nullptr, http_server_properties);
709 std::string preferences_json; 709 std::string preferences_json;
710 EXPECT_TRUE( 710 EXPECT_TRUE(
711 base::JSONWriter::Write(http_server_properties, &preferences_json)); 711 base::JSONWriter::Write(*http_server_properties, &preferences_json));
712 EXPECT_EQ(expected_json, preferences_json); 712 EXPECT_EQ(expected_json, preferences_json);
713 } 713 }
714 714
715 TEST_F(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdateCache0) { 715 TEST_F(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdateCache0) {
716 // Post an update task to the UI thread. 716 // Post an update task to the UI thread.
717 http_server_props_manager_->ScheduleUpdateCacheOnPrefThread(); 717 http_server_props_manager_->ScheduleUpdateCacheOnPrefThread();
718 // Shutdown comes before the task is executed. 718 // Shutdown comes before the task is executed.
719 http_server_props_manager_->ShutdownOnPrefThread(); 719 http_server_props_manager_->ShutdownOnPrefThread();
720 http_server_props_manager_.reset(); 720 http_server_props_manager_.reset();
721 // Run the task after shutdown and deletion. 721 // Run the task after shutdown and deletion.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 // Run the task after shutdown, but before deletion. 780 // Run the task after shutdown, but before deletion.
781 base::RunLoop().RunUntilIdle(); 781 base::RunLoop().RunUntilIdle();
782 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 782 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
783 http_server_props_manager_.reset(); 783 http_server_props_manager_.reset();
784 base::RunLoop().RunUntilIdle(); 784 base::RunLoop().RunUntilIdle();
785 } 785 }
786 786
787 } // namespace 787 } // namespace
788 788
789 } // namespace net 789 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698