OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "content/browser/browser_thread_impl.h" | 6 #include "content/browser/browser_thread_impl.h" |
7 #include "content/browser/renderer_host/test_render_view_host.h" | 7 #include "content/browser/renderer_host/test_render_view_host.h" |
8 #include "content/browser/site_instance_impl.h" | 8 #include "content/browser/site_instance_impl.h" |
9 #include "content/browser/web_contents/navigation_controller_impl.h" | 9 #include "content/browser/web_contents/navigation_controller_impl.h" |
10 #include "content/browser/web_contents/navigation_entry_impl.h" | 10 #include "content/browser/web_contents/navigation_entry_impl.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 class RenderViewHostManagerTest | 84 class RenderViewHostManagerTest |
85 : public RenderViewHostImplTestHarness { | 85 : public RenderViewHostImplTestHarness { |
86 public: | 86 public: |
87 virtual void SetUp() OVERRIDE { | 87 virtual void SetUp() OVERRIDE { |
88 RenderViewHostImplTestHarness::SetUp(); | 88 RenderViewHostImplTestHarness::SetUp(); |
89 WebUIControllerFactory::RegisterFactory(&factory_); | 89 WebUIControllerFactory::RegisterFactory(&factory_); |
90 } | 90 } |
91 | 91 |
92 virtual void TearDown() OVERRIDE { | 92 virtual void TearDown() OVERRIDE { |
93 RenderViewHostImplTestHarness::TearDown(); | 93 RenderViewHostImplTestHarness::TearDown(); |
94 WebUIControllerFactoryRegistry::UnregisterFactoryForTesting(&factory_); | 94 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); |
95 } | 95 } |
96 | 96 |
97 void set_should_create_webui(bool should_create_webui) { | 97 void set_should_create_webui(bool should_create_webui) { |
98 factory_.set_should_create_webui(should_create_webui); | 98 factory_.set_should_create_webui(should_create_webui); |
99 } | 99 } |
100 | 100 |
101 void NavigateActiveAndCommit(const GURL& url) { | 101 void NavigateActiveAndCommit(const GURL& url) { |
102 // Note: we navigate the active RenderViewHost because previous navigations | 102 // Note: we navigate the active RenderViewHost because previous navigations |
103 // won't have committed yet, so NavigateAndCommit does the wrong thing | 103 // won't have committed yet, so NavigateAndCommit does the wrong thing |
104 // for us. | 104 // for us. |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 | 881 |
882 // Commit. | 882 // Commit. |
883 manager.DidNavigateMainFrame(host); | 883 manager.DidNavigateMainFrame(host); |
884 EXPECT_EQ(host, manager.current_host()); | 884 EXPECT_EQ(host, manager.current_host()); |
885 ASSERT_TRUE(host); | 885 ASSERT_TRUE(host); |
886 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), | 886 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), |
887 instance); | 887 instance); |
888 } | 888 } |
889 | 889 |
890 } // namespace content | 890 } // namespace content |
OLD | NEW |