OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 std::map<std::string, std::string>::const_iterator it = | 483 std::map<std::string, std::string>::const_iterator it = |
484 request.headers.find("User-Agent"); | 484 request.headers.find("User-Agent"); |
485 EXPECT_TRUE(it != request.headers.end()); | 485 EXPECT_TRUE(it != request.headers.end()); |
486 if (!StartsWithASCII("foobar", it->second, true)) | 486 if (!StartsWithASCII("foobar", it->second, true)) |
487 return scoped_ptr<net::test_server::HttpResponse>(); | 487 return scoped_ptr<net::test_server::HttpResponse>(); |
488 | 488 |
489 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 489 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
490 new net::test_server::BasicHttpResponse); | 490 new net::test_server::BasicHttpResponse); |
491 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); | 491 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); |
492 http_response->AddCustomHeader("Location", redirect_target.spec()); | 492 http_response->AddCustomHeader("Location", redirect_target.spec()); |
493 return http_response.PassAs<net::test_server::HttpResponse>(); | 493 return http_response.Pass(); |
494 } | 494 } |
495 | 495 |
496 // Handles |request| by serving a redirect response. | 496 // Handles |request| by serving a redirect response. |
497 static scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler( | 497 static scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler( |
498 const std::string& path, | 498 const std::string& path, |
499 const GURL& redirect_target, | 499 const GURL& redirect_target, |
500 const net::test_server::HttpRequest& request) { | 500 const net::test_server::HttpRequest& request) { |
501 if (!StartsWithASCII(path, request.relative_url, true)) | 501 if (!StartsWithASCII(path, request.relative_url, true)) |
502 return scoped_ptr<net::test_server::HttpResponse>(); | 502 return scoped_ptr<net::test_server::HttpResponse>(); |
503 | 503 |
504 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 504 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
505 new net::test_server::BasicHttpResponse); | 505 new net::test_server::BasicHttpResponse); |
506 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); | 506 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); |
507 http_response->AddCustomHeader("Location", redirect_target.spec()); | 507 http_response->AddCustomHeader("Location", redirect_target.spec()); |
508 return http_response.PassAs<net::test_server::HttpResponse>(); | 508 return http_response.Pass(); |
509 } | 509 } |
510 | 510 |
511 // Handles |request| by serving an empty response. | 511 // Handles |request| by serving an empty response. |
512 static scoped_ptr<net::test_server::HttpResponse> EmptyResponseHandler( | 512 static scoped_ptr<net::test_server::HttpResponse> EmptyResponseHandler( |
513 const std::string& path, | 513 const std::string& path, |
514 const net::test_server::HttpRequest& request) { | 514 const net::test_server::HttpRequest& request) { |
515 if (StartsWithASCII(path, request.relative_url, true)) { | 515 if (StartsWithASCII(path, request.relative_url, true)) { |
516 return scoped_ptr<net::test_server::HttpResponse>( | 516 return scoped_ptr<net::test_server::HttpResponse>( |
517 new EmptyHttpResponse); | 517 new EmptyHttpResponse); |
518 } | 518 } |
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 // http://crbug.com/403325 | 2307 // http://crbug.com/403325 |
2308 #define MAYBE_WebViewInBackgroundPage \ | 2308 #define MAYBE_WebViewInBackgroundPage \ |
2309 DISABLED_WebViewInBackgroundPage | 2309 DISABLED_WebViewInBackgroundPage |
2310 #else | 2310 #else |
2311 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage | 2311 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage |
2312 #endif | 2312 #endif |
2313 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { | 2313 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { |
2314 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) | 2314 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) |
2315 << message_; | 2315 << message_; |
2316 } | 2316 } |
OLD | NEW |