| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 class RenderViewHostManagerTest | 77 class RenderViewHostManagerTest |
| 78 : public RenderViewHostImplTestHarness { | 78 : public RenderViewHostImplTestHarness { |
| 79 public: | 79 public: |
| 80 virtual void SetUp() OVERRIDE { | 80 virtual void SetUp() OVERRIDE { |
| 81 RenderViewHostImplTestHarness::SetUp(); | 81 RenderViewHostImplTestHarness::SetUp(); |
| 82 WebUIControllerFactory::RegisterFactory(&factory_); | 82 WebUIControllerFactory::RegisterFactory(&factory_); |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual void TearDown() OVERRIDE { | 85 virtual void TearDown() OVERRIDE { |
| 86 RenderViewHostImplTestHarness::TearDown(); | 86 RenderViewHostImplTestHarness::TearDown(); |
| 87 WebUIControllerFactoryRegistry::UnregisterFactoryForTesting(&factory_); | 87 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void set_should_create_webui(bool should_create_webui) { | 90 void set_should_create_webui(bool should_create_webui) { |
| 91 factory_.set_should_create_webui(should_create_webui); | 91 factory_.set_should_create_webui(should_create_webui); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void NavigateActiveAndCommit(const GURL& url) { | 94 void NavigateActiveAndCommit(const GURL& url) { |
| 95 // Note: we navigate the active RenderViewHost because previous navigations | 95 // Note: we navigate the active RenderViewHost because previous navigations |
| 96 // won't have committed yet, so NavigateAndCommit does the wrong thing | 96 // won't have committed yet, so NavigateAndCommit does the wrong thing |
| 97 // for us. | 97 // for us. |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 874 |
| 875 // Commit. | 875 // Commit. |
| 876 manager.DidNavigateMainFrame(host); | 876 manager.DidNavigateMainFrame(host); |
| 877 EXPECT_EQ(host, manager.current_host()); | 877 EXPECT_EQ(host, manager.current_host()); |
| 878 ASSERT_TRUE(host); | 878 ASSERT_TRUE(host); |
| 879 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), | 879 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), |
| 880 instance); | 880 instance); |
| 881 } | 881 } |
| 882 | 882 |
| 883 } // namespace content | 883 } // namespace content |
| OLD | NEW |