diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:13:32 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:13:32 +0000 |
commit | 44bf8fbfa2786685070e90b6b12dac24da4b10d7 (patch) | |
tree | bb44e26037a64e3c06d80bb70da8f3eb4f2eee09 /chrome/test | |
parent | 224e861a69b6731ef51fdf978af22f51674cbdd8 (diff) | |
download | chromium_src-44bf8fbfa2786685070e90b6b12dac24da4b10d7.zip chromium_src-44bf8fbfa2786685070e90b6b12dac24da4b10d7.tar.gz chromium_src-44bf8fbfa2786685070e90b6b12dac24da4b10d7.tar.bz2 |
ui_tests: use proper API for getting tab title
To get the title actually shown by a tab, call the function that
we use for computing the tab text. (Sometimes it returns title()
and sometimes it computes something more complex.)
This is identical to r76841 but for a different testing framework. :\
BUG=this actually fixes the ancient Google-internal bug 634097(!)
Review URL: http://codereview.chromium.org/6632006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_test_test.cc | 2 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy_uitest.cc | 14 | ||||
-rw-r--r-- | chrome/test/ui/layout_plugin_uitest.cc | 2 |
3 files changed, 7 insertions, 11 deletions
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 |