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

Side by Side Diff: chrome/browser/tab_contents/web_contents_unittest.cc

Issue 6878089: Add and use a base::i18n::StringWithDirection for carrying titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license Created 9 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/prefs/pref_value_store.h" 10 #include "chrome/browser/prefs/pref_value_store.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 }; 230 };
231 231
232 // Test to make sure that title updates get stripped of whitespace. 232 // Test to make sure that title updates get stripped of whitespace.
233 TEST_F(TabContentsTest, UpdateTitle) { 233 TEST_F(TabContentsTest, UpdateTitle) {
234 ViewHostMsg_FrameNavigate_Params params; 234 ViewHostMsg_FrameNavigate_Params params;
235 InitNavigateParams(&params, 0, GURL(chrome::kAboutBlankURL)); 235 InitNavigateParams(&params, 0, GURL(chrome::kAboutBlankURL));
236 236
237 NavigationController::LoadCommittedDetails details; 237 NavigationController::LoadCommittedDetails details;
238 controller().RendererDidNavigate(params, 0, &details); 238 controller().RendererDidNavigate(params, 0, &details);
239 239
240 contents()->UpdateTitle(rvh(), 0, ASCIIToUTF16(" Lots O' Whitespace\n"), 240 base::i18n::String16WithDirection new_title(
241 WebKit::WebTextDirectionLeftToRight); 241 ASCIIToUTF16(" Lots O' Whitespace\n"),
242 base::i18n::LEFT_TO_RIGHT);
243 contents()->UpdateTitle(rvh(), 0, new_title);
242 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); 244 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle());
243 } 245 }
244 246
245 // Test view source mode for the new tabs page. 247 // Test view source mode for the new tabs page.
246 TEST_F(TabContentsTest, NTPViewSource) { 248 TEST_F(TabContentsTest, NTPViewSource) {
247 const char kUrl[] = "view-source:chrome://newtab"; 249 const char kUrl[] = "view-source:chrome://newtab";
248 const GURL kGURL(kUrl); 250 const GURL kGURL(kUrl);
249 251
250 process()->sink().ClearMessages(); 252 process()->sink().ClearMessages();
251 253
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 window.close_count = 0; 1741 window.close_count = 0;
1740 1742
1741 const int kWindowCount = 4; 1743 const int kWindowCount = 4;
1742 for (int i = 0; i < kWindowCount; i++) { 1744 for (int i = 0; i < kWindowCount; i++) {
1743 tab_contents->AddConstrainedDialog(&window); 1745 tab_contents->AddConstrainedDialog(&window);
1744 } 1746 }
1745 EXPECT_EQ(window.close_count, 0); 1747 EXPECT_EQ(window.close_count, 0);
1746 delete tab_contents; 1748 delete tab_contents;
1747 EXPECT_EQ(window.close_count, kWindowCount); 1749 EXPECT_EQ(window.close_count, kWindowCount);
1748 } 1750 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698