OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Multi-threaded tests of DnsMaster and DnsPrefetch slave functionality. | 5 // Multi-threaded tests of DnsMaster and DnsPrefetch slave functionality. |
6 | 6 |
7 #include <time.h> | 7 #include <time.h> |
8 #include <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
9 #include <Wspiapi.h> // Needed for win2k compatibility | 9 #include <Wspiapi.h> // Needed for win2k compatibility |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <map> | 12 #include <map> |
13 #include <sstream> | 13 #include <sstream> |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/spin_wait.h" | 16 #include "base/spin_wait.h" |
17 #include "chrome/browser/net/dns_global.h" | 17 #include "chrome/browser/net/dns_global.h" |
18 #include "chrome/browser/net/dns_host_info.h" | 18 #include "chrome/browser/net/dns_host_info.h" |
19 #include "chrome/browser/net/dns_slave.h" | 19 #include "chrome/browser/net/dns_slave.h" |
20 #include "net/base/winsock_init.h" | 20 #include "net/base/winsock_init.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 | 23 |
| 24 using base::Time; |
| 25 using base::TimeDelta; |
| 26 |
24 namespace { | 27 namespace { |
25 | 28 |
26 class DnsMasterTest : public testing::Test { | 29 class DnsMasterTest : public testing::Test { |
27 }; | 30 }; |
28 | 31 |
29 typedef chrome_browser_net::DnsMaster DnsMaster; | 32 typedef chrome_browser_net::DnsMaster DnsMaster; |
30 typedef chrome_browser_net::DnsPrefetcherInit DnsPrefetcherInit; | 33 typedef chrome_browser_net::DnsPrefetcherInit DnsPrefetcherInit; |
31 typedef chrome_browser_net::DnsHostInfo DnsHostInfo; | 34 typedef chrome_browser_net::DnsHostInfo DnsHostInfo; |
32 typedef chrome_browser_net::NameList NameList; | 35 typedef chrome_browser_net::NameList NameList; |
33 | 36 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 EXPECT_GE(testing_master.GetResolutionDuration(bad2).InMilliseconds(), | 421 EXPECT_GE(testing_master.GetResolutionDuration(bad2).InMilliseconds(), |
419 testing_master.GetResolutionDuration(goog4).InMilliseconds()); | 422 testing_master.GetResolutionDuration(goog4).InMilliseconds()); |
420 | 423 |
421 EXPECT_EQ(8, testing_master.running_slave_count()); | 424 EXPECT_EQ(8, testing_master.running_slave_count()); |
422 | 425 |
423 EXPECT_TRUE(testing_master.ShutdownSlaves()); | 426 EXPECT_TRUE(testing_master.ShutdownSlaves()); |
424 } | 427 } |
425 | 428 |
426 } // namespace | 429 } // namespace |
427 | 430 |
OLD | NEW |