| 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(net::test_server::SendCallback send, | 
|  | 54                     net::test_server::SendDoneCallback done) override { | 
|  | 55     send.Run("", done); | 
|  | 56   } | 
| 54 }; | 57 }; | 
| 55 | 58 | 
| 56 // Handles |request| by serving a redirect response if the |User-Agent| is | 59 // Handles |request| by serving a redirect response if the |User-Agent| is | 
| 57 // foobar. | 60 // foobar. | 
| 58 static scoped_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( | 61 static scoped_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( | 
| 59     const std::string& path, | 62     const std::string& path, | 
| 60     const GURL& redirect_target, | 63     const GURL& redirect_target, | 
| 61     const net::test_server::HttpRequest& request) { | 64     const net::test_server::HttpRequest& request) { | 
| 62   if (!base::StartsWith(path, request.relative_url, | 65   if (!base::StartsWith(path, request.relative_url, | 
| 63                         base::CompareCase::SENSITIVE)) | 66                         base::CompareCase::SENSITIVE)) | 
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 729   RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 732   RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 
| 730 } | 733 } | 
| 731 | 734 | 
| 732 // This test verifies that webview.contentWindow works inside an iframe | 735 // This test verifies that webview.contentWindow works inside an iframe | 
| 733 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { | 736 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { | 
| 734   LaunchApp("web_view/inside_iframe"); | 737   LaunchApp("web_view/inside_iframe"); | 
| 735 } | 738 } | 
| 736 | 739 | 
| 737 | 740 | 
| 738 }  // namespace extensions | 741 }  // namespace extensions | 
| OLD | NEW | 
|---|