OLD | NEW |
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 "net/dns/address_sorter.h" | 5 #include "net/dns/address_sorter.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <winsock2.h> | 8 #include <winsock2.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #endif | 50 #endif |
51 scoped_ptr<AddressSorter> sorter(AddressSorter::CreateAddressSorter()); | 51 scoped_ptr<AddressSorter> sorter(AddressSorter::CreateAddressSorter()); |
52 AddressList list; | 52 AddressList list; |
53 list.push_back(MakeEndPoint("10.0.0.1")); | 53 list.push_back(MakeEndPoint("10.0.0.1")); |
54 list.push_back(MakeEndPoint("8.8.8.8")); | 54 list.push_back(MakeEndPoint("8.8.8.8")); |
55 list.push_back(MakeEndPoint("::1")); | 55 list.push_back(MakeEndPoint("::1")); |
56 list.push_back(MakeEndPoint("2001:4860:4860::8888")); | 56 list.push_back(MakeEndPoint("2001:4860:4860::8888")); |
57 | 57 |
58 AddressList result; | 58 AddressList result; |
59 TestCompletionCallback callback; | 59 TestCompletionCallback callback; |
60 sorter->Sort(list, base::Bind(&OnSortComplete, &result, | 60 sorter->Sort(list, base::Bind(&OnSortComplete, &result, callback.callback())); |
61 callback.callback())); | |
62 EXPECT_EQ(expected_result, callback.WaitForResult()); | 61 EXPECT_EQ(expected_result, callback.WaitForResult()); |
63 } | 62 } |
64 | 63 |
65 } // namespace | 64 } // namespace |
66 } // namespace net | 65 } // namespace net |
OLD | NEW |