Index: chrome_frame/test/net/fake_external_tab.cc |
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc |
index c6f02e22ec4428b47a6aeb6caced22474d23e971..476bd1819ec4666fc6f62f3bcd5a148e748fef0b 100644 |
--- a/chrome_frame/test/net/fake_external_tab.cc |
+++ b/chrome_frame/test/net/fake_external_tab.cc |
@@ -7,6 +7,7 @@ |
#include <atlbase.h> |
#include <atlcom.h> |
#include <exdisp.h> |
+#include <Winsock2.h> |
#include "base/bind.h" |
#include "base/command_line.h" |
@@ -56,6 +57,7 @@ |
#include "content/public/browser/render_process_host.h" |
#include "content/public/common/content_client.h" |
#include "content/public/common/content_paths.h" |
+#include "net/url_request/url_request_test_util.h" |
#include "sandbox/src/sandbox_types.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -576,8 +578,37 @@ void CFUrlRequestUnittestRunner::StartTests() { |
// static |
DWORD CFUrlRequestUnittestRunner::RunAllUnittests(void* param) { |
base::PlatformThread::SetName("CFUrlRequestUnittestRunner"); |
+ |
+ char hostname[256]; |
+ struct hostent *host_info = NULL; |
eroman
2012/02/16 02:35:14
style-nit: asterisk goes on left.
|
+ |
+ LOG(ERROR) << "Calling gethostname."; |
eroman
2012/02/16 02:35:14
Please only log to LOG(ERROR) if an error actually
|
+ if (0 != gethostname(hostname, arraysize(hostname))) { |
+ LOG(ERROR) << "Failed to determine the local host name. Tests will be run " |
+ << "over the loopback adapter, which may result in hangs."; |
eroman
2012/02/16 02:35:14
nit: indent by one more.
|
+ |
+ } else { |
+ LOG(ERROR) << "hostname is " << hostname << " ."; |
+ if (NULL == (host_info = gethostbyname(hostname)) || |
+ host_info->h_addrtype != AF_INET || |
+ host_info->h_addr_list[0] == NULL) { |
+ LOG(ERROR) << "Failed to look up addresses for the local host name. Tests " |
eroman
2012/02/16 02:35:14
line longer than 80
|
+ << "will be run over the loopback adapter, which may result in " |
+ << "hangs."; |
+ } else { |
+ std::string host( |
+ inet_ntoa(*reinterpret_cast<in_addr *>(host_info->h_addr_list[0]))); |
eroman
2012/02/16 02:35:14
Are you able to use the net code here? If you are,
|
+ |
+ LOG(ERROR) << "chrome_frame_net_tests URLRequestTestHTTP will execute over " |
eroman
2012/02/16 02:35:14
long line.
|
+ << "host IP address " << host << "."; |
+ |
+ set_url_request_test_http_host(host); |
+ } |
+ } |
+ |
CFUrlRequestUnittestRunner* me = |
reinterpret_cast<CFUrlRequestUnittestRunner*>(param); |
+ |
me->test_result_ = me->Run(); |
BrowserThread::PostTask(BrowserThread::UI, |
FROM_HERE, |