| 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 <queue> | 5 #include <queue> | 
| 6 | 6 | 
| 7 #include "base/location.h" | 7 #include "base/location.h" | 
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" | 
| 9 #include "base/process/process.h" | 9 #include "base/process/process.h" | 
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" | 
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 107 using ui::MenuModel; | 107 using ui::MenuModel; | 
| 108 | 108 | 
| 109 namespace { | 109 namespace { | 
| 110 const char kEmptyResponsePath[] = "/close-socket"; | 110 const char kEmptyResponsePath[] = "/close-socket"; | 
| 111 const char kRedirectResponsePath[] = "/server-redirect"; | 111 const char kRedirectResponsePath[] = "/server-redirect"; | 
| 112 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; | 112 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; | 
| 113 const char kCacheResponsePath[] = "/cache-control-response"; | 113 const char kCacheResponsePath[] = "/cache-control-response"; | 
| 114 const char kRedirectResponseFullPath[] = | 114 const char kRedirectResponseFullPath[] = | 
| 115     "/extensions/platform_apps/web_view/shim/guest_redirect.html"; | 115     "/extensions/platform_apps/web_view/shim/guest_redirect.html"; | 
| 116 | 116 | 
|  | 117 class EmptyHttpResponse : public net::test_server::HttpResponse { | 
|  | 118  public: | 
|  | 119   std::string ToResponseString() const override { return std::string(); } | 
|  | 120 }; | 
|  | 121 | 
| 117 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { | 122 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { | 
| 118  public: | 123  public: | 
| 119   TestInterstitialPageDelegate() { | 124   TestInterstitialPageDelegate() { | 
| 120   } | 125   } | 
| 121   ~TestInterstitialPageDelegate() override {} | 126   ~TestInterstitialPageDelegate() override {} | 
| 122   std::string GetHTMLContents() override { return std::string(); } | 127   std::string GetHTMLContents() override { return std::string(); } | 
| 123 }; | 128 }; | 
| 124 | 129 | 
| 125 class WebContentsHiddenObserver : public content::WebContentsObserver { | 130 class WebContentsHiddenObserver : public content::WebContentsObserver { | 
| 126  public: | 131  public: | 
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 442     http_response->AddCustomHeader("Location", redirect_target.spec()); | 447     http_response->AddCustomHeader("Location", redirect_target.spec()); | 
| 443     return http_response.Pass(); | 448     return http_response.Pass(); | 
| 444   } | 449   } | 
| 445 | 450 | 
| 446   // Handles |request| by serving an empty response. | 451   // Handles |request| by serving an empty response. | 
| 447   static scoped_ptr<net::test_server::HttpResponse> EmptyResponseHandler( | 452   static scoped_ptr<net::test_server::HttpResponse> EmptyResponseHandler( | 
| 448       const std::string& path, | 453       const std::string& path, | 
| 449       const net::test_server::HttpRequest& request) { | 454       const net::test_server::HttpRequest& request) { | 
| 450     if (base::StartsWith(path, request.relative_url, | 455     if (base::StartsWith(path, request.relative_url, | 
| 451                          base::CompareCase::SENSITIVE)) | 456                          base::CompareCase::SENSITIVE)) | 
| 452       return scoped_ptr<net::test_server::HttpResponse>( | 457       return scoped_ptr<net::test_server::HttpResponse>(new EmptyHttpResponse); | 
| 453           new net::test_server::RawHttpResponse("", "")); |  | 
| 454 | 458 | 
| 455     return scoped_ptr<net::test_server::HttpResponse>(); | 459     return scoped_ptr<net::test_server::HttpResponse>(); | 
| 456   } | 460   } | 
| 457 | 461 | 
| 458   // Handles |request| by serving cache-able response. | 462   // Handles |request| by serving cache-able response. | 
| 459   static scoped_ptr<net::test_server::HttpResponse> CacheControlResponseHandler( | 463   static scoped_ptr<net::test_server::HttpResponse> CacheControlResponseHandler( | 
| 460       const std::string& path, | 464       const std::string& path, | 
| 461       const net::test_server::HttpRequest& request) { | 465       const net::test_server::HttpRequest& request) { | 
| 462     if (!base::StartsWith(path, request.relative_url, | 466     if (!base::StartsWith(path, request.relative_url, | 
| 463                           base::CompareCase::SENSITIVE)) | 467                           base::CompareCase::SENSITIVE)) | 
| (...skipping 2507 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2971   // 4 tasks expected. The order is arbitrary. | 2975   // 4 tasks expected. The order is arbitrary. | 
| 2972   // Tab: about:blank, | 2976   // Tab: about:blank, | 
| 2973   // Background Page: <webview> task manager test, | 2977   // Background Page: <webview> task manager test, | 
| 2974   // App: <webview> task manager test, | 2978   // App: <webview> task manager test, | 
| 2975   // Webview: WebViewed test content. | 2979   // Webview: WebViewed test content. | 
| 2976   EXPECT_EQ(4U, task_manager.tasks().size()); | 2980   EXPECT_EQ(4U, task_manager.tasks().size()); | 
| 2977   EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); | 2981   EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); | 
| 2978 } | 2982 } | 
| 2979 | 2983 | 
| 2980 #endif  // defined(ENABLE_TASK_MANAGER) | 2984 #endif  // defined(ENABLE_TASK_MANAGER) | 
| OLD | NEW | 
|---|