| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/loader/async_resource_handler.h" | 5 #include "content/browser/loader/async_resource_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kPostPath[] = "/post"; | 26 const char kPostPath[] = "/post"; |
| 27 const char kRedirectPostPath[] = "/redirect"; | 27 const char kRedirectPostPath[] = "/redirect"; |
| 28 | 28 |
| 29 // ThreadSanitizer is too slow to perform the full upload, so tests | 29 // ThreadSanitizer is too slow to perform the full upload, so tests |
| 30 // using that build get an easier test which might not show two distinct | 30 // using that build get an easier test which might not show two distinct |
| 31 // progress events. See crbug.com/526985. | 31 // progress events. See crbug.com/526985. In addition, OSX buildbots have |
| 32 #if defined(THREAD_SANITIZER) | 32 // experienced slowdowns on this test (crbug.com/548819), give them the easier |
| 33 // test too. |
| 34 #if defined(THREAD_SANITIZER) || defined(OS_MACOSX) |
| 33 const size_t kPayloadSize = 1062882; // 2*3^12 | 35 const size_t kPayloadSize = 1062882; // 2*3^12 |
| 34 #else | 36 #else |
| 35 const size_t kPayloadSize = 28697814; // 2*3^15 | 37 const size_t kPayloadSize = 28697814; // 2*3^15 |
| 36 #endif | 38 #endif |
| 37 | 39 |
| 38 scoped_ptr<net::test_server::HttpResponse> HandlePostAndRedirectURLs( | 40 scoped_ptr<net::test_server::HttpResponse> HandlePostAndRedirectURLs( |
| 39 const std::string& request_path, | 41 const std::string& request_path, |
| 40 const net::test_server::HttpRequest& request) { | 42 const net::test_server::HttpRequest& request) { |
| 41 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 43 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
| 42 new net::test_server::BasicHttpResponse()); | 44 new net::test_server::BasicHttpResponse()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 EXPECT_TRUE(ExecuteScriptAndExtractString( | 97 EXPECT_TRUE(ExecuteScriptAndExtractString( |
| 96 shell()->web_contents(), | 98 shell()->web_contents(), |
| 97 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", | 99 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", |
| 98 kRedirectPostPath, | 100 kRedirectPostPath, |
| 99 kPayloadSize), | 101 kPayloadSize), |
| 100 &js_result)); | 102 &js_result)); |
| 101 EXPECT_EQ(js_result, "success"); | 103 EXPECT_EQ(js_result, "success"); |
| 102 } | 104 } |
| 103 | 105 |
| 104 } // namespace content | 106 } // namespace content |
| OLD | NEW |