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. |
mmenke
2015/10/30 15:35:37
Add comment about OSX being slow, too, and a bug l
| |
32 #if defined(THREAD_SANITIZER) | 32 #if defined(THREAD_SANITIZER) || defined(OS_MACOSX) |
33 const size_t kPayloadSize = 1062882; // 2*3^12 | 33 const size_t kPayloadSize = 1062882; // 2*3^12 |
34 #else | 34 #else |
35 const size_t kPayloadSize = 28697814; // 2*3^15 | 35 const size_t kPayloadSize = 28697814; // 2*3^15 |
36 #endif | 36 #endif |
37 | 37 |
38 scoped_ptr<net::test_server::HttpResponse> HandlePostAndRedirectURLs( | 38 scoped_ptr<net::test_server::HttpResponse> HandlePostAndRedirectURLs( |
39 const std::string& request_path, | 39 const std::string& request_path, |
40 const net::test_server::HttpRequest& request) { | 40 const net::test_server::HttpRequest& request) { |
41 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 41 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
42 new net::test_server::BasicHttpResponse()); | 42 new net::test_server::BasicHttpResponse()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 EXPECT_TRUE(ExecuteScriptAndExtractString( | 95 EXPECT_TRUE(ExecuteScriptAndExtractString( |
96 shell()->web_contents(), | 96 shell()->web_contents(), |
97 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", | 97 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", |
98 kRedirectPostPath, | 98 kRedirectPostPath, |
99 kPayloadSize), | 99 kPayloadSize), |
100 &js_result)); | 100 &js_result)); |
101 EXPECT_EQ(js_result, "success"); | 101 EXPECT_EQ(js_result, "success"); |
102 } | 102 } |
103 | 103 |
104 } // namespace content | 104 } // namespace content |
OLD | NEW |