summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 23:21:31 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 23:21:31 +0000
commit5cc06369ee53fbde978506263f0b15735560cfd6 (patch)
tree635e0d9c60bb45f633ad220701e0a7513018f7fc /chrome/browser
parentc8bdcb753bcbe960bc239419180d085534ef8432 (diff)
downloadchromium_src-5cc06369ee53fbde978506263f0b15735560cfd6.zip
chromium_src-5cc06369ee53fbde978506263f0b15735560cfd6.tar.gz
chromium_src-5cc06369ee53fbde978506263f0b15735560cfd6.tar.bz2
linux: pass a bunch more ui tests.
Mostly random portability fixes: use portable functions, use FilePath, etc. Review URL: http://codereview.chromium.org/62117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/automation/automation_provider.cc2
-rw-r--r--chrome/browser/errorpage_uitest.cc4
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc16
-rw-r--r--chrome/browser/tab_contents/view_source_uitest.cc2
4 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 471b4bc..c8292ec 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -2509,6 +2509,7 @@ void AutomationProvider::OnMessageFromExternalHost(int handle,
view_host->ForwardMessageFromExternalHost(message, origin, target);
}
}
+#endif // defined(OS_WIN)
WebContents* AutomationProvider::GetWebContentsForHandle(
int handle, NavigationController** tab) {
@@ -2525,6 +2526,7 @@ WebContents* AutomationProvider::GetWebContentsForHandle(
return web_contents;
}
+#if defined(OS_WIN)
ExternalTabContainer* AutomationProvider::GetExternalTabForHandle(int handle) {
if (tab_tracker_->ContainsHandle(handle)) {
NavigationController* tab = tab_tracker_->GetResource(handle);
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc
index c020762..ff604d1 100644
--- a/chrome/browser/errorpage_uitest.cc
+++ b/chrome/browser/errorpage_uitest.cc
@@ -20,7 +20,7 @@ TEST_F(ErrorPageTest, DNSError) {
int i;
std::wstring title;
for (i = 0; i < 10; ++i) {
- Sleep(sleep_timeout_ms());
+ PlatformThread::Sleep(sleep_timeout_ms());
title = GetActiveTabTitle();
if (title.find(test_host) != std::wstring::npos) {
// Success, bail out.
@@ -49,7 +49,7 @@ TEST_F(ErrorPageTest, IFrame404) {
int i;
std::wstring title;
for (i = 0; i < 10; ++i) {
- Sleep(sleep_timeout_ms());
+ PlatformThread::Sleep(sleep_timeout_ms());
title = GetActiveTabTitle();
if (title == L"SUCCESS") {
// Success, bail out.
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 682336a..d6946a9 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -29,7 +29,7 @@ class ResourceDispatcherTest : public UITest {
int max_wait_time = 5000;
while (max_wait_time > 0) {
max_wait_time -= kCheckDelayMs;
- Sleep(kCheckDelayMs);
+ PlatformThread::Sleep(kCheckDelayMs);
if (expected_title == GetActiveTabTitle())
break;
}
@@ -65,7 +65,7 @@ TEST_F(ResourceDispatcherTest, DoNotSniffHTMLFromImageGIF) {
TEST_F(ResourceDispatcherTest, SniffNoContentTypeNoData) {
CheckTitleTest(L"content-sniffer-test3.html",
L"Content Sniffer Test 3");
- Sleep(sleep_timeout_ms() * 2);
+ PlatformThread::Sleep(sleep_timeout_ms() * 2);
EXPECT_EQ(1, GetTabCount());
// Make sure the download shelf is not showing.
@@ -210,7 +210,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) {
// Cause the renderer to crash.
expected_crashes_ = 1;
tab->NavigateToURLAsync(GURL("about:crash"));
- Sleep(sleep_timeout_ms()); // Wait for browser to notice the renderer crash.
+ // Wait for browser to notice the renderer crash.
+ PlatformThread::Sleep(sleep_timeout_ms());
// Navigate to a new cross-site page. The browser should not wait around for
// the old renderer's on{before}unload handlers to run.
@@ -268,7 +269,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
// reason as ErrorPageTest::DNSError. See bug 1199491.
tab->NavigateToURL(GURL(URLRequestFailedDnsJob::kTestUrl));
for (int i = 0; i < 10; ++i) {
- Sleep(sleep_timeout_ms());
+ PlatformThread::Sleep(sleep_timeout_ms());
if (GetActiveTabTitle() != L"set cookie on unload") {
// Success, bail out.
break;
@@ -289,10 +290,11 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
// the onunload handler, and the navigation would fail.
// (Test by redirecting to javascript:window.location='someURL'.)
GURL test_url(server->TestServerPageW(L"files/title2.html"));
- std::wstring redirect_url = L"javascript:window.location='" +
- ASCIIToWide(test_url.possibly_invalid_spec()) + L"'";
+ std::string redirect_url = "javascript:window.location='" +
+ test_url.possibly_invalid_spec() + "'";
tab->NavigateToURLAsync(GURL(redirect_url));
- Sleep(sleep_timeout_ms()); // Wait for JavaScript redirect to happen.
+ // Wait for JavaScript redirect to happen.
+ PlatformThread::Sleep(sleep_timeout_ms());
EXPECT_TRUE(tab->GetTabTitle(&tab_title));
EXPECT_EQ(L"Title Of Awesomeness", tab_title);
}
diff --git a/chrome/browser/tab_contents/view_source_uitest.cc b/chrome/browser/tab_contents/view_source_uitest.cc
index fed5ba5..ee16bf4 100644
--- a/chrome/browser/tab_contents/view_source_uitest.cc
+++ b/chrome/browser/tab_contents/view_source_uitest.cc
@@ -49,7 +49,7 @@ TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) {
url = GURL("view-source:" + url.spec());
scoped_ptr<TabProxy> tab(GetActiveTab());
tab->NavigateToURL(url);
- Sleep(sleep_timeout_ms());
+ PlatformThread::Sleep(sleep_timeout_ms());
// Try to retrieve the cookie that the page sets
// It should not be there (because we are in view-source mode