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

Unified Diff: chrome/browser/navigation_entry_unittest.cc

Issue 39022: Convert NavigationEntry title to string16. TabContents::GetTitle no longer ne... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/printing/print_view_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/navigation_entry_unittest.cc
===================================================================
--- chrome/browser/navigation_entry_unittest.cc (revision 10809)
+++ chrome/browser/navigation_entry_unittest.cc (working copy)
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/string16.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,7 +18,7 @@
entry2_.reset(new NavigationEntry(TAB_CONTENTS_DOM_UI, instance_, 3,
GURL("test:url"),
GURL("from"),
- L"title",
+ ASCIIToUTF16("title"),
PageTransition::TYPED));
}
@@ -49,17 +50,18 @@
EXPECT_EQ(GURL(), entry1_.get()->url());
EXPECT_EQ(GURL(), entry1_.get()->display_url());
- EXPECT_EQ(L"", entry1_.get()->GetTitleForDisplay());
+ EXPECT_TRUE(entry1_.get()->GetTitleForDisplay(NULL).empty());
// Setting URL affects display_url and GetTitleForDisplay
entry1_.get()->set_url(GURL("http://www.google.com"));
EXPECT_EQ(GURL("http://www.google.com"), entry1_.get()->url());
EXPECT_EQ(GURL("http://www.google.com/"), entry1_.get()->display_url());
- EXPECT_EQ(L"http://www.google.com/", entry1_.get()->GetTitleForDisplay());
+ EXPECT_EQ(ASCIIToUTF16("http://www.google.com/"),
+ entry1_.get()->GetTitleForDisplay(NULL));
// Title affects GetTitleForDisplay
- entry1_.get()->set_title(L"Google");
- EXPECT_EQ(L"Google", entry1_.get()->GetTitleForDisplay());
+ entry1_.get()->set_title(ASCIIToWide("Google"));
+ EXPECT_EQ(ASCIIToUTF16("Google"), entry1_.get()->GetTitleForDisplay(NULL));
// Setting display_url doesn't affect URL
entry2_.get()->set_display_url(GURL("display:url"));
@@ -68,7 +70,7 @@
EXPECT_EQ(GURL("display:url"), entry2_.get()->display_url());
// Having a title set in constructor overrides display URL
- EXPECT_EQ(L"title", entry2_.get()->GetTitleForDisplay());
+ EXPECT_EQ(ASCIIToUTF16("title"), entry2_.get()->GetTitleForDisplay(NULL));
// User typed URL is independent of the others
EXPECT_EQ(GURL(), entry1_.get()->user_typed_url());
@@ -146,8 +148,8 @@
// Title
EXPECT_EQ(std::wstring(), entry1_.get()->title());
EXPECT_EQ(L"title", entry2_.get()->title());
- entry2_.get()->set_title(L"title2");
- EXPECT_EQ(L"title2", entry2_.get()->title());
+ entry2_.get()->set_title(ASCIIToUTF16("title2"));
+ EXPECT_EQ(ASCIIToUTF16("title2"), entry2_.get()->title());
// State
EXPECT_EQ(std::string(), entry1_.get()->content_state());
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/printing/print_view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698