summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc2
-rw-r--r--chrome/browser/session_history_uitest.cc24
-rw-r--r--chrome/test/automated_ui_tests/automated_ui_test_test.cc2
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc14
-rw-r--r--chrome/test/ui/layout_plugin_uitest.cc2
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_uitest.cc44
6 files changed, 43 insertions, 45 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index bc2bfe2..ff3691f 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -1069,7 +1069,7 @@ void TestingAutomationProvider::GetTabTitle(int handle,
NavigationController* tab = tab_tracker_->GetResource(handle);
NavigationEntry* entry = tab->GetActiveEntry();
if (entry != NULL) {
- *title = UTF16ToWideHack(entry->title());
+ *title = UTF16ToWideHack(entry->GetTitleForDisplay(""));
} else {
*title = std::wstring();
}
diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc
index b65c90c..e4bb779 100644
--- a/chrome/browser/session_history_uitest.cc
+++ b/chrome/browser/session_history_uitest.cc
@@ -91,7 +91,7 @@ TEST_F(SessionHistoryTest, MAYBE_BasicBackForward) {
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
test_server_.GetURL("files/session_history/bot1.html")));
@@ -132,10 +132,10 @@ TEST_F(SessionHistoryTest, MAYBE_BasicBackForward) {
EXPECT_EQ(L"bot1", GetTabTitle());
ASSERT_TRUE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_TRUE(tab_->GoForward());
EXPECT_EQ(L"bot1", GetTabTitle());
@@ -158,7 +158,7 @@ TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) {
// about:blank should be loaded first.
GURL home(homepage());
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
EXPECT_EQ(home, GetTabURL());
GURL frames(test_server_.GetURL("files/session_history/frames.html"));
@@ -185,7 +185,7 @@ TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) {
EXPECT_EQ(frames, GetTabURL());
ASSERT_TRUE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
EXPECT_EQ(home, GetTabURL());
ASSERT_TRUE(tab_->GoForward());
@@ -334,7 +334,7 @@ TEST_F(SessionHistoryTest, MAYBE_FragmentBackForward) {
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
GURL fragment(test_server_.GetURL("files/session_history/fragment.html"));
ASSERT_TRUE(tab_->NavigateToURL(fragment));
@@ -405,7 +405,7 @@ TEST_F(SessionHistoryTest, FLAKY_JavascriptHistory) {
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
test_server_.GetURL("files/session_history/bot1.html")));
@@ -439,10 +439,10 @@ TEST_F(SessionHistoryTest, FLAKY_JavascriptHistory) {
// history is [blank, bot1, bot2, *bot3]
JavascriptGo("-3");
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
JavascriptGo("1");
EXPECT_EQ(L"bot1", GetTabTitle());
@@ -460,10 +460,10 @@ TEST_F(SessionHistoryTest, FLAKY_JavascriptHistory) {
EXPECT_EQ(L"bot1", GetTabTitle());
JavascriptGo("-1");
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
JavascriptGo("1");
EXPECT_EQ(L"bot1", GetTabTitle());
@@ -494,7 +494,7 @@ TEST_F(SessionHistoryTest, FAILS_LocationReplace) {
TEST_F(SessionHistoryTest, FLAKY_HistorySearchXSS) {
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
- EXPECT_EQ(L"", GetTabTitle());
+ EXPECT_EQ(L"about:blank", GetTabTitle());
GURL url(std::string(chrome::kChromeUIHistoryURL) +
"#q=%3Cimg%20src%3Dx%3Ax%20onerror%3D%22document.title%3D'XSS'%22%3E");
diff --git a/chrome/test/automated_ui_tests/automated_ui_test_test.cc b/chrome/test/automated_ui_tests/automated_ui_test_test.cc
index 75cfe5a..05c6fc1 100644
--- a/chrome/test/automated_ui_tests/automated_ui_test_test.cc
+++ b/chrome/test/automated_ui_tests/automated_ui_test_test.cc
@@ -31,7 +31,7 @@ TEST_F(AutomatedUITestBase, Home) {
std::wstring title;
ASSERT_TRUE(active_browser()->GetActiveTab()->GetTabTitle(&title));
- EXPECT_EQ(L"", title);
+ EXPECT_EQ(L"about:blank", title);
}
TEST_F(AutomatedUITestBase, OpenNewTab) {
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 06e082d..198a0dc 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -290,8 +290,7 @@ TEST_F(AutomationProxyTest, GetTab) {
ASSERT_TRUE(tab.get());
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
- // BUG [634097] : expected title should be "about:blank"
- ASSERT_STREQ(L"", title.c_str());
+ ASSERT_STREQ(L"about:blank", title.c_str());
}
{
@@ -312,8 +311,7 @@ TEST_F(AutomationProxyTest, NavigateToURL) {
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
- // BUG [634097] : expected title should be "about:blank"
- ASSERT_STREQ(L"", title.c_str());
+ ASSERT_STREQ(L"about:blank", title.c_str());
FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
@@ -334,12 +332,11 @@ TEST_F(AutomationProxyTest, GoBackForward) {
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
- // BUG [634097] : expected title should be "about:blank"
- ASSERT_STREQ(L"", title.c_str());
+ ASSERT_STREQ(L"about:blank", title.c_str());
ASSERT_FALSE(tab->GoBack());
ASSERT_TRUE(tab->GetTabTitle(&title));
- ASSERT_STREQ(L"", title.c_str());
+ ASSERT_STREQ(L"about:blank", title.c_str());
FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
@@ -349,8 +346,7 @@ TEST_F(AutomationProxyTest, GoBackForward) {
ASSERT_TRUE(tab->GoBack());
ASSERT_TRUE(tab->GetTabTitle(&title));
- // BUG [634097] : expected title should be "about:blank"
- ASSERT_STREQ(L"", title.c_str());
+ ASSERT_STREQ(L"about:blank", title.c_str());
ASSERT_TRUE(tab->GoForward());
ASSERT_TRUE(tab->GetTabTitle(&title));
diff --git a/chrome/test/ui/layout_plugin_uitest.cc b/chrome/test/ui/layout_plugin_uitest.cc
index 0e173f8a..860792c 100644
--- a/chrome/test/ui/layout_plugin_uitest.cc
+++ b/chrome/test/ui/layout_plugin_uitest.cc
@@ -41,7 +41,7 @@ TEST_F(LayoutPluginTester, UnloadNoCrash) {
ASSERT_TRUE(tab->GoBack());
EXPECT_TRUE(tab->GetTabTitle(&title));
- EXPECT_EQ(L"", title);
+ EXPECT_NE(L"Layout Test Plugin Test", title);
}
// Tests if a plugin executing a self deleting script using NPN_GetURL
diff --git a/content/browser/renderer_host/resource_dispatcher_host_uitest.cc b/content/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 5271595..f20503b 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -23,13 +23,13 @@ namespace {
class ResourceDispatcherTest : public UITest {
public:
- void CheckTitleTest(const std::wstring& file,
- const std::wstring& expected_title,
+ void CheckTitleTest(const std::string& file,
+ const std::string& expected_title,
int expected_navigations) {
NavigateToURLBlockUntilNavigationsComplete(
- URLRequestMockHTTPJob::GetMockUrl(FilePath::FromWStringHack(file)),
+ URLRequestMockHTTPJob::GetMockUrl(FilePath().AppendASCII(file)),
expected_navigations);
- EXPECT_EQ(expected_title, GetActiveTabTitle());
+ EXPECT_EQ(expected_title, WideToASCII(GetActiveTabTitle()));
}
protected:
@@ -39,25 +39,27 @@ class ResourceDispatcherTest : public UITest {
};
TEST_F(ResourceDispatcherTest, SniffHTMLWithNoContentType) {
- CheckTitleTest(L"content-sniffer-test0.html",
- L"Content Sniffer Test 0", 1);
+ CheckTitleTest("content-sniffer-test0.html",
+ "Content Sniffer Test 0", 1);
}
TEST_F(ResourceDispatcherTest, RespectNoSniffDirective) {
- CheckTitleTest(L"nosniff-test.html", L"", 1);
+ CheckTitleTest("nosniff-test.html", "mock.http/nosniff-test.html", 1);
}
TEST_F(ResourceDispatcherTest, DoNotSniffHTMLFromTextPlain) {
- CheckTitleTest(L"content-sniffer-test1.html", L"", 1);
+ CheckTitleTest("content-sniffer-test1.html",
+ "mock.http/content-sniffer-test1.html", 1);
}
TEST_F(ResourceDispatcherTest, DoNotSniffHTMLFromImageGIF) {
- CheckTitleTest(L"content-sniffer-test2.html", L"", 1);
+ CheckTitleTest("content-sniffer-test2.html",
+ "mock.http/content-sniffer-test2.html", 1);
}
TEST_F(ResourceDispatcherTest, SniffNoContentTypeNoData) {
- CheckTitleTest(L"content-sniffer-test3.html",
- L"Content Sniffer Test 3", 1);
+ CheckTitleTest("content-sniffer-test3.html",
+ "Content Sniffer Test 3", 1);
EXPECT_EQ(1, GetTabCount());
// Make sure the download shelf is not showing.
@@ -69,11 +71,11 @@ TEST_F(ResourceDispatcherTest, SniffNoContentTypeNoData) {
}
TEST_F(ResourceDispatcherTest, ContentDispositionEmpty) {
- CheckTitleTest(L"content-disposition-empty.html", L"success", 1);
+ CheckTitleTest("content-disposition-empty.html", "success", 1);
}
TEST_F(ResourceDispatcherTest, ContentDispositionInline) {
- CheckTitleTest(L"content-disposition-inline.html", L"success", 1);
+ CheckTitleTest("content-disposition-inline.html", "success", 1);
}
// Test for bug #1091358.
@@ -181,8 +183,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteOnunloadCookie) {
// Navigate to a new cross-site page, to dispatch unload event and set the
// cookie.
- CheckTitleTest(L"content-sniffer-test0.html",
- L"Content Sniffer Test 0", 1);
+ CheckTitleTest("content-sniffer-test0.html",
+ "Content Sniffer Test 0", 1);
// Check that the cookie was set.
std::string value_result;
@@ -220,8 +222,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) {
// Navigate to a new cross-site page. The browser should not wait around for
// the old renderer's on{before}unload handlers to run.
- CheckTitleTest(L"content-sniffer-test0.html",
- L"Content Sniffer Test 0", 1);
+ CheckTitleTest("content-sniffer-test0.html",
+ "Content Sniffer Test 0", 1);
}
#endif // !defined(OS_MACOSX)
@@ -234,8 +236,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationNonBuffered) {
ASSERT_TRUE(tab.get());
// Start with an HTTP page.
- CheckTitleTest(L"content-sniffer-test0.html",
- L"Content Sniffer Test 0", 1);
+ CheckTitleTest("content-sniffer-test0.html",
+ "Content Sniffer Test 0", 1);
// Now load a file:// page, which does not use the BufferedEventHandler.
// Make sure that the page loads and displays a title, and doesn't get stuck.
@@ -305,8 +307,8 @@ TEST_F(ResourceDispatcherTest, CrossOriginRedirectBlocked) {
//
// If the redirect in #2 were not blocked, we'd also see a request
// for http://mock.http:4000/title2.html, and the title would be different.
- CheckTitleTest(L"cross-origin-redirect-blocked.html",
- L"Title Of More Awesomeness", 2);
+ CheckTitleTest("cross-origin-redirect-blocked.html",
+ "Title Of More Awesomeness", 2);
}
// Tests that ResourceDispatcherHostRequestInfo is updated correctly on failed