diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 17:37:37 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 17:37:37 +0000 |
commit | 48b0c73db08d6ddcde41014a23368ec70d6bb7e7 (patch) | |
tree | f28de8c826d61bfb0e57ba76d0208044e667f411 | |
parent | 34dbaaa865d593af848909a409217df08e667f37 (diff) | |
download | chromium_src-48b0c73db08d6ddcde41014a23368ec70d6bb7e7.zip chromium_src-48b0c73db08d6ddcde41014a23368ec70d6bb7e7.tar.gz chromium_src-48b0c73db08d6ddcde41014a23368ec70d6bb7e7.tar.bz2 |
Platform cleanup in chrome UI tests.
Can't include them in the Linux build yet because they
wouldn't pass.
Review URL: http://codereview.chromium.org/57010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12780 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/metrics/metrics_service_uitest.cc | 7 | ||||
-rw-r--r-- | chrome/common/net/cache_uitest.cc | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc index 41122f6..c61a39d 100644 --- a/chrome/browser/metrics/metrics_service_uitest.cc +++ b/chrome/browser/metrics/metrics_service_uitest.cc @@ -9,6 +9,7 @@ #include "base/file_util.h" #include "base/path_service.h" +#include "base/platform_thread.h" #include "base/process_util.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/common/chrome_constants.h" @@ -91,11 +92,13 @@ TEST_F(MetricsServiceTest, CrashRenderers) { int process_id = 0; ASSERT_TRUE(tab->GetProcessID(&process_id)); ASSERT_NE(0, process_id); + base::ProcessHandle process_handle = base::OpenProcessHandle(process_id); // Fake Access Violation. - base::KillProcessById(process_id, 0xc0000005, true); + base::KillProcess(process_handle, 0xc0000005, true); + base::CloseProcessHandle(process_handle); // Give the browser a chance to notice the crashed tab. - Sleep(1000); + PlatformThread::Sleep(1000); QuitBrowser(); diff --git a/chrome/common/net/cache_uitest.cc b/chrome/common/net/cache_uitest.cc index 99b4186..251d495 100644 --- a/chrome/common/net/cache_uitest.cc +++ b/chrome/common/net/cache_uitest.cc @@ -4,6 +4,7 @@ #include <string> +#include "base/platform_thread.h" #include "base/string_util.h" #include "chrome/test/ui/ui_test.h" #include "chrome/test/automation/automation_proxy.h" @@ -62,7 +63,7 @@ void CacheTest::RunCacheTest(const std::wstring &url, NavigateToURL(test_page); std::wstring original_time = GetActiveTabTitle(); - Sleep(kWaitForCacheUpdateMsec); + PlatformThread::Sleep(kWaitForCacheUpdateMsec); GetNewTab(automation(), test_page); std::wstring revisit_time = GetActiveTabTitle(); @@ -73,7 +74,7 @@ void CacheTest::RunCacheTest(const std::wstring &url, EXPECT_NE(original_time, revisit_time); } - Sleep(kWaitForCacheUpdateMsec); + PlatformThread::Sleep(kWaitForCacheUpdateMsec); // Force reload, overriding the caching behavior NavigateToURL(test_page); @@ -82,7 +83,7 @@ void CacheTest::RunCacheTest(const std::wstring &url, EXPECT_NE(revisit_time, reload_time); if (expect_delayed_reload) { - Sleep(kWaitForCacheUpdateMsec * kCacheWaitMultiplier); + PlatformThread::Sleep(kWaitForCacheUpdateMsec * kCacheWaitMultiplier); GetNewTab(automation(), test_page); revisit_time = GetActiveTabTitle(); |