Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: chrome_frame/test/net/fake_external_tab.cc

Issue 9401013: Don't run chrome_frame_net_tests URLRequestTestHTTP over loopback, due to mysterious failures. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698