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

Side by Side Diff: ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm

Issue 2779263002: Set user agent type of transient item the same as pending item. (Closed)
Patch Set: Address comments 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 | « no previous file | ios/web/interstitials/web_interstitial_impl.mm » ('j') | 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 #include "ios/chrome/browser/ssl/ios_ssl_error_handler.h" 5 #include "ios/chrome/browser/ssl/ios_ssl_error_handler.h"
6 6
7 #include "base/mac/bind_objc_block.h" 7 #include "base/mac/bind_objc_block.h"
8 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" 8 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
9 #include "ios/web/public/interstitials/web_interstitial.h" 9 #include "ios/web/public/interstitials/web_interstitial.h"
10 #import "ios/web/public/test/web_test_with_web_state.h" 10 #import "ios/web/public/test/web_test_with_web_state.h"
(...skipping 17 matching lines...) Expand all
28 IOSSSLErrorHandlerTest() 28 IOSSSLErrorHandlerTest()
29 : browser_state_(builder_.Build()), 29 : browser_state_(builder_.Build()),
30 cert_(net::ImportCertFromFile(net::GetTestCertsDirectory(), 30 cert_(net::ImportCertFromFile(net::GetTestCertsDirectory(),
31 kTestCertFileName)) {} 31 kTestCertFileName)) {}
32 32
33 // web::WebTestWithWebState overrides: 33 // web::WebTestWithWebState overrides:
34 void SetUp() override { 34 void SetUp() override {
35 web::WebTestWithWebState::SetUp(); 35 web::WebTestWithWebState::SetUp();
36 ASSERT_TRUE(cert_); 36 ASSERT_TRUE(cert_);
37 ASSERT_FALSE(web_state()->IsShowingWebInterstitial()); 37 ASSERT_FALSE(web_state()->IsShowingWebInterstitial());
38
39 // Transient item can only be added for pending non-app-specific loads.
40 AddPendingItem(GURL(kTestHostName),
41 ui::PageTransition::PAGE_TRANSITION_TYPED);
38 } 42 }
39 web::BrowserState* GetBrowserState() override { return browser_state_.get(); } 43 web::BrowserState* GetBrowserState() override { return browser_state_.get(); }
40 44
41 // Returns certificate for testing. 45 // Returns certificate for testing.
42 scoped_refptr<net::X509Certificate> cert() { return cert_; } 46 scoped_refptr<net::X509Certificate> cert() { return cert_; }
43 47
44 private: 48 private:
45 TestChromeBrowserState::Builder builder_; 49 TestChromeBrowserState::Builder builder_;
46 std::unique_ptr<TestChromeBrowserState> browser_state_; 50 std::unique_ptr<TestChromeBrowserState> browser_state_;
47 scoped_refptr<net::X509Certificate> cert_; 51 scoped_refptr<net::X509Certificate> cert_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 113
110 // Make sure that interstitial is displayed. 114 // Make sure that interstitial is displayed.
111 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); 115 EXPECT_TRUE(web_state()->IsShowingWebInterstitial());
112 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); 116 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial();
113 EXPECT_TRUE(interstitial); 117 EXPECT_TRUE(interstitial);
114 118
115 // Make sure callback is called on dismissal. 119 // Make sure callback is called on dismissal.
116 interstitial->DontProceed(); 120 interstitial->DontProceed();
117 EXPECT_TRUE(do_not_proceed_callback_called); 121 EXPECT_TRUE(do_not_proceed_callback_called);
118 } 122 }
OLDNEW
« no previous file with comments | « no previous file | ios/web/interstitials/web_interstitial_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698