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

Unified Diff: net/test/embedded_test_server/embedded_test_server_unittest.cc

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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
Index: net/test/embedded_test_server/embedded_test_server_unittest.cc
diff --git a/net/test/embedded_test_server/embedded_test_server_unittest.cc b/net/test/embedded_test_server/embedded_test_server_unittest.cc
index cfdcab1419a4daf1b27f2c84baf1636b94deddc1..35d0fd414e1aba91a7d82af902e8e6026c9a9c8b 100644
--- a/net/test/embedded_test_server/embedded_test_server_unittest.cc
+++ b/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -85,7 +85,7 @@ class EmbeddedTestServerTest : public testing::Test,
scoped_ptr<HttpResponse> HandleRequest(const std::string& path,
const std::string& content,
const std::string& content_type,
- ResponseCode code,
+ HttpStatusCode code,
const HttpRequest& request) {
request_relative_url_ = request.relative_url;
@@ -128,7 +128,7 @@ TEST_F(EmbeddedTestServerTest, RegisterRequestHandler) {
"/test",
"<b>Worked!</b>",
"text/html",
- SUCCESS));
+ HTTP_OK));
scoped_ptr<URLFetcher> fetcher(
URLFetcher::Create(server_->GetURL("/test?q=foo"),
@@ -139,7 +139,7 @@ TEST_F(EmbeddedTestServerTest, RegisterRequestHandler) {
WaitForResponses(1);
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher->GetStatus().status());
- EXPECT_EQ(SUCCESS, fetcher->GetResponseCode());
+ EXPECT_EQ(HTTP_OK, fetcher->GetResponseCode());
EXPECT_EQ("<b>Worked!</b>", GetContentFromFetcher(*fetcher));
EXPECT_EQ("text/html", GetContentTypeFromFetcher(*fetcher));
@@ -161,7 +161,7 @@ TEST_F(EmbeddedTestServerTest, ServeFilesFromDirectory) {
WaitForResponses(1);
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher->GetStatus().status());
- EXPECT_EQ(SUCCESS, fetcher->GetResponseCode());
+ EXPECT_EQ(HTTP_OK, fetcher->GetResponseCode());
EXPECT_EQ("<p>Hello World!</p>", GetContentFromFetcher(*fetcher));
EXPECT_EQ("", GetContentTypeFromFetcher(*fetcher));
}
@@ -176,7 +176,7 @@ TEST_F(EmbeddedTestServerTest, DefaultNotFoundResponse) {
fetcher->Start();
WaitForResponses(1);
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher->GetStatus().status());
- EXPECT_EQ(NOT_FOUND, fetcher->GetResponseCode());
+ EXPECT_EQ(HTTP_NOT_FOUND, fetcher->GetResponseCode());
}
TEST_F(EmbeddedTestServerTest, ConcurrentFetches) {
@@ -186,21 +186,21 @@ TEST_F(EmbeddedTestServerTest, ConcurrentFetches) {
"/test1",
"Raspberry chocolate",
"text/html",
- SUCCESS));
+ HTTP_OK));
server_->RegisterRequestHandler(
base::Bind(&EmbeddedTestServerTest::HandleRequest,
base::Unretained(this),
"/test2",
"Vanilla chocolate",
"text/html",
- SUCCESS));
+ HTTP_OK));
server_->RegisterRequestHandler(
base::Bind(&EmbeddedTestServerTest::HandleRequest,
base::Unretained(this),
"/test3",
"No chocolates",
"text/plain",
- NOT_FOUND));
+ HTTP_NOT_FOUND));
scoped_ptr<URLFetcher> fetcher1 = scoped_ptr<URLFetcher>(
URLFetcher::Create(server_->GetURL("/test1"),
@@ -225,17 +225,17 @@ TEST_F(EmbeddedTestServerTest, ConcurrentFetches) {
WaitForResponses(3);
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher1->GetStatus().status());
- EXPECT_EQ(SUCCESS, fetcher1->GetResponseCode());
+ EXPECT_EQ(HTTP_OK, fetcher1->GetResponseCode());
EXPECT_EQ("Raspberry chocolate", GetContentFromFetcher(*fetcher1));
EXPECT_EQ("text/html", GetContentTypeFromFetcher(*fetcher1));
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher2->GetStatus().status());
- EXPECT_EQ(SUCCESS, fetcher2->GetResponseCode());
+ EXPECT_EQ(HTTP_OK, fetcher2->GetResponseCode());
EXPECT_EQ("Vanilla chocolate", GetContentFromFetcher(*fetcher2));
EXPECT_EQ("text/html", GetContentTypeFromFetcher(*fetcher2));
EXPECT_EQ(URLRequestStatus::SUCCESS, fetcher3->GetStatus().status());
- EXPECT_EQ(NOT_FOUND, fetcher3->GetResponseCode());
+ EXPECT_EQ(HTTP_NOT_FOUND, fetcher3->GetResponseCode());
EXPECT_EQ("No chocolates", GetContentFromFetcher(*fetcher3));
EXPECT_EQ("text/plain", GetContentTypeFromFetcher(*fetcher3));
}
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.cc ('k') | net/test/embedded_test_server/http_response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698