diff options
Diffstat (limited to 'chromium/content/browser/loader/async_resource_handler_browsertest.cc')
-rw-r--r-- | chromium/content/browser/loader/async_resource_handler_browsertest.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chromium/content/browser/loader/async_resource_handler_browsertest.cc b/chromium/content/browser/loader/async_resource_handler_browsertest.cc index cb48a231115..456c31a544f 100644 --- a/chromium/content/browser/loader/async_resource_handler_browsertest.cc +++ b/chromium/content/browser/loader/async_resource_handler_browsertest.cc @@ -4,11 +4,14 @@ #include "content/browser/loader/async_resource_handler.h" +#include <stddef.h> #include <string> +#include <utility> #include "base/format_macros.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" @@ -28,8 +31,10 @@ const char kRedirectPostPath[] = "/redirect"; // ThreadSanitizer is too slow to perform the full upload, so tests // using that build get an easier test which might not show two distinct -// progress events. See crbug.com/526985. -#if defined(THREAD_SANITIZER) +// progress events. See crbug.com/526985. In addition, OSX buildbots have +// experienced slowdowns on this test (crbug.com/548819), give them the easier +// test too. +#if defined(THREAD_SANITIZER) || defined(OS_MACOSX) const size_t kPayloadSize = 1062882; // 2*3^12 #else const size_t kPayloadSize = 28697814; // 2*3^15 @@ -44,14 +49,14 @@ scoped_ptr<net::test_server::HttpResponse> HandlePostAndRedirectURLs( base::CompareCase::SENSITIVE)) { http_response->set_code(net::HTTP_TEMPORARY_REDIRECT); http_response->AddCustomHeader("Location", kPostPath); - EXPECT_EQ(request.content.length(), kPayloadSize);; - return http_response.Pass(); - } else if(base::StartsWith(request.relative_url, kPostPath, - base::CompareCase::SENSITIVE)) { + EXPECT_EQ(request.content.length(), kPayloadSize); + return std::move(http_response); + } else if (base::StartsWith(request.relative_url, kPostPath, + base::CompareCase::SENSITIVE)) { http_response->set_content("hello"); http_response->set_content_type("text/plain"); EXPECT_EQ(request.content.length(), kPayloadSize); - return http_response.Pass(); + return std::move(http_response); } else { return scoped_ptr<net::test_server::HttpResponse>(); } @@ -63,8 +68,8 @@ class AsyncResourceHandlerBrowserTest : public ContentBrowserTest { }; IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, UploadProgress) { - net::test_server::EmbeddedTestServer* test_server = embedded_test_server(); - ASSERT_TRUE(test_server->InitializeAndWaitUntilReady()); + net::EmbeddedTestServer* test_server = embedded_test_server(); + ASSERT_TRUE(test_server->Start()); test_server->RegisterRequestHandler( base::Bind(&HandlePostAndRedirectURLs, kPostPath)); @@ -83,8 +88,8 @@ IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, UploadProgress) { IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, UploadProgressRedirect) { - net::test_server::EmbeddedTestServer* test_server = embedded_test_server(); - ASSERT_TRUE(test_server->InitializeAndWaitUntilReady()); + net::EmbeddedTestServer* test_server = embedded_test_server(); + ASSERT_TRUE(test_server->Start()); test_server->RegisterRequestHandler( base::Bind(&HandlePostAndRedirectURLs, kRedirectPostPath)); |