OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/renderer/resource_fetcher.h" | 5 #include "content/public/renderer/resource_fetcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 // timeout in 0 sec. | 324 // timeout in 0 sec. |
325 ASSERT_TRUE(test_server()->Start()); | 325 ASSERT_TRUE(test_server()->Start()); |
326 GURL url(test_server()->GetURL("slow?1")); | 326 GURL url(test_server()->GetURL("slow?1")); |
327 | 327 |
328 PostTaskToInProcessRendererAndWait( | 328 PostTaskToInProcessRendererAndWait( |
329 base::Bind( | 329 base::Bind( |
330 &ResourceFetcherTests::ResourceFetcherDeletedInCallbackOnRenderer, | 330 &ResourceFetcherTests::ResourceFetcherDeletedInCallbackOnRenderer, |
331 base::Unretained(this), url)); | 331 base::Unretained(this), url)); |
332 } | 332 } |
333 | 333 |
334 | |
335 #if defined(OS_ANDROID) | |
336 // disable these two tests on android to enable content_browsertest | |
Paweł Hajdan Jr.
2014/02/05 22:42:41
Please reference the bug (http://crbug.com/...).
| |
337 #define MAYBE_ResourceFetcherPost DISABLED_ResourceFetcherPost | |
338 #define MAYBE_ResourceFetcherSetHeader DISABLED_ResourceFetcherSetHeader | |
339 #else | |
340 #define MAYBE_ResourceFetcherPost ResourceFetcherPost | |
341 #define MAYBE_ResourceFetcherSetHeader ResourceFetcherSetHeader | |
342 #endif | |
343 | |
334 // Test that ResourceFetchers can handle POSTs. | 344 // Test that ResourceFetchers can handle POSTs. |
335 IN_PROC_BROWSER_TEST_F(ResourceFetcherTests, ResourceFetcherPost) { | 345 IN_PROC_BROWSER_TEST_F(ResourceFetcherTests, MAYBE_ResourceFetcherPost) { |
336 // Need to spin up the renderer. | 346 // Need to spin up the renderer. |
337 NavigateToURL(shell(), GURL(kAboutBlankURL)); | 347 NavigateToURL(shell(), GURL(kAboutBlankURL)); |
338 | 348 |
339 // Grab a page that echos the POST body. | 349 // Grab a page that echos the POST body. |
340 ASSERT_TRUE(test_server()->Start()); | 350 ASSERT_TRUE(test_server()->Start()); |
341 GURL url(test_server()->GetURL("echo")); | 351 GURL url(test_server()->GetURL("echo")); |
342 | 352 |
343 PostTaskToInProcessRendererAndWait( | 353 PostTaskToInProcessRendererAndWait( |
344 base::Bind( | 354 base::Bind( |
345 &ResourceFetcherTests::ResourceFetcherPost, | 355 &ResourceFetcherTests::ResourceFetcherPost, |
346 base::Unretained(this), url)); | 356 base::Unretained(this), url)); |
347 } | 357 } |
348 | 358 |
349 // Test that ResourceFetchers can set headers. | 359 // Test that ResourceFetchers can set headers. |
350 IN_PROC_BROWSER_TEST_F(ResourceFetcherTests, ResourceFetcherSetHeader) { | 360 IN_PROC_BROWSER_TEST_F(ResourceFetcherTests, MAYBE_ResourceFetcherSetHeader) { |
351 // Need to spin up the renderer. | 361 // Need to spin up the renderer. |
352 NavigateToURL(shell(), GURL(kAboutBlankURL)); | 362 NavigateToURL(shell(), GURL(kAboutBlankURL)); |
353 | 363 |
354 // Grab a page that echos the POST body. | 364 // Grab a page that echos the POST body. |
355 ASSERT_TRUE(test_server()->Start()); | 365 ASSERT_TRUE(test_server()->Start()); |
356 GURL url(test_server()->GetURL("echoheader?header")); | 366 GURL url(test_server()->GetURL("echoheader?header")); |
357 | 367 |
358 PostTaskToInProcessRendererAndWait( | 368 PostTaskToInProcessRendererAndWait( |
359 base::Bind( | 369 base::Bind( |
360 &ResourceFetcherTests::ResourceFetcherSetHeader, | 370 &ResourceFetcherTests::ResourceFetcherSetHeader, |
361 base::Unretained(this), url)); | 371 base::Unretained(this), url)); |
362 } | 372 } |
363 | 373 |
364 } // namespace content | 374 } // namespace content |
OLD | NEW |