| 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 "chrome/test/base/chrome_test_suite.h" | 5 #include "chrome/test/base/chrome_test_suite.h" |
| 6 | 6 |
| 7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #endif | 10 #endif |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // so this host resolver procedure catches external queries and returns a failed | 83 // so this host resolver procedure catches external queries and returns a failed |
| 84 // lookup result. | 84 // lookup result. |
| 85 class LocalHostResolverProc : public net::HostResolverProc { | 85 class LocalHostResolverProc : public net::HostResolverProc { |
| 86 public: | 86 public: |
| 87 LocalHostResolverProc() : HostResolverProc(NULL) {} | 87 LocalHostResolverProc() : HostResolverProc(NULL) {} |
| 88 | 88 |
| 89 virtual int Resolve(const std::string& host, | 89 virtual int Resolve(const std::string& host, |
| 90 net::AddressFamily address_family, | 90 net::AddressFamily address_family, |
| 91 net::HostResolverFlags host_resolver_flags, | 91 net::HostResolverFlags host_resolver_flags, |
| 92 net::AddressList* addrlist, | 92 net::AddressList* addrlist, |
| 93 int* os_error) { | 93 int* os_error) OVERRIDE { |
| 94 const char* kLocalHostNames[] = {"localhost", "127.0.0.1", "::1"}; | 94 const char* kLocalHostNames[] = {"localhost", "127.0.0.1", "::1"}; |
| 95 bool local = false; | 95 bool local = false; |
| 96 | 96 |
| 97 if (host == net::GetHostName()) { | 97 if (host == net::GetHostName()) { |
| 98 local = true; | 98 local = true; |
| 99 } else { | 99 } else { |
| 100 for (size_t i = 0; i < arraysize(kLocalHostNames); i++) | 100 for (size_t i = 0; i < arraysize(kLocalHostNames); i++) |
| 101 if (host == kLocalHostNames[i]) { | 101 if (host == kLocalHostNames[i]) { |
| 102 local = true; | 102 local = true; |
| 103 break; | 103 break; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 #if defined(OS_MACOSX) && !defined(OS_IOS) | 278 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 279 base::mac::SetOverrideFrameworkBundle(NULL); | 279 base::mac::SetOverrideFrameworkBundle(NULL); |
| 280 #endif | 280 #endif |
| 281 | 281 |
| 282 base::StatsTable::set_current(NULL); | 282 base::StatsTable::set_current(NULL); |
| 283 stats_table_.reset(); | 283 stats_table_.reset(); |
| 284 RemoveSharedMemoryFile(stats_filename_); | 284 RemoveSharedMemoryFile(stats_filename_); |
| 285 | 285 |
| 286 base::TestSuite::Shutdown(); | 286 base::TestSuite::Shutdown(); |
| 287 } | 287 } |
| OLD | NEW |