OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/spdy/spdy_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 "js.foo.com", | 332 "js.foo.com", |
333 "192.168.0.2,192.168.0.3,192.168.0.5,192.0.2.33" | 333 "192.168.0.2,192.168.0.3,192.168.0.5,192.0.2.33" |
334 }, | 334 }, |
335 { "http://images.foo.com", | 335 { "http://images.foo.com", |
336 "images.foo.com", | 336 "images.foo.com", |
337 "192.168.0.4,192.168.0.3" | 337 "192.168.0.4,192.168.0.3" |
338 }, | 338 }, |
339 }; | 339 }; |
340 | 340 |
341 session_deps_.host_resolver->set_synchronous_mode(true); | 341 session_deps_.host_resolver->set_synchronous_mode(true); |
342 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { | 342 for (size_t i = 0; i < arraysize(test_hosts); i++) { |
343 session_deps_.host_resolver->rules()->AddIPLiteralRule( | 343 session_deps_.host_resolver->rules()->AddIPLiteralRule( |
344 test_hosts[i].name, test_hosts[i].iplist, std::string()); | 344 test_hosts[i].name, test_hosts[i].iplist, std::string()); |
345 | 345 |
346 // This test requires that the HostResolver cache be populated. Normal | 346 // This test requires that the HostResolver cache be populated. Normal |
347 // code would have done this already, but we do it manually. | 347 // code would have done this already, but we do it manually. |
348 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort)); | 348 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort)); |
349 session_deps_.host_resolver->Resolve(info, | 349 session_deps_.host_resolver->Resolve(info, |
350 DEFAULT_PRIORITY, | 350 DEFAULT_PRIORITY, |
351 &test_hosts[i].addresses, | 351 &test_hosts[i].addresses, |
352 CompletionCallback(), | 352 CompletionCallback(), |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 EXPECT_TRUE(delegateA.StreamIsClosed()); | 611 EXPECT_TRUE(delegateA.StreamIsClosed()); |
612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
613 EXPECT_TRUE(delegateB.StreamIsClosed()); | 613 EXPECT_TRUE(delegateB.StreamIsClosed()); |
614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
616 } | 616 } |
617 | 617 |
618 } // namespace | 618 } // namespace |
619 | 619 |
620 } // namespace net | 620 } // namespace net |
OLD | NEW |