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

Side by Side Diff: chrome/browser/net/net_error_tab_helper_unittest.cc

Issue 1194383003: Add a flag showing whether the current request was ignored by a handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot failures (DidFailProvisionalLoad calls in unit tests) Created 5 years, 6 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 | « chrome/browser/net/net_error_tab_helper.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/net/net_error_tab_helper.h" 5 #include "chrome/browser/net/net_error_tab_helper.h"
6 6
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
8 #include "components/error_page/common/net_error_info.h" 8 #include "components/error_page/common/net_error_info.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/test/test_renderer_host.h" 10 #include "content/public/test/test_renderer_host.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 if (error_type == DNS_ERROR) 93 if (error_type == DNS_ERROR)
94 net_error = net::ERR_NAME_NOT_RESOLVED; 94 net_error = net::ERR_NAME_NOT_RESOLVED;
95 else 95 else
96 net_error = net::ERR_TIMED_OUT; 96 net_error = net::ERR_TIMED_OUT;
97 97
98 tab_helper_->DidFailProvisionalLoad( 98 tab_helper_->DidFailProvisionalLoad(
99 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_, 99 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_,
100 bogus_url_, // validated_url 100 bogus_url_, // validated_url
101 net_error, 101 net_error,
102 base::string16()); 102 base::string16(),
103 false);
103 } 104 }
104 105
105 void FinishProbe(DnsProbeStatus status) { tab_helper_->FinishProbe(status); } 106 void FinishProbe(DnsProbeStatus status) { tab_helper_->FinishProbe(status); }
106 107
107 bool probe_running() { return tab_helper_->mock_probe_running(); } 108 bool probe_running() { return tab_helper_->mock_probe_running(); }
108 DnsProbeStatus last_status_sent() { return tab_helper_->last_status_sent(); } 109 DnsProbeStatus last_status_sent() { return tab_helper_->last_status_sent(); }
109 int sent_count() { return tab_helper_->mock_sent_count(); } 110 int sent_count() { return tab_helper_->mock_sent_count(); }
110 111
111 private: 112 private:
112 content::RenderFrameHost* subframe_; 113 content::RenderFrameHost* subframe_;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 CommitProvisionalLoad(MAIN_FRAME); 382 CommitProvisionalLoad(MAIN_FRAME);
382 EXPECT_TRUE(probe_running()); 383 EXPECT_TRUE(probe_running());
383 EXPECT_EQ(3, sent_count()); 384 EXPECT_EQ(3, sent_count());
384 EXPECT_EQ(chrome_common_net::DNS_PROBE_STARTED, last_status_sent()); 385 EXPECT_EQ(chrome_common_net::DNS_PROBE_STARTED, last_status_sent());
385 386
386 FinishProbe(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN); 387 FinishProbe(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
387 EXPECT_FALSE(probe_running()); 388 EXPECT_FALSE(probe_running());
388 EXPECT_EQ(4, sent_count()); 389 EXPECT_EQ(4, sent_count());
389 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN, last_status_sent()); 390 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN, last_status_sent());
390 } 391 }
OLDNEW
« no previous file with comments | « chrome/browser/net/net_error_tab_helper.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698