| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_apitest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_apitest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 const char kRedirectResponsePath[] = "/server-redirect"; | 43 const char kRedirectResponsePath[] = "/server-redirect"; |
| 44 const char kRedirectResponseFullPath[] = "/guest_redirect.html"; | 44 const char kRedirectResponseFullPath[] = "/guest_redirect.html"; |
| 45 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; | 45 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; |
| 46 const char kTestDataDirectory[] = "testDataDirectory"; | 46 const char kTestDataDirectory[] = "testDataDirectory"; |
| 47 const char kTestServerPort[] = "testServer.port"; | 47 const char kTestServerPort[] = "testServer.port"; |
| 48 const char kTestWebSocketPort[] = "testWebSocketPort"; | 48 const char kTestWebSocketPort[] = "testWebSocketPort"; |
| 49 const char kSitePerProcess[] = "sitePerProcess"; | 49 const char kSitePerProcess[] = "sitePerProcess"; |
| 50 | 50 |
| 51 class EmptyHttpResponse : public net::test_server::HttpResponse { | 51 class EmptyHttpResponse : public net::test_server::HttpResponse { |
| 52 public: | 52 public: |
| 53 std::string ToResponseString() const override { return std::string(); } | 53 void SendResponse( |
| 54 const net::test_server::SendBytesCallback& send, |
| 55 const net::test_server::SendCompleteCallback& done) override { |
| 56 send.Run("", done); |
| 57 } |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 // Handles |request| by serving a redirect response if the |User-Agent| is | 60 // Handles |request| by serving a redirect response if the |User-Agent| is |
| 57 // foobar. | 61 // foobar. |
| 58 static scoped_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( | 62 static scoped_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( |
| 59 const std::string& path, | 63 const std::string& path, |
| 60 const GURL& redirect_target, | 64 const GURL& redirect_target, |
| 61 const net::test_server::HttpRequest& request) { | 65 const net::test_server::HttpRequest& request) { |
| 62 if (!base::StartsWith(path, request.relative_url, | 66 if (!base::StartsWith(path, request.relative_url, |
| 63 base::CompareCase::SENSITIVE)) | 67 base::CompareCase::SENSITIVE)) |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 733 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); |
| 730 } | 734 } |
| 731 | 735 |
| 732 // This test verifies that webview.contentWindow works inside an iframe | 736 // This test verifies that webview.contentWindow works inside an iframe |
| 733 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { | 737 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { |
| 734 LaunchApp("web_view/inside_iframe"); | 738 LaunchApp("web_view/inside_iframe"); |
| 735 } | 739 } |
| 736 | 740 |
| 737 | 741 |
| 738 } // namespace extensions | 742 } // namespace extensions |
| OLD | NEW |