| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "chrome/browser/renderer_host/render_view_host.h" | 6 #include "chrome/browser/renderer_host/render_view_host.h" |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 8 #include "chrome/browser/renderer_host/test_render_view_host.h" | 8 #include "chrome/browser/renderer_host/test_render_view_host.h" |
| 9 #include "chrome/browser/tab_contents/interstitial_page.h" | 9 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 10 #include "chrome/browser/tab_contents/navigation_controller.h" | 10 #include "chrome/browser/tab_contents/navigation_controller.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 NavigationController::LoadCommittedDetails details; | 208 NavigationController::LoadCommittedDetails details; |
| 209 controller().RendererDidNavigate(params, &details); | 209 controller().RendererDidNavigate(params, &details); |
| 210 | 210 |
| 211 contents()->UpdateTitle(rvh(), 0, L" Lots O' Whitespace\n"); | 211 contents()->UpdateTitle(rvh(), 0, L" Lots O' Whitespace\n"); |
| 212 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); | 212 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Test view source mode for the new tabs page. | 215 // Test view source mode for the new tabs page. |
| 216 TEST_F(TabContentsTest, NTPViewSource) { | 216 TEST_F(TabContentsTest, NTPViewSource) { |
| 217 const char kUrl[] = "view-source:chrome-ui://newtab/"; | 217 const char kUrl[] = "view-source:chrome://newtab/"; |
| 218 const GURL kGURL(kUrl); | 218 const GURL kGURL(kUrl); |
| 219 | 219 |
| 220 process()->sink().ClearMessages(); | 220 process()->sink().ClearMessages(); |
| 221 controller().LoadURL(kGURL, GURL(), PageTransition::TYPED); | 221 controller().LoadURL(kGURL, GURL(), PageTransition::TYPED); |
| 222 rvh()->delegate()->RenderViewCreated(rvh()); | 222 rvh()->delegate()->RenderViewCreated(rvh()); |
| 223 // Did we get the expected message? | 223 // Did we get the expected message? |
| 224 EXPECT_TRUE(process()->sink().GetUniqueMessageMatching( | 224 EXPECT_TRUE(process()->sink().GetUniqueMessageMatching( |
| 225 ViewMsg_EnableViewSourceMode::ID)); | 225 ViewMsg_EnableViewSourceMode::ID)); |
| 226 | 226 |
| 227 ViewHostMsg_FrameNavigate_Params params; | 227 ViewHostMsg_FrameNavigate_Params params; |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 interstitial = | 1110 interstitial = |
| 1111 new TestInterstitialPage(contents(), true, url, &state, &deleted); | 1111 new TestInterstitialPage(contents(), true, url, &state, &deleted); |
| 1112 interstitial->Show(); | 1112 interstitial->Show(); |
| 1113 interstitial->TestDidNavigate(1, url); | 1113 interstitial->TestDidNavigate(1, url); |
| 1114 // Simulate a renderer crash. | 1114 // Simulate a renderer crash. |
| 1115 interstitial->TestRenderViewGone(); | 1115 interstitial->TestRenderViewGone(); |
| 1116 // The interstitial should have been dismissed. | 1116 // The interstitial should have been dismissed. |
| 1117 EXPECT_TRUE(deleted); | 1117 EXPECT_TRUE(deleted); |
| 1118 EXPECT_EQ(TestInterstitialPage::CANCELED, state); | 1118 EXPECT_EQ(TestInterstitialPage::CANCELED, state); |
| 1119 } | 1119 } |
| OLD | NEW |