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/render_messages.h" | 7 #include "chrome/common/render_messages.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 "components/error_page/common/net_error_info.h" | 9 #include "components/error_page/common/net_error_info.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 #include "content/public/browser/navigation_handle.h" | 11 #include "content/public/browser/navigation_handle.h" |
12 #include "content/public/test/test_renderer_host.h" | 12 #include "content/public/test/test_renderer_host.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
16 | 16 |
17 #undef NO_ERROR | 17 #undef NO_ERROR // Defined in winerror.h. |
18 | 18 |
19 using chrome_browser_net::NetErrorTabHelper; | 19 using chrome_browser_net::NetErrorTabHelper; |
20 using error_page::DnsProbeStatus; | 20 using error_page::DnsProbeStatus; |
21 | 21 |
22 class TestNetErrorTabHelper : public NetErrorTabHelper { | 22 class TestNetErrorTabHelper : public NetErrorTabHelper { |
23 public: | 23 public: |
24 explicit TestNetErrorTabHelper(content::WebContents* web_contents) | 24 explicit TestNetErrorTabHelper(content::WebContents* web_contents) |
25 : NetErrorTabHelper(web_contents), | 25 : NetErrorTabHelper(web_contents), |
26 mock_probe_running_(false), | 26 mock_probe_running_(false), |
27 last_status_sent_(error_page::DNS_PROBE_MAX), | 27 last_status_sent_(error_page::DNS_PROBE_MAX), |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 "file://foo/bar", | 308 "file://foo/bar", |
309 }; | 309 }; |
310 | 310 |
311 for (const char* url : kUrls) { | 311 for (const char* url : kUrls) { |
312 tab_helper()->SetCurrentTargetFrame(web_contents()->GetMainFrame()); | 312 tab_helper()->SetCurrentTargetFrame(web_contents()->GetMainFrame()); |
313 tab_helper()->network_diagnostics_interface() | 313 tab_helper()->network_diagnostics_interface() |
314 ->RunNetworkDiagnostics(GURL(url)); | 314 ->RunNetworkDiagnostics(GURL(url)); |
315 EXPECT_EQ(0, tab_helper()->times_diagnostics_dialog_invoked()); | 315 EXPECT_EQ(0, tab_helper()->times_diagnostics_dialog_invoked()); |
316 } | 316 } |
317 } | 317 } |
OLD | NEW |