Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1478)

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 274883002: Move didReceiveTitle and related stuff to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/logging.h" 5 #include "base/logging.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "content/browser/frame_host/cross_site_transferring_request.h" 7 #include "content/browser/frame_host/cross_site_transferring_request.h"
8 #include "content/browser/frame_host/interstitial_page_impl.h" 8 #include "content/browser/frame_host/interstitial_page_impl.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // Test to make sure that title updates get stripped of whitespace. 323 // Test to make sure that title updates get stripped of whitespace.
324 TEST_F(WebContentsImplTest, UpdateTitle) { 324 TEST_F(WebContentsImplTest, UpdateTitle) {
325 NavigationControllerImpl& cont = 325 NavigationControllerImpl& cont =
326 static_cast<NavigationControllerImpl&>(controller()); 326 static_cast<NavigationControllerImpl&>(controller());
327 FrameHostMsg_DidCommitProvisionalLoad_Params params; 327 FrameHostMsg_DidCommitProvisionalLoad_Params params;
328 InitNavigateParams(&params, 0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED); 328 InitNavigateParams(&params, 0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
329 329
330 LoadCommittedDetails details; 330 LoadCommittedDetails details;
331 cont.RendererDidNavigate(main_test_rfh(), params, &details); 331 cont.RendererDidNavigate(main_test_rfh(), params, &details);
332 332
333 contents()->UpdateTitle(rvh(), 0, 333 contents()->UpdateTitle(main_test_rfh(), 0,
334 base::ASCIIToUTF16(" Lots O' Whitespace\n"), 334 base::ASCIIToUTF16(" Lots O' Whitespace\n"),
335 base::i18n::LEFT_TO_RIGHT); 335 base::i18n::LEFT_TO_RIGHT);
336 EXPECT_EQ(base::ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); 336 EXPECT_EQ(base::ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle());
337 } 337 }
338 338
339 TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) { 339 TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) {
340 const GURL kGURL("chrome://blah"); 340 const GURL kGURL("chrome://blah");
341 controller().LoadURL( 341 controller().LoadURL(
342 kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string()); 342 kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string());
343 EXPECT_EQ(base::string16(), contents()->GetTitle()); 343 EXPECT_EQ(base::string16(), contents()->GetTitle());
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 WebInputEvent::GesturePinchUpdate, WebGestureEvent::Touchscreen); 2529 WebInputEvent::GesturePinchUpdate, WebGestureEvent::Touchscreen);
2530 event.data.pinchUpdate.scale = 1.0f + kZoomStepValue * 3; 2530 event.data.pinchUpdate.scale = 1.0f + kZoomStepValue * 3;
2531 EXPECT_FALSE(contents()->HandleGestureEvent(event)); 2531 EXPECT_FALSE(contents()->HandleGestureEvent(event));
2532 EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount()); 2532 EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount());
2533 2533
2534 // Ensure pointers to the delegate aren't kept beyond it's lifetime. 2534 // Ensure pointers to the delegate aren't kept beyond it's lifetime.
2535 contents()->SetDelegate(NULL); 2535 contents()->SetDelegate(NULL);
2536 } 2536 }
2537 2537
2538 } // namespace content 2538 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698