summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 23:15:47 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 23:15:47 +0000
commit3753f52d42975eaefcafca9fc0257ec24e161a9c (patch)
treec9622baf613dd1b47c304d30e1ded74fa84fce54 /chrome/browser/automation
parent9e23bb1bba29dad5305e8f8a08341aefe7275502 (diff)
downloadchromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.zip
chromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.tar.gz
chromium_src-3753f52d42975eaefcafca9fc0257ec24e161a9c.tar.bz2
Implement chrome_proces_util for linux and enable download ui test.
To get the PID from the socket, we use lsof (fuser doesn't work with unix sockets apparently). The download shelf, save page, and browser ui tests now pass. Review URL: http://codereview.chromium.org/66071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc18
-rw-r--r--chrome/browser/automation/automation_provider.h2
-rw-r--r--chrome/browser/automation/automation_window_tracker.h6
3 files changed, 17 insertions, 9 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 1f1adc2..34d1599 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/tab_contents/web_contents_view.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/notification_registrar.h"
+#include "chrome/common/platform_util.h"
#include "chrome/common/pref_service.h"
#include "chrome/test/automation/automation_messages.h"
#include "net/base/cookie_monster.h"
@@ -1038,6 +1039,8 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
OverrideEncoding)
IPC_MESSAGE_HANDLER(AutomationMsg_SavePackageShouldPromptUser,
SavePackageShouldPromptUser)
+ IPC_MESSAGE_HANDLER(AutomationMsg_WindowTitle,
+ GetWindowTitle)
IPC_END_MESSAGE_MAP()
}
@@ -1896,14 +1899,9 @@ void AutomationProvider::ExecuteJavascript(int handle,
void AutomationProvider::GetShelfVisibility(int handle, bool* visible) {
*visible = false;
-#if defined(OS_WIN)
WebContents* web_contents = GetWebContentsForHandle(handle, NULL);
if (web_contents)
*visible = web_contents->IsDownloadShelfVisible();
-#else
- // TODO(port): Enable when web_contents->IsDownloadShelfVisible is ported.
- NOTIMPLEMENTED();
-#endif
}
void AutomationProvider::GetConstrainedWindowCount(int handle, int* count) {
@@ -2450,7 +2448,7 @@ void AutomationProvider::IsPageMenuCommandEnabled(int browser_handle,
}
#if defined(OS_WIN)
-// TODO(port): Enable these.
+// TODO(port): Enable this.
void AutomationProvider::PrintNow(int tab_handle,
IPC::Message* reply_message) {
NavigationController* tab = NULL;
@@ -2467,6 +2465,7 @@ void AutomationProvider::PrintNow(int tab_handle,
AutomationMsg_PrintNow::WriteReplyParams(reply_message, false);
Send(reply_message);
}
+#endif
void AutomationProvider::SavePage(int tab_handle,
const std::wstring& file_name,
@@ -2496,6 +2495,8 @@ void AutomationProvider::SavePage(int tab_handle,
*success = true;
}
+#if defined(OS_WIN)
+// TODO(port): Enable these.
void AutomationProvider::GetAutocompleteEditText(int autocomplete_edit_handle,
bool* success,
std::wstring* text) {
@@ -2850,3 +2851,8 @@ void AutomationProvider::OnTabReposition(
}
#endif // defined(OS_WIN)
+
+void AutomationProvider::GetWindowTitle(int handle, string16* text) {
+ gfx::NativeWindow window = window_tracker_->GetResource(handle);
+ text->assign(platform_util::GetWindowTitle(window));
+}
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index d704fa3..01698b4 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -416,6 +416,8 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
void SavePackageShouldPromptUser(bool should_prompt);
+ void GetWindowTitle(int handle, string16* text);
+
// Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer
// to the tab is also returned. Returns NULL in case of failure or if the tab
// is not of the WebContents type.
diff --git a/chrome/browser/automation/automation_window_tracker.h b/chrome/browser/automation/automation_window_tracker.h
index cc70dd8..1b9aff8 100644
--- a/chrome/browser/automation/automation_window_tracker.h
+++ b/chrome/browser/automation/automation_window_tracker.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H__
-#define CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H__
+#ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H_
+#define CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H_
#include "base/gfx/native_widget_types.h"
#include "build/build_config.h"
@@ -51,4 +51,4 @@ class AutomationWindowTracker
}
};
-#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H__
+#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_WINDOW_TRACKER_H_