Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 // Creates and drives a main resource request until completion. Then asserts 1075 // Creates and drives a main resource request until completion. Then asserts
1076 // that the expected_error_code has been emitted for the request. 1076 // that the expected_error_code has been emitted for the request.
1077 void CompleteFailingMainResourceRequest(const GURL& url, 1077 void CompleteFailingMainResourceRequest(const GURL& url,
1078 int expected_error_code) { 1078 int expected_error_code) {
1079 if (IsBrowserSideNavigationEnabled()) { 1079 if (IsBrowserSideNavigationEnabled()) {
1080 auto_advance_ = true; 1080 auto_advance_ = true;
1081 1081
1082 // Make a navigation request. 1082 // Make a navigation request.
1083 TestNavigationURLLoaderDelegate delegate; 1083 TestNavigationURLLoaderDelegate delegate;
1084 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, 1084 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false,
1085 false, REQUEST_CONTEXT_TYPE_LOCATION); 1085 REQUEST_CONTEXT_TYPE_LOCATION);
1086 CommonNavigationParams common_params; 1086 CommonNavigationParams common_params;
1087 common_params.url = url; 1087 common_params.url = url;
1088 std::unique_ptr<NavigationRequestInfo> request_info( 1088 std::unique_ptr<NavigationRequestInfo> request_info(
1089 new NavigationRequestInfo(common_params, begin_params, url, 1089 new NavigationRequestInfo(common_params, begin_params, url,
1090 url::Origin(url), true, false, false, -1, 1090 url::Origin(url), true, false, false, -1,
1091 false, false)); 1091 false, false));
1092 std::unique_ptr<NavigationURLLoader> test_loader = 1092 std::unique_ptr<NavigationURLLoader> test_loader =
1093 NavigationURLLoader::Create(browser_context_.get(), 1093 NavigationURLLoader::Create(browser_context_.get(),
1094 std::move(request_info), nullptr, nullptr, 1094 std::move(request_info), nullptr, nullptr,
1095 &delegate); 1095 &delegate);
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 SetResponse(raw_headers, response_data); 2632 SetResponse(raw_headers, response_data);
2633 job_factory_->SetDelayedCompleteJobGeneration(true); 2633 job_factory_->SetDelayedCompleteJobGeneration(true);
2634 HandleScheme("http"); 2634 HandleScheme("http");
2635 2635
2636 const GURL download_url = GURL("http://example.com/blah"); 2636 const GURL download_url = GURL("http://example.com/blah");
2637 2637
2638 if (IsBrowserSideNavigationEnabled()) { 2638 if (IsBrowserSideNavigationEnabled()) {
2639 // Create a NavigationRequest. 2639 // Create a NavigationRequest.
2640 TestNavigationURLLoaderDelegate delegate; 2640 TestNavigationURLLoaderDelegate delegate;
2641 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, 2641 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false,
2642 false, REQUEST_CONTEXT_TYPE_LOCATION); 2642 REQUEST_CONTEXT_TYPE_LOCATION);
2643 CommonNavigationParams common_params; 2643 CommonNavigationParams common_params;
2644 common_params.url = download_url; 2644 common_params.url = download_url;
2645 std::unique_ptr<NavigationRequestInfo> request_info( 2645 std::unique_ptr<NavigationRequestInfo> request_info(
2646 new NavigationRequestInfo(common_params, begin_params, download_url, 2646 new NavigationRequestInfo(common_params, begin_params, download_url,
2647 url::Origin(download_url), true, false, false, 2647 url::Origin(download_url), true, false, false,
2648 -1, false, false)); 2648 -1, false, false));
2649 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( 2649 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create(
2650 browser_context_.get(), std::move(request_info), nullptr, nullptr, 2650 browser_context_.get(), std::move(request_info), nullptr, nullptr,
2651 &delegate); 2651 &delegate);
2652 2652
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 return nullptr; 3936 return nullptr;
3937 } 3937 }
3938 3938
3939 INSTANTIATE_TEST_CASE_P( 3939 INSTANTIATE_TEST_CASE_P(
3940 ResourceDispatcherHostTests, 3940 ResourceDispatcherHostTests,
3941 ResourceDispatcherHostTest, 3941 ResourceDispatcherHostTest,
3942 testing::Values(TestConfig::kDefault, 3942 testing::Values(TestConfig::kDefault,
3943 TestConfig::kOptimizeIPCForSmallResourceEnabled)); 3943 TestConfig::kOptimizeIPCForSmallResourceEnabled));
3944 3944
3945 } // namespace content 3945 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698