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

Side by Side Diff: ios/web/net/crw_ssl_status_updater_unittest.mm

Issue 2794723002: Create new pending item if UserAgentOverrideOption is not INHERIT. (Closed)
Patch Set: Rebase Created 3 years, 8 months 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
« no previous file with comments | « ios/web/navigation/navigation_manager_impl_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "ios/web/net/crw_ssl_status_updater.h" 5 #import "ios/web/net/crw_ssl_status_updater.h"
6 6
7 #include "base/mac/scoped_block.h" 7 #include "base/mac/scoped_block.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" 9 #import "ios/web/navigation/crw_session_controller+private_constructors.h"
10 #import "ios/web/navigation/crw_session_controller.h" 10 #import "ios/web/navigation/crw_session_controller.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 // Returns autoreleased session controller with a single committed entry. 104 // Returns autoreleased session controller with a single committed entry.
105 CRWSessionController* SessionControllerWithEntry(std::string item_url_spec) { 105 CRWSessionController* SessionControllerWithEntry(std::string item_url_spec) {
106 std::vector<std::unique_ptr<web::NavigationItem>> nav_items; 106 std::vector<std::unique_ptr<web::NavigationItem>> nav_items;
107 base::scoped_nsobject<CRWSessionController> session_controller( 107 base::scoped_nsobject<CRWSessionController> session_controller(
108 [[CRWSessionController alloc] initWithBrowserState:GetBrowserState() 108 [[CRWSessionController alloc] initWithBrowserState:GetBrowserState()
109 navigationItems:std::move(nav_items) 109 navigationItems:std::move(nav_items)
110 lastCommittedItemIndex:0]); 110 lastCommittedItemIndex:0]);
111 [session_controller 111 [session_controller
112 addPendingItem:GURL(item_url_spec) 112 addPendingItem:GURL(item_url_spec)
113 referrer:Referrer() 113 referrer:Referrer()
114 transition:ui::PAGE_TRANSITION_LINK 114 transition:ui::PAGE_TRANSITION_LINK
115 initiationType:web::NavigationInitiationType::USER_INITIATED]; 115 initiationType:web::NavigationInitiationType::USER_INITIATED
116 userAgentOverrideOption:NavigationManager::UserAgentOverrideOption::
117 INHERIT];
116 [session_controller commitPendingItem]; 118 [session_controller commitPendingItem];
117 119
118 return session_controller.autorelease(); 120 return session_controller.autorelease();
119 } 121 }
120 122
121 base::scoped_nsobject<CRWSSLStatusUpdaterTestDataSource> data_source_; 123 base::scoped_nsobject<CRWSSLStatusUpdaterTestDataSource> data_source_;
122 base::scoped_nsprotocol<id> delegate_; 124 base::scoped_nsprotocol<id> delegate_;
123 std::unique_ptr<web::NavigationManagerImpl> nav_manager_; 125 std::unique_ptr<web::NavigationManagerImpl> nav_manager_;
124 base::scoped_nsobject<CRWSSLStatusUpdater> ssl_status_updater_; 126 base::scoped_nsobject<CRWSSLStatusUpdater> ssl_status_updater_;
125 base::ScopedCFTypeRef<SecTrustRef> trust_; 127 base::ScopedCFTypeRef<SecTrustRef> trust_;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 [data_source_ 359 [data_source_
358 finishVerificationWithCertStatus:0 360 finishVerificationWithCertStatus:0
359 securityStyle:web::SECURITY_STYLE_AUTHENTICATED]; 361 securityStyle:web::SECURITY_STYLE_AUTHENTICATED];
360 362
361 // Make sure that security style and content status did change. 363 // Make sure that security style and content status did change.
362 EXPECT_EQ(web::SECURITY_STYLE_UNKNOWN, item->GetSSL().security_style); 364 EXPECT_EQ(web::SECURITY_STYLE_UNKNOWN, item->GetSSL().security_style);
363 EXPECT_EQ(web::SSLStatus::NORMAL_CONTENT, item->GetSSL().content_status); 365 EXPECT_EQ(web::SSLStatus::NORMAL_CONTENT, item->GetSSL().content_status);
364 } 366 }
365 367
366 } // namespace web 368 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698