| OLD | NEW |
| 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 Loading... |
| 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(¶ms, 0, GURL(chrome::kAboutBlankURL)); | 235 InitNavigateParams(¶ms, 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 base::i18n::String16WithDirection new_title( | 240 contents()->UpdateTitle(rvh(), 0, L" Lots O' Whitespace\n"); |
| 241 ASCIIToUTF16(" Lots O' Whitespace\n"), | |
| 242 base::i18n::LEFT_TO_RIGHT); | |
| 243 contents()->UpdateTitle(rvh(), 0, new_title); | |
| 244 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); | 241 EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); |
| 245 } | 242 } |
| 246 | 243 |
| 247 // Test view source mode for the new tabs page. | 244 // Test view source mode for the new tabs page. |
| 248 TEST_F(TabContentsTest, NTPViewSource) { | 245 TEST_F(TabContentsTest, NTPViewSource) { |
| 249 const char kUrl[] = "view-source:chrome://newtab"; | 246 const char kUrl[] = "view-source:chrome://newtab"; |
| 250 const GURL kGURL(kUrl); | 247 const GURL kGURL(kUrl); |
| 251 | 248 |
| 252 process()->sink().ClearMessages(); | 249 process()->sink().ClearMessages(); |
| 253 | 250 |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 window.close_count = 0; | 1738 window.close_count = 0; |
| 1742 | 1739 |
| 1743 const int kWindowCount = 4; | 1740 const int kWindowCount = 4; |
| 1744 for (int i = 0; i < kWindowCount; i++) { | 1741 for (int i = 0; i < kWindowCount; i++) { |
| 1745 tab_contents->AddConstrainedDialog(&window); | 1742 tab_contents->AddConstrainedDialog(&window); |
| 1746 } | 1743 } |
| 1747 EXPECT_EQ(window.close_count, 0); | 1744 EXPECT_EQ(window.close_count, 0); |
| 1748 delete tab_contents; | 1745 delete tab_contents; |
| 1749 EXPECT_EQ(window.close_count, kWindowCount); | 1746 EXPECT_EQ(window.close_count, kWindowCount); |
| 1750 } | 1747 } |
| OLD | NEW |