diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-23 14:35:35 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-23 14:35:35 +0000 |
commit | e28c2cf908cf2e232329ce9431b68a4b8e4287a6 (patch) | |
tree | 53f67285c1a7e3c744803d51ece6d666e44c539a /chrome/browser/history | |
parent | a9329fff10db68e6612fb804ec906b5cc2f418fd (diff) | |
download | chromium_src-e28c2cf908cf2e232329ce9431b68a4b8e4287a6.zip chromium_src-e28c2cf908cf2e232329ce9431b68a4b8e4287a6.tar.gz chromium_src-e28c2cf908cf2e232329ce9431b68a4b8e4287a6.tar.bz2 |
Port more UI tests to Linux.
- enable following ui tests on Linux:
history_uitest.cc
inspector_controller_uitest.cc
browser/history/redirect_uitest.cc
browser/locale_tests_uitest.cc
browser/sanity_uitest.cc
- move information about Linux-specific splash page
to more generic location and enable more logic
about start page on Linux
- maintainability cleanups (DISABLED_ instead of #if 0)
- misc GCC-related cleanups
Review URL: http://codereview.chromium.org/49006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/redirect_uitest.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc index 9bc8276..af80496 100644 --- a/chrome/browser/history/redirect_uitest.cc +++ b/chrome/browser/history/redirect_uitest.cc @@ -7,10 +7,10 @@ // here might indicate that WebKit changed the calls our glue layer gets in // the case of redirects. It may also mean problems with the history system. +#include "base/file_util.h" +#include "base/platform_thread.h" #include "base/scoped_ptr.h" #include "base/string_util.h" -// TODO(creis): Remove win_util when finished debugging ClientServerServer. -#include "base/win_util.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" @@ -46,7 +46,7 @@ TEST_F(RedirectTest, Server) { std::vector<GURL> redirects; ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); - ASSERT_EQ(1, redirects.size()); + ASSERT_EQ(1U, redirects.size()); EXPECT_EQ(final_url.spec(), redirects[0].spec()); } @@ -63,7 +63,7 @@ TEST_F(RedirectTest, Client) { // We need the sleep for the client redirects, because it appears as two // page visits in the browser. NavigateToURL(first_url); - Sleep(action_timeout_ms()); + PlatformThread::Sleep(action_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); @@ -71,7 +71,7 @@ TEST_F(RedirectTest, Client) { std::vector<GURL> redirects; ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); - ASSERT_EQ(1, redirects.size()); + ASSERT_EQ(1U, redirects.size()); EXPECT_EQ(final_url.spec(), redirects[0].spec()); } @@ -92,7 +92,7 @@ TEST_F(RedirectTest, ClientEmptyReferer) { // loads the html file on disk, rather than just getting a response from // the TestServer. for (int i = 0; i < 10; ++i) { - Sleep(sleep_timeout_ms()); + PlatformThread::Sleep(sleep_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); @@ -100,7 +100,7 @@ TEST_F(RedirectTest, ClientEmptyReferer) { break; } - EXPECT_EQ(1, redirects.size()); + EXPECT_EQ(1U, redirects.size()); EXPECT_EQ(final_url.spec(), redirects[0].spec()); } @@ -109,10 +109,11 @@ TEST_F(RedirectTest, ClientEmptyReferer) { TEST_F(RedirectTest, ClientCancelled) { std::wstring first_path = test_data_directory_; file_util::AppendToPath(&first_path, L"cancelled_redirect_test.html"); + ASSERT_TRUE(file_util::AbsolutePath(&first_path)); GURL first_url = net::FilePathToFileURL(first_path); NavigateToURL(first_url); - Sleep(action_timeout_ms()); + PlatformThread::Sleep(action_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); @@ -123,7 +124,7 @@ TEST_F(RedirectTest, ClientCancelled) { // There should be no redirects from first_url, because the anchor location // change that occurs should not be flagged as a redirect and the meta-refresh // won't have fired yet. - ASSERT_EQ(0, redirects.size()); + ASSERT_EQ(0U, redirects.size()); GURL current_url; ASSERT_TRUE(tab_proxy->GetCurrentURL(¤t_url)); @@ -133,6 +134,7 @@ TEST_F(RedirectTest, ClientCancelled) { std::string final_ref = "myanchor"; std::wstring current_path; ASSERT_TRUE(net::FileURLToFilePath(current_url, ¤t_path)); + ASSERT_TRUE(file_util::AbsolutePath(¤t_path)); // Path should remain unchanged. EXPECT_EQ(StringToLowerASCII(first_path), StringToLowerASCII(current_path)); EXPECT_EQ(final_ref, current_url.ref()); @@ -160,7 +162,7 @@ TEST_F(RedirectTest, DISABLED_ClientServerServer) { NavigateToURL(first_url); for (int i = 0; i < 10; ++i) { - Sleep(sleep_timeout_ms()); + PlatformThread::Sleep(sleep_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); @@ -168,7 +170,7 @@ TEST_F(RedirectTest, DISABLED_ClientServerServer) { break; } - ASSERT_EQ(3, redirects.size()); + ASSERT_EQ(3U, redirects.size()); EXPECT_EQ(second_url.spec(), redirects[0].spec()); EXPECT_EQ(next_to_last.spec(), redirects[1].spec()); EXPECT_EQ(final_url.spec(), redirects[2].spec()); @@ -231,7 +233,7 @@ TEST_F(RedirectTest, ClientFragments) { NavigateToURL(first_url); for (int i = 0; i < 10; ++i) { - Sleep(sleep_timeout_ms()); + PlatformThread::Sleep(sleep_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); @@ -239,7 +241,7 @@ TEST_F(RedirectTest, ClientFragments) { break; } - EXPECT_EQ(1, redirects.size()); + EXPECT_EQ(1U, redirects.size()); EXPECT_EQ(first_url.spec() + "#myanchor", redirects[0].spec()); } @@ -279,7 +281,7 @@ TEST_F(RedirectTest, std::wstring final_url_title = L"Title Of Awesomeness"; // Wait till the final page has been loaded. for (int i = 0; i < 10; ++i) { - Sleep(sleep_timeout_ms()); + PlatformThread::Sleep(sleep_timeout_ms()); scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); ASSERT_TRUE(tab_proxy->GetTabTitle(&tab_title)); |