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

Unified Diff: chrome_frame/test/test_server_test.cc

Issue 10417045: [cf] Fix TestServerTest.TestServer to talk to localhost only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/test_server_test.cc
diff --git a/chrome_frame/test/test_server_test.cc b/chrome_frame/test/test_server_test.cc
index d085b8d801e14b1f35592bd93380218b3b6ecf4e..cc52a39899d81d264beae7c2c66349392e82f0bd 100644
--- a/chrome_frame/test/test_server_test.cc
+++ b/chrome_frame/test/test_server_test.cc
@@ -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);
}
« 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