Chromium Code Reviews| Index: content/browser/host_zoom_map_impl_browsertest.cc |
| diff --git a/content/browser/host_zoom_map_impl_browsertest.cc b/content/browser/host_zoom_map_impl_browsertest.cc |
| index fbfdc3c62e54886f54c3c429c3dfd4062217baa8..d0b9a8d8cf223cdfa3f6fbac0e26baecf0afc28a 100644 |
| --- a/content/browser/host_zoom_map_impl_browsertest.cc |
| +++ b/content/browser/host_zoom_map_impl_browsertest.cc |
| @@ -8,12 +8,19 @@ |
| #include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/test/content_browser_test.h" |
| +#include "content/public/test/content_browser_test_utils.h" |
| #include "content/shell/browser/shell.h" |
| +#include "net/dns/mock_host_resolver.h" |
| #include "url/gurl.h" |
| namespace content { |
| class HostZoomMapImplBrowserTest : public ContentBrowserTest { |
| + protected: |
| + void SetUpOnMainThread() override { |
| + host_resolver()->AddRule("*", "127.0.0.1"); |
| + ASSERT_TRUE(embedded_test_server()->Start()); |
| + } |
| }; |
| void RunTestForURL(const GURL& url, |
| @@ -51,6 +58,9 @@ void RunTestForURL(const GURL& url, |
| IN_PROC_BROWSER_TEST_F(HostZoomMapImplBrowserTest, GetZoomForView_Host) { |
| GURL url("http://abc.com"); |
| + // We must navigate so the WebContents has a committed entry. |
| + EXPECT_TRUE(NavigateToURL(shell(), url)); |
|
alexmos
2016/04/05 18:00:53
It seems RunTestForURL will now redundantly naviga
wjmaclean
2016/04/05 20:22:00
Hmmm, I missed that ... I'll remove it from RunTes
|
| + |
| HostZoomMap* host_zoom_map = |
| HostZoomMap::GetForWebContents(shell()->web_contents()); |
| @@ -70,6 +80,9 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapImplBrowserTest, |
| GetZoomForView_HostAndScheme) { |
| GURL url("http://abc.com"); |
| + // We must navigate so the WebContents has a committed entry. |
| + EXPECT_TRUE(NavigateToURL(shell(), url)); |
| + |
| HostZoomMap* host_zoom_map = |
| HostZoomMap::GetForWebContents(shell()->web_contents()); |