| OLD | NEW |
| 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/common/net/net_error_info.h" | 7 #include "chrome/common/net/net_error_info.h" |
| 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_, | 69 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_, |
| 70 bogus_url_, // validated_url | 70 bogus_url_, // validated_url |
| 71 (error_page == ERROR_PAGE), | 71 (error_page == ERROR_PAGE), |
| 72 false); // is_iframe_srcdoc | 72 false); // is_iframe_srcdoc |
| 73 } | 73 } |
| 74 | 74 |
| 75 void CommitProvisionalLoad(MainFrame main_frame) { | 75 void CommitProvisionalLoad(MainFrame main_frame) { |
| 76 tab_helper_->DidCommitProvisionalLoadForFrame( | 76 tab_helper_->DidCommitProvisionalLoadForFrame( |
| 77 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_, | 77 (main_frame == MAIN_FRAME) ? main_rfh() : subframe_, |
| 78 bogus_url_, // url | 78 bogus_url_, // url |
| 79 true, // url_is_unreachable |
| 79 ui::PAGE_TRANSITION_TYPED); | 80 ui::PAGE_TRANSITION_TYPED); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void FailProvisionalLoad(MainFrame main_frame, ErrorType error_type) { | 83 void FailProvisionalLoad(MainFrame main_frame, ErrorType error_type) { |
| 83 int net_error; | 84 int net_error; |
| 84 | 85 |
| 85 if (error_type == DNS_ERROR) | 86 if (error_type == DNS_ERROR) |
| 86 net_error = net::ERR_NAME_NOT_RESOLVED; | 87 net_error = net::ERR_NAME_NOT_RESOLVED; |
| 87 else | 88 else |
| 88 net_error = net::ERR_TIMED_OUT; | 89 net_error = net::ERR_TIMED_OUT; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 CommitProvisionalLoad(MAIN_FRAME); | 374 CommitProvisionalLoad(MAIN_FRAME); |
| 374 EXPECT_TRUE(probe_running()); | 375 EXPECT_TRUE(probe_running()); |
| 375 EXPECT_EQ(3, sent_count()); | 376 EXPECT_EQ(3, sent_count()); |
| 376 EXPECT_EQ(chrome_common_net::DNS_PROBE_STARTED, last_status_sent()); | 377 EXPECT_EQ(chrome_common_net::DNS_PROBE_STARTED, last_status_sent()); |
| 377 | 378 |
| 378 FinishProbe(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN); | 379 FinishProbe(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN); |
| 379 EXPECT_FALSE(probe_running()); | 380 EXPECT_FALSE(probe_running()); |
| 380 EXPECT_EQ(4, sent_count()); | 381 EXPECT_EQ(4, sent_count()); |
| 381 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN, last_status_sent()); | 382 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN, last_status_sent()); |
| 382 } | 383 } |
| OLD | NEW |