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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 EXPECT_TRUE(host); | 680 EXPECT_TRUE(host); |
681 EXPECT_TRUE(host == manager.current_host()); | 681 EXPECT_TRUE(host == manager.current_host()); |
682 EXPECT_FALSE(manager.pending_render_view_host()); | 682 EXPECT_FALSE(manager.pending_render_view_host()); |
683 | 683 |
684 // It's important that the site instance get set on the Web UI page as soon | 684 // It's important that the site instance get set on the Web UI page as soon |
685 // as the navigation starts, rather than lazily after it commits, so we don't | 685 // as the navigation starts, rather than lazily after it commits, so we don't |
686 // try to re-use the SiteInstance/process for non DOM-UI things that may | 686 // try to re-use the SiteInstance/process for non DOM-UI things that may |
687 // get loaded in between. | 687 // get loaded in between. |
688 EXPECT_TRUE(static_cast<SiteInstanceImpl*>(host->GetSiteInstance())-> | 688 EXPECT_TRUE(static_cast<SiteInstanceImpl*>(host->GetSiteInstance())-> |
689 HasSite()); | 689 HasSite()); |
690 EXPECT_EQ(kUrl, host->GetSiteInstance()->GetSite()); | 690 EXPECT_EQ(kUrl, host->GetSiteInstance()->GetSiteURL()); |
691 | 691 |
692 // The Web UI is committed immediately because the RenderViewHost has not been | 692 // The Web UI is committed immediately because the RenderViewHost has not been |
693 // used yet. UpdateRendererStateForNavigate() took the short cut path. | 693 // used yet. UpdateRendererStateForNavigate() took the short cut path. |
694 EXPECT_FALSE(manager.pending_web_ui()); | 694 EXPECT_FALSE(manager.pending_web_ui()); |
695 EXPECT_TRUE(manager.web_ui()); | 695 EXPECT_TRUE(manager.web_ui()); |
696 | 696 |
697 // Commit. | 697 // Commit. |
698 manager.DidNavigateMainFrame(host); | 698 manager.DidNavigateMainFrame(host); |
699 EXPECT_TRUE(host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI); | 699 EXPECT_TRUE(host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI); |
700 } | 700 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 EXPECT_FALSE(manager.pending_render_view_host()); | 946 EXPECT_FALSE(manager.pending_render_view_host()); |
947 | 947 |
948 // Commit. | 948 // Commit. |
949 manager.DidNavigateMainFrame(host); | 949 manager.DidNavigateMainFrame(host); |
950 EXPECT_EQ(host, manager.current_host()); | 950 EXPECT_EQ(host, manager.current_host()); |
951 ASSERT_TRUE(host); | 951 ASSERT_TRUE(host); |
952 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), | 952 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), |
953 instance); | 953 instance); |
954 | 954 |
955 } | 955 } |
OLD | NEW |