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

Unified Diff: chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc

Issue 1431653003: Migrating tests to use EmbeddedTestServer (misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing comments. Created 5 years, 1 month 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: chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
index 6bc7b37ae318493c154805c6d50f7db6688452c8..192bf0a9812e15e6023e7d468c16f263b2922a9a 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
@@ -12,7 +12,7 @@
#include "base/values.h"
#include "chrome/service/cloud_print/cloud_print_url_fetcher.h"
#include "chrome/service/service_process.h"
-#include "net/test/spawned_test_server/spawned_test_server.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
#include "net/url_request/url_request_test_util.h"
@@ -330,46 +330,42 @@ void CloudPrintURLFetcherRetryBackoffTest::OnRequestGiveUp() {
}
TEST_F(CloudPrintURLFetcherBasicTest, HandleRawResponse) {
- net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_HTTP,
- net::SpawnedTestServer::kLocalhost,
- base::FilePath(kDocRoot));
+ net::EmbeddedTestServer test_server;
+ test_server.AddDefaultHandlers(base::FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
SetHandleRawResponse(true);
- CreateFetcher(test_server.GetURL("echo"), 0);
+ CreateFetcher(test_server.GetURL("/echo"), 0);
base::MessageLoop::current()->Run();
}
TEST_F(CloudPrintURLFetcherBasicTest, HandleRawData) {
- net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_HTTP,
- net::SpawnedTestServer::kLocalhost,
- base::FilePath(kDocRoot));
+ net::EmbeddedTestServer test_server;
+ test_server.AddDefaultHandlers(base::FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
SetHandleRawData(true);
- CreateFetcher(test_server.GetURL("echo"), 0);
+ CreateFetcher(test_server.GetURL("/echo"), 0);
base::MessageLoop::current()->Run();
}
TEST_F(CloudPrintURLFetcherOverloadTest, Protect) {
- net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_HTTP,
- net::SpawnedTestServer::kLocalhost,
- base::FilePath(kDocRoot));
+ net::EmbeddedTestServer test_server;
+ test_server.AddDefaultHandlers(base::FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
- GURL url(test_server.GetURL("defaultresponse"));
+ GURL url(test_server.GetURL("/defaultresponse"));
CreateFetcher(url, 11);
base::MessageLoop::current()->Run();
}
TEST_F(CloudPrintURLFetcherRetryBackoffTest, GiveUp) {
- net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_HTTP,
- net::SpawnedTestServer::kLocalhost,
- base::FilePath(kDocRoot));
+ net::EmbeddedTestServer test_server;
+ test_server.AddDefaultHandlers(base::FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
- GURL url(test_server.GetURL("defaultresponse"));
+ GURL url(test_server.GetURL("/defaultresponse"));
CreateFetcher(url, 11);
base::MessageLoop::current()->Run();

Powered by Google App Engine
This is Rietveld 408576698