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

Side by Side Diff: chrome/browser/net/http_server_properties_manager_unittest.cc

Issue 10006047: Persist the alternate protocol as a string not an int to allow the enum to be changed without affec… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // it twice. Only expect a single cache update. 135 // it twice. Only expect a single cache update.
136 136
137 base::DictionaryValue* server_pref_dict = new base::DictionaryValue; 137 base::DictionaryValue* server_pref_dict = new base::DictionaryValue;
138 138
139 // Set supports_spdy for www.google.com:80. 139 // Set supports_spdy for www.google.com:80.
140 server_pref_dict->SetBoolean("supports_spdy", true); 140 server_pref_dict->SetBoolean("supports_spdy", true);
141 141
142 // Set up alternate_protocol for www.google.com:80. 142 // Set up alternate_protocol for www.google.com:80.
143 base::DictionaryValue* alternate_protocol = new base::DictionaryValue; 143 base::DictionaryValue* alternate_protocol = new base::DictionaryValue;
144 alternate_protocol->SetInteger("port", 443); 144 alternate_protocol->SetInteger("port", 443);
145 alternate_protocol->SetInteger("protocol", static_cast<int>(net::NPN_SPDY_1)); 145 alternate_protocol->SetString("protocol_str", "npn-spdy/1");
146 server_pref_dict->SetWithoutPathExpansion( 146 server_pref_dict->SetWithoutPathExpansion(
147 "alternate_protocol", alternate_protocol); 147 "alternate_protocol", alternate_protocol);
148 148
149 // Set pipeline capability for www.google.com:80. 149 // Set pipeline capability for www.google.com:80.
150 server_pref_dict->SetInteger("pipeline_capability", net::PIPELINE_CAPABLE); 150 server_pref_dict->SetInteger("pipeline_capability", net::PIPELINE_CAPABLE);
151 151
152 // Set the server preference for www.google.com:80. 152 // Set the server preference for www.google.com:80.
153 base::DictionaryValue* http_server_properties_dict = 153 base::DictionaryValue* http_server_properties_dict =
154 new base::DictionaryValue; 154 new base::DictionaryValue;
155 http_server_properties_dict->SetWithoutPathExpansion( 155 http_server_properties_dict->SetWithoutPathExpansion(
156 "www.google.com:80", server_pref_dict); 156 "www.google.com:80", server_pref_dict);
157 157
158 // Set the preference for mail.google.com server. 158 // Set the preference for mail.google.com server.
159 base::DictionaryValue* server_pref_dict1 = new base::DictionaryValue; 159 base::DictionaryValue* server_pref_dict1 = new base::DictionaryValue;
160 160
161 // Set supports_spdy for mail.google.com:80 161 // Set supports_spdy for mail.google.com:80
162 server_pref_dict1->SetBoolean("supports_spdy", true); 162 server_pref_dict1->SetBoolean("supports_spdy", true);
163 163
164 // Set up alternate_protocol for mail.google.com:80 164 // Set up alternate_protocol for mail.google.com:80
165 base::DictionaryValue* alternate_protocol1 = new base::DictionaryValue; 165 base::DictionaryValue* alternate_protocol1 = new base::DictionaryValue;
166 alternate_protocol1->SetInteger("port", 444); 166 alternate_protocol1->SetInteger("port", 444);
167 alternate_protocol1->SetInteger( 167 alternate_protocol1->SetString("protocol_str", "npn-spdy/2");
168 "protocol", static_cast<int>(net::NPN_SPDY_2)); 168
169 server_pref_dict1->SetWithoutPathExpansion( 169 server_pref_dict1->SetWithoutPathExpansion(
170 "alternate_protocol", alternate_protocol1); 170 "alternate_protocol", alternate_protocol1);
171 171
172 // Set pipelining capability for mail.google.com:80 172 // Set pipelining capability for mail.google.com:80
173 server_pref_dict1->SetInteger("pipeline_capability", net::PIPELINE_INCAPABLE); 173 server_pref_dict1->SetInteger("pipeline_capability", net::PIPELINE_INCAPABLE);
174 174
175 // Set the server preference for mail.google.com:80. 175 // Set the server preference for mail.google.com:80.
176 http_server_properties_dict->SetWithoutPathExpansion( 176 http_server_properties_dict->SetWithoutPathExpansion(
177 "mail.google.com:80", server_pref_dict1); 177 "mail.google.com:80", server_pref_dict1);
178 178
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // Run the task after shutdown, but before deletion. 440 // Run the task after shutdown, but before deletion.
441 loop_.RunAllPending(); 441 loop_.RunAllPending();
442 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 442 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
443 http_server_props_manager_.reset(); 443 http_server_props_manager_.reset();
444 loop_.RunAllPending(); 444 loop_.RunAllPending();
445 } 445 }
446 446
447 } // namespace 447 } // namespace
448 448
449 } // namespace chrome_browser_net 449 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698