diff options
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/history/redirect_uitest.cc | 30 | ||||
-rw-r--r-- | chrome/browser/iframe_uitest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sanity_uitest.cc | 1 | ||||
-rw-r--r-- | chrome/browser/session_history_uitest.cc | 78 | ||||
-rw-r--r-- | chrome/chrome.gyp | 2 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 8 | ||||
-rw-r--r-- | chrome/test/ui/inspector_controller_uitest.cc | 9 | ||||
-rw-r--r-- | chrome/test/ui/ui_tests.scons | 5 |
9 files changed, 64 insertions, 78 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index b2d7f7b..8c7ed5a 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2448,9 +2448,6 @@ void Browser::BuildPopupWindow(TabContents* source, } GURL Browser::GetHomePage() { -#if defined(OS_LINUX) - return GURL("about:linux-splash"); -#endif if (profile_->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) return GURL(chrome::kChromeUINewTabURL); GURL home_page = GURL(URLFixerUpper::FixupURL( 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)); diff --git a/chrome/browser/iframe_uitest.cc b/chrome/browser/iframe_uitest.cc index 6cd75b0..7e2e617 100644 --- a/chrome/browser/iframe_uitest.cc +++ b/chrome/browser/iframe_uitest.cc @@ -4,6 +4,7 @@ #include "base/basictypes.h" #include "base/file_util.h" +#include "base/platform_thread.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" @@ -14,7 +15,8 @@ class IFrameTest : public UITest { file_util::AppendToPath(&test_file, url); NavigateToURL(net::FilePathToFileURL(test_file)); - Sleep(sleep_timeout_ms()); // The browser lazily updates the title. + // The browser lazily updates the title. + PlatformThread::Sleep(sleep_timeout_ms()); // Make sure the navigation succeeded. EXPECT_EQ(std::wstring(page_title), GetActiveTabTitle()); @@ -28,8 +30,6 @@ TEST_F(IFrameTest, Crash) { NavigateAndVerifyTitle(L"iframe.html", L"iframe test"); } -// http://crbug.com/3035 : Triggers a DCHECK in web_contents.cc. Need to -// investigate. TEST_F(IFrameTest, InEmptyFrame) { NavigateAndVerifyTitle(L"iframe_in_empty_frame.html", L"iframe test"); } diff --git a/chrome/browser/sanity_uitest.cc b/chrome/browser/sanity_uitest.cc index 5559ca4..77cc14d 100644 --- a/chrome/browser/sanity_uitest.cc +++ b/chrome/browser/sanity_uitest.cc @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/file_util.h" +#include "base/platform_thread.h" class GoogleTest : public UITest { protected: diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc index 64edd93..a74d8e4 100644 --- a/chrome/browser/session_history_uitest.cc +++ b/chrome/browser/session_history_uitest.cc @@ -3,7 +3,8 @@ // found in the LICENSE file. #include "base/file_util.h" -#include "base/win_util.h" +#include "base/platform_thread.h" +#include "base/string_util.h" #include "chrome/common/l10n_util.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" @@ -22,8 +23,7 @@ class SessionHistoryTest : public UITest { protected: SessionHistoryTest() : UITest() { FilePath path = FilePath::FromWStringHack(test_data_directory_); - path = path.AppendASCII("session_history") - .Append(FilePath::StringType(&FilePath::kSeparators[0], 1)); + path = path.AppendASCII("session_history"); url_prefix_ = UTF8ToWide(net::FilePathToFileURL(path).spec()); } @@ -41,16 +41,15 @@ class SessionHistoryTest : public UITest { } // Simulate clicking a link. Only works on the frames.html testserver page. - void ClickLink(std::wstring node_id) { - GURL url(L"javascript:clickLink('" + node_id + L"')"); + void ClickLink(std::string node_id) { + GURL url("javascript:clickLink('" + node_id + "')"); ASSERT_TRUE(tab_->NavigateToURL(url)); } // Simulate filling in form data. Only works on the frames.html page with // subframe = form.html, and on form.html itself. - void FillForm(std::wstring node_id, std::wstring value) { - GURL url(L"javascript:fillForm('" + node_id + - L"', '" + value + L"')"); + void FillForm(std::string node_id, std::string value) { + GURL url("javascript:fillForm('" + node_id + "', '" + value + "')"); // This will return immediately, but since the JS executes synchronously // on the renderer, it will complete before the next navigate message is // processed. @@ -59,8 +58,8 @@ class SessionHistoryTest : public UITest { // Simulate submitting a form. Only works on the frames.html page with // subframe = form.html, and on form.html itself. - void SubmitForm(std::wstring node_id) { - GURL url(L"javascript:submitForm('" + node_id + L"')"); + void SubmitForm(std::string node_id) { + GURL url("javascript:submitForm('" + node_id + "')"); ASSERT_TRUE(tab_->NavigateToURL(url)); } @@ -81,12 +80,12 @@ class SessionHistoryTest : public UITest { // Error pages load separately, but the UI automation system does not wait // for error pages to load before returning after a navigation request. // So, we need to sleep a little. - DWORD kWaitForErrorPageMsec = 200; + const int kWaitForErrorPageMsec = 200; for (int i = 0; i < 10; ++i) { if (value.compare(GetTabTitle()) == 0) return value; - Sleep(kWaitForErrorPageMsec); + PlatformThread::Sleep(kWaitForErrorPageMsec); } return GetTabTitle(); } @@ -167,17 +166,12 @@ TEST_F(SessionHistoryTest, BasicBackForward) { // Test that back/forward works when navigating in subframes. TEST_F(SessionHistoryTest, FrameBackForward) { - // Bug: http://b/1175763, skip this test on Windows 2000 until - // flakiness is investigated and fixed. - if (win_util::GetWinVersion() <= win_util::WINVERSION_2000) - return; - scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. - GURL home(homepage_); + GURL home(WideToUTF8(homepage_)); ASSERT_FALSE(tab_->GoBack()); EXPECT_EQ(L"", GetTabTitle()); EXPECT_EQ(home, GetTabURL()); @@ -187,11 +181,11 @@ TEST_F(SessionHistoryTest, FrameBackForward) { EXPECT_EQ(L"bot1", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - ClickLink(L"abot2"); + ClickLink("abot2"); EXPECT_EQ(L"bot2", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - ClickLink(L"abot3"); + ClickLink("abot3"); EXPECT_EQ(L"bot3", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); @@ -217,7 +211,7 @@ TEST_F(SessionHistoryTest, FrameBackForward) { EXPECT_EQ(L"bot2", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - ClickLink(L"abot1"); + ClickLink("abot1"); EXPECT_EQ(L"bot1", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); @@ -250,11 +244,11 @@ TEST_F(SessionHistoryTest, FrameFormBackForward) { ASSERT_TRUE(tab_->NavigateToURL(frames)); EXPECT_EQ(L"bot1", GetTabTitle()); - ClickLink(L"aform"); + ClickLink("aform"); EXPECT_EQ(L"form", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - SubmitForm(L"isubmit"); + SubmitForm("isubmit"); EXPECT_EQ(L"text=&select=a", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); @@ -264,7 +258,7 @@ TEST_F(SessionHistoryTest, FrameFormBackForward) { // history is [blank, bot1, *form, post] - ClickLink(L"abot2"); + ClickLink("abot2"); EXPECT_EQ(L"bot2", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); @@ -274,32 +268,31 @@ TEST_F(SessionHistoryTest, FrameFormBackForward) { EXPECT_EQ(L"form", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - SubmitForm(L"isubmit"); + SubmitForm("isubmit"); EXPECT_EQ(L"text=&select=a", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); // history is [blank, bot1, form, *post] -// TODO(mpcomplete): reenable this when WebKit bug 10199 is fixed: -// "returning to a POST result within a frame does a GET instead of a POST" -#if 0 - ClickLink(L"abot2"); - EXPECT_EQ(L"bot2", GetTabTitle()); - EXPECT_EQ(frames, GetTabURL()); + if (false) { + // TODO(mpcomplete): reenable this when WebKit bug 10199 is fixed: + // "returning to a POST result within a frame does a GET instead of a POST" + ClickLink("abot2"); + EXPECT_EQ(L"bot2", GetTabTitle()); + EXPECT_EQ(frames, GetTabURL()); - ASSERT_TRUE(tab_->GoBack()); - EXPECT_EQ(L"text=&select=a", GetTabTitle()); - EXPECT_EQ(frames, GetTabURL()); -#endif + ASSERT_TRUE(tab_->GoBack()); + EXPECT_EQ(L"text=&select=a", GetTabTitle()); + EXPECT_EQ(frames, GetTabURL()); + } } // TODO(mpcomplete): enable this when Bug 734372 is fixed: // "Doing a session history navigation does not restore newly-created subframe // document state" -#if 0 // Test that back/forward preserves POST data and document state when navigating // across frames (ie, from frame -> nonframe). -TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { +TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); @@ -312,11 +305,11 @@ TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { ASSERT_TRUE(tab_->NavigateToURL(frames)); EXPECT_EQ(L"bot1", GetTabTitle()); - ClickLink(L"aform"); + ClickLink("aform"); EXPECT_EQ(L"form", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - SubmitForm(L"isubmit"); + SubmitForm("isubmit"); EXPECT_EQ(L"text=&select=a", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); @@ -338,11 +331,10 @@ TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { EXPECT_EQ(L"form", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); - SubmitForm(L"isubmit"); + SubmitForm("isubmit"); EXPECT_EQ(L"text=&select=a", GetTabTitle()); EXPECT_EQ(frames, GetTabURL()); } -#endif // Test that back/forward entries are created for reference fragment // navigations. Bug 730379. @@ -499,8 +491,7 @@ TEST_F(SessionHistoryTest, JavascriptHistory) { // This test is flaky and has been disabled. It looks like the server does not // start fast enough, and the navigation fails (with 404). See bug 8444. -#if 0 -TEST_F(SessionHistoryTest, LocationReplace) { +TEST_F(SessionHistoryTest, DISABLED_LocationReplace) { // Test that using location.replace doesn't leave the title of the old page // visible. scoped_refptr<HTTPTestServer> server = @@ -511,4 +502,3 @@ TEST_F(SessionHistoryTest, LocationReplace) { "files/session_history/replace.html?no-title.html"))); EXPECT_EQ(L"", GetTabTitle()); } -#endif diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index f75a25e8..a149fea 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1918,14 +1918,12 @@ 'browser/login_prompt_uitest.cc', 'browser/metrics/metrics_service_uitest.cc', 'browser/renderer_host/resource_dispatcher_host_uitest.cc', - 'browser/sanity_uitest.cc', 'browser/sessions/session_restore_uitest.cc', 'browser/tab_contents/view_source_uitest.cc', 'common/net/cache_uitest.cc', 'common/pref_service_uitest.cc', 'test/reliability/page_load_test.cc', 'test/ui/dom_checker_uitest.cc', - 'test/ui/history_uitest.cc', 'test/ui/layout_plugin_uitest.cpp', 'test/ui/omnibox_uitest.cc', ], diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 8b62ef3..0b1469b 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -4,6 +4,9 @@ #include "chrome/common/url_constants.h" +// TODO(port): Remove this header when last ifdef is removed from this file. +#include "build/build_config.h" + namespace chrome { const char kAboutScheme[] = "about"; @@ -34,7 +37,12 @@ const char kChromeUIHistoryURL[] = "chrome-ui://history/"; const char kChromeUIInspectorURL[] = "chrome-ui://inspector/"; const char kChromeUIIPCURL[] = "chrome-ui://about/ipc"; const char kChromeUINetworkURL[] = "chrome-ui://about/network"; +#if defined(OS_LINUX) +// TODO(port): Remove ifdef when we think that Linux splash page is not needed. +const char kChromeUINewTabURL[] = "about:linux-splash"; +#else const char kChromeUINewTabURL[] = "chrome-ui://newtab"; +#endif const char kChromeUIDevToolsHost[] = "devtools"; const char kChromeUIDownloadsHost[] = "downloads"; diff --git a/chrome/test/ui/inspector_controller_uitest.cc b/chrome/test/ui/inspector_controller_uitest.cc index 140e6f4..6bf9664 100644 --- a/chrome/test/ui/inspector_controller_uitest.cc +++ b/chrome/test/ui/inspector_controller_uitest.cc @@ -3,16 +3,14 @@ // found in the LICENSE file. #include "base/command_line.h" -#include "base/no_windows2000_unittest.h" -#include "base/win_util.h" +#include "base/scoped_ptr.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/url_request/url_request_unittest.h" -// This test does not work on win2k. See http://b/1070036 -class InspectorControllerTest : public NoWindows2000Test<UITest> { +class InspectorControllerTest : public UITest { protected: TabProxy* GetActiveTabProxy() { scoped_ptr<BrowserProxy> window_proxy(automation()->GetBrowserWindow(0)); @@ -31,9 +29,6 @@ class InspectorControllerTest : public NoWindows2000Test<UITest> { // This test also does not work in single process. See http://b/1214920 // Disabled, see http://crbug.com/4655 TEST_F(InspectorControllerTest, DISABLED_InspectElement) { - if (IsTestCaseDisabled()) - return; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) return; diff --git a/chrome/test/ui/ui_tests.scons b/chrome/test/ui/ui_tests.scons index c282092..0945b4e3 100644 --- a/chrome/test/ui/ui_tests.scons +++ b/chrome/test/ui/ui_tests.scons @@ -234,8 +234,6 @@ input_files = ChromeFileList([ if not env.Bit('windows'): # TODO(port): mark which of these work and which don't. input_files.Remove( - 'history_uitest.cc', - 'inspector_controller_uitest.cc', 'layout_plugin_uitest.cpp', 'npapi_test_helper.cc', 'npapi_uitest.cpp', @@ -250,15 +248,12 @@ if not env.Bit('windows'): '$CHROME_DIR/browser/download/download_uitest.cc', '$CHROME_DIR/browser/download/save_page_uitest.cc', '$CHROME_DIR/browser/errorpage_uitest.cc', - '$CHROME_DIR/browser/history/redirect_uitest.cc', '$CHROME_DIR/browser/iframe_uitest.cc', '$CHROME_DIR/browser/interstitial_page_uitest.cc', - '$CHROME_DIR/browser/locale_tests_uitest.cc', '$CHROME_DIR/browser/login_prompt_uitest.cc', '$CHROME_DIR/browser/metrics/metrics_service_uitest.cc', '$CHROME_DIR/browser/printing/printing_layout_uitest.cc', '$CHROME_DIR/browser/renderer_host/resource_dispatcher_host_uitest.cc', - '$CHROME_DIR/browser/sanity_uitest.cc', '$CHROME_DIR/browser/session_history_uitest.cc', '$CHROME_DIR/browser/sessions/session_restore_uitest.cc', '$CHROME_DIR/browser/ssl/ssl_uitest.cc', |