| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 int times_diagnostics_dialog_invoked() const { | 45 int times_diagnostics_dialog_invoked() const { |
| 46 return times_diagnostics_dialog_invoked_; | 46 return times_diagnostics_dialog_invoked_; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void SetCurrentTargetFrame(content::RenderFrameHost* render_frame_host) { | 49 void SetCurrentTargetFrame(content::RenderFrameHost* render_frame_host) { |
| 50 network_diagnostics_bindings_for_testing().SetCurrentTargetFrameForTesting( | 50 network_diagnostics_bindings_for_testing().SetCurrentTargetFrameForTesting( |
| 51 render_frame_host); | 51 render_frame_host); |
| 52 } | 52 } |
| 53 | 53 |
| 54 mojom::NetworkDiagnostics* network_diagnostics_interface() { return this; } | 54 chrome::mojom::NetworkDiagnostics* network_diagnostics_interface() { |
| 55 return this; |
| 56 } |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 // NetErrorTabHelper implementation: | 59 // NetErrorTabHelper implementation: |
| 58 | 60 |
| 59 void StartDnsProbe() override { | 61 void StartDnsProbe() override { |
| 60 EXPECT_FALSE(mock_probe_running_); | 62 EXPECT_FALSE(mock_probe_running_); |
| 61 mock_probe_running_ = true; | 63 mock_probe_running_ = true; |
| 62 } | 64 } |
| 63 | 65 |
| 64 void SendInfo() override { | 66 void SendInfo() override { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 "file://foo/bar", | 310 "file://foo/bar", |
| 309 }; | 311 }; |
| 310 | 312 |
| 311 for (const char* url : kUrls) { | 313 for (const char* url : kUrls) { |
| 312 tab_helper()->SetCurrentTargetFrame(web_contents()->GetMainFrame()); | 314 tab_helper()->SetCurrentTargetFrame(web_contents()->GetMainFrame()); |
| 313 tab_helper()->network_diagnostics_interface() | 315 tab_helper()->network_diagnostics_interface() |
| 314 ->RunNetworkDiagnostics(GURL(url)); | 316 ->RunNetworkDiagnostics(GURL(url)); |
| 315 EXPECT_EQ(0, tab_helper()->times_diagnostics_dialog_invoked()); | 317 EXPECT_EQ(0, tab_helper()->times_diagnostics_dialog_invoked()); |
| 316 } | 318 } |
| 317 } | 319 } |
| OLD | NEW |