| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" | 5 #include "content/public/test/browser_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // so this host resolver procedure catches external queries and returns a failed | 82 // so this host resolver procedure catches external queries and returns a failed |
| 83 // lookup result. | 83 // lookup result. |
| 84 class LocalHostResolverProc : public net::HostResolverProc { | 84 class LocalHostResolverProc : public net::HostResolverProc { |
| 85 public: | 85 public: |
| 86 LocalHostResolverProc() : HostResolverProc(NULL) {} | 86 LocalHostResolverProc() : HostResolverProc(NULL) {} |
| 87 | 87 |
| 88 virtual int Resolve(const std::string& host, | 88 virtual int Resolve(const std::string& host, |
| 89 net::AddressFamily address_family, | 89 net::AddressFamily address_family, |
| 90 net::HostResolverFlags host_resolver_flags, | 90 net::HostResolverFlags host_resolver_flags, |
| 91 net::AddressList* addrlist, | 91 net::AddressList* addrlist, |
| 92 int* os_error) OVERRIDE { | 92 int* os_error) override { |
| 93 const char* kLocalHostNames[] = {"localhost", "127.0.0.1", "::1"}; | 93 const char* kLocalHostNames[] = {"localhost", "127.0.0.1", "::1"}; |
| 94 bool local = false; | 94 bool local = false; |
| 95 | 95 |
| 96 if (host == net::GetHostName()) { | 96 if (host == net::GetHostName()) { |
| 97 local = true; | 97 local = true; |
| 98 } else { | 98 } else { |
| 99 for (size_t i = 0; i < arraysize(kLocalHostNames); i++) | 99 for (size_t i = 0; i < arraysize(kLocalHostNames); i++) |
| 100 if (host == kLocalHostNames[i]) { | 100 if (host == kLocalHostNames[i]) { |
| 101 local = true; | 101 local = true; |
| 102 break; | 102 break; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 use_software_compositing_ = true; | 340 use_software_compositing_ = true; |
| 341 } | 341 } |
| 342 | 342 |
| 343 bool BrowserTestBase::UsingOSMesa() const { | 343 bool BrowserTestBase::UsingOSMesa() const { |
| 344 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 344 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 345 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 345 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
| 346 gfx::kGLImplementationOSMesaName; | 346 gfx::kGLImplementationOSMesaName; |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace content | 349 } // namespace content |
| OLD | NEW |