| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/files/file_util.h" | 5 #include "base/files/file_util.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "content/browser/loader/test_url_loader_client.h" | 10 #include "content/browser/loader/test_url_loader_client.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 void Load(const GURL& url, | 72 void Load(const GURL& url, |
| 73 TestURLLoaderClient* client, | 73 TestURLLoaderClient* client, |
| 74 uint32_t options = 0) { | 74 uint32_t options = 0) { |
| 75 mojom::URLLoaderAssociatedPtr loader; | 75 mojom::URLLoaderAssociatedPtr loader; |
| 76 | 76 |
| 77 ResourceRequest request = | 77 ResourceRequest request = |
| 78 CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME, url); | 78 CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME, url); |
| 79 | 79 |
| 80 URLLoaderImpl loader_impl(context(), mojo::MakeIsolatedRequest(&loader), | 80 URLLoaderImpl loader_impl(context(), options, request); |
| 81 options, request, client->CreateInterfacePtr()); | 81 loader_impl.Start(mojo::MakeIsolatedRequest(&loader), |
| 82 client->CreateInterfacePtr()); |
| 82 | 83 |
| 83 client->RunUntilComplete(); | 84 client->RunUntilComplete(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void LoadAndCompareFile(const std::string& path) { | 87 void LoadAndCompareFile(const std::string& path) { |
| 87 TestURLLoaderClient client; | 88 TestURLLoaderClient client; |
| 88 GURL url = test_server()->GetURL(std::string("/") + path); | 89 GURL url = test_server()->GetURL(std::string("/") + path); |
| 89 Load(url, &client); | 90 Load(url, &client); |
| 90 | 91 |
| 91 base::FilePath file; | 92 base::FilePath file; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 139 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); |
| 139 ASSERT_TRUE(https_server.Start()); | 140 ASSERT_TRUE(https_server.Start()); |
| 140 | 141 |
| 141 TestURLLoaderClient client; | 142 TestURLLoaderClient client; |
| 142 GURL url = https_server.GetURL("/simple_page.html"); | 143 GURL url = https_server.GetURL("/simple_page.html"); |
| 143 Load(url, &client, 0); | 144 Load(url, &client, 0); |
| 144 ASSERT_FALSE(!!client.ssl_info()); | 145 ASSERT_FALSE(!!client.ssl_info()); |
| 145 } | 146 } |
| 146 | 147 |
| 147 } // namespace content | 148 } // namespace content |
| OLD | NEW |