diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 20:11:33 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 20:11:33 +0000 |
commit | 66791d2e106c85b5af82e176409e7caf682989bd (patch) | |
tree | 484301f60b9cc72359d6cc75a1f8a9724f9ced38 /chrome | |
parent | ea81ac968e926f50d62f24494479e8c12741d84d (diff) | |
download | chromium_src-66791d2e106c85b5af82e176409e7caf682989bd.zip chromium_src-66791d2e106c85b5af82e176409e7caf682989bd.tar.gz chromium_src-66791d2e106c85b5af82e176409e7caf682989bd.tar.bz2 |
Platform cleanup in automation code.
Review URL: http://codereview.chromium.org/27098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/automation/automation_browser_tracker.h | 2 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 6 | ||||
-rw-r--r-- | chrome/test/automation/automation_handle_tracker.cc | 4 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.cc | 10 | ||||
-rw-r--r-- | chrome/test/startup/startup_test.cc | 5 |
5 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/automation/automation_browser_tracker.h b/chrome/browser/automation/automation_browser_tracker.h index 4cbc62b..0f46756 100644 --- a/chrome/browser/automation/automation_browser_tracker.h +++ b/chrome/browser/automation/automation_browser_tracker.h @@ -13,7 +13,7 @@ class AutomationBrowserTracker : public AutomationResourceTracker<Browser*> { public: AutomationBrowserTracker(IPC::Message::Sender* automation) - : AutomationResourceTracker(automation) { } + : AutomationResourceTracker<Browser*>(automation) { } virtual ~AutomationBrowserTracker() { ClearAllMappings(); diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 926e507..d5a13d1 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -45,8 +45,8 @@ using base::Time; class InitialLoadObserver : public NotificationObserver { public: InitialLoadObserver(size_t tab_count, AutomationProvider* automation) - : outstanding_tab_count_(tab_count), - automation_(automation) { + : automation_(automation), + outstanding_tab_count_(tab_count) { if (outstanding_tab_count_ > 0) { NotificationService* service = NotificationService::current(); registrar_.Add(this, NotificationType::LOAD_START, @@ -318,8 +318,8 @@ class TabStripNotificationObserver : public NotificationObserver { TabStripNotificationObserver(Browser* parent, NotificationType notification, AutomationProvider* automation, int32 routing_id) : automation_(automation), - notification_(notification), parent_(parent), + notification_(notification), routing_id_(routing_id) { NotificationService::current()-> AddObserver(this, notification_, NotificationService::AllSources()); diff --git a/chrome/test/automation/automation_handle_tracker.cc b/chrome/test/automation/automation_handle_tracker.cc index e81d322..a0f2a29 100644 --- a/chrome/test/automation/automation_handle_tracker.cc +++ b/chrome/test/automation/automation_handle_tracker.cc @@ -10,9 +10,9 @@ AutomationResourceProxy::AutomationResourceProxy( AutomationHandleTracker* tracker, AutomationMessageSender* sender, AutomationHandle handle) - : tracker_(tracker), + : handle_(handle), + tracker_(tracker), sender_(sender), - handle_(handle), is_valid_(true) { tracker_->Add(this); } diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 8d0f87d..634d1e0 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -7,6 +7,8 @@ #include "chrome/test/automation/automation_proxy.h" #include "base/logging.h" +#include "base/platform_thread.h" +#include "base/process_util.h" #include "base/ref_counted.h" #include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_messages.h" @@ -192,7 +194,7 @@ void AutomationProxy::InitializeChannelID() { static int channel_counter = 0; std::wostringstream buf; - buf << L"ChromeTestingInterface:" << GetCurrentProcessId() << + buf << L"ChromeTestingInterface:" << base::GetCurrentProcId() << L"." << ++channel_counter; channel_id_ = buf.str(); } @@ -291,7 +293,7 @@ bool AutomationProxy::WaitForWindowCountToChange(int count, int* new_count, bool succeeded = GetBrowserWindowCount(new_count); if (!succeeded) return false; if (count != *new_count) return true; - Sleep(automation::kSleepTime); + PlatformThread::Sleep(automation::kSleepTime); } // Window count never changed. return false; @@ -310,7 +312,7 @@ bool AutomationProxy::WaitForWindowCountToBecome(int count, } else if (count == new_count) { return true; } - Sleep(automation::kSleepTime); + PlatformThread::Sleep(automation::kSleepTime); } // Window count never reached the value we sought. return false; @@ -471,7 +473,7 @@ TabProxy* AutomationProxy::CreateExternalTab(HWND parent, IPC::Message* response = NULL; int handle = 0; - bool succeeded = + bool succeeded = Send(new AutomationMsg_CreateExternalTab(0, parent, dimensions, style, external_tab_container, &handle)); diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc index 70b54de..c8cf02ae 100644 --- a/chrome/test/startup/startup_test.cc +++ b/chrome/test/startup/startup_test.cc @@ -4,6 +4,7 @@ #include "base/file_util.h" #include "base/path_service.h" +#include "base/platform_thread.h" #include "base/string_util.h" #include "base/time.h" #include "chrome/common/chrome_paths.h" @@ -15,7 +16,7 @@ using base::TimeTicks; namespace { -// Wrapper around CopyFile to retry 10 times if there is an error. +// Wrapper around CopyFile to retry 10 times if there is an error. // For some reasons on buildbot it happens quite often that // the test fails because the dll is still in use. bool CopyFileWrapper(const std::wstring &src, const std::wstring &dest) { @@ -65,7 +66,7 @@ class StartupTest : public UITest { timings[i] = end_time - browser_launch_time_; // TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we // do, we crash. - Sleep(50); + PlatformThread::Sleep(50); UITest::TearDown(); if (i == 0) { |