Commit 7398ee24 authored by szym@chromium.org's avatar szym@chromium.org

[cf] Fix TestServerTest.TestServer to talk to localhost only.

TBR=eroman
BUG=126016
TEST=chrome_frame_tests --gtest_filter=TestServerTest.TestServer
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/10417045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138436 0039d316-1c4b-4281-b951-d872f2087c98
parent 1b46a537
......@@ -140,9 +140,13 @@ TEST_F(TestServerTest, TestServer) {
test_server::FileResponse file("/file", source_path().Append(
FILE_PATH_LITERAL("CFInstance.js")));
server.AddResponse(&file);
test_server::RedirectResponse redir("/goog", "http://www.google.com/");
test_server::RedirectResponse redir("/redir", "http://localhost:1338/dest");
server.AddResponse(&redir);
test_server::SimpleWebServer redirected_server(1338);
test_server::SimpleResponse dest("/dest", "Destination");
redirected_server.AddResponse(&dest);
// We should never hit this, but it's our way to break out of the test if
// things start hanging.
QuitMessageHit quit_msg(&loop);
......@@ -153,11 +157,11 @@ TEST_F(TestServerTest, TestServer) {
UrlTaskChain fnf_task("http://localhost:1337/404", &quit_task);
UrlTaskChain person_task("http://localhost:1337/person", &fnf_task);
UrlTaskChain file_task("http://localhost:1337/file", &person_task);
UrlTaskChain goog_task("http://localhost:1337/goog", &file_task);
UrlTaskChain redir_task("http://localhost:1337/redir", &file_task);
DWORD tid = 0;
base::win::ScopedHandle worker(::CreateThread(
NULL, 0, FetchUrl, &goog_task, 0, &tid));
NULL, 0, FetchUrl, &redir_task, 0, &tid));
loop.MessageLoop::Run();
EXPECT_FALSE(quit_msg.hit_);
......@@ -170,7 +174,7 @@ TEST_F(TestServerTest, TestServer) {
EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos);
EXPECT_TRUE(file_task.response().find("function") != std::string::npos);
EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos);
EXPECT_TRUE(redir_task.response().find("Destination") != std::string::npos);
} else {
::TerminateThread(worker, ~0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment