summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/automation/automation_messages.h53
-rw-r--r--chrome/test/automation/automation_messages_internal.h8
-rw-r--r--chrome/test/automation/tab_proxy.cc17
-rw-r--r--chrome/test/automation/tab_proxy.h6
4 files changed, 84 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages.h b/chrome/test/automation/automation_messages.h
index ffeef1f..52a9945 100644
--- a/chrome/test/automation/automation_messages.h
+++ b/chrome/test/automation/automation_messages.h
@@ -120,6 +120,59 @@ struct ParamTraits<NavigationEntry::PageType> {
}
};
+#if defined(OS_WIN)
+struct Reposition_Params {
+ HWND window;
+ HWND window_insert_after;
+ int left;
+ int top;
+ int width;
+ int height;
+ int flags;
+};
+
+// Traits for SetWindowPos_Params structure to pack/unpack.
+template <>
+struct ParamTraits<Reposition_Params> {
+ typedef Reposition_Params param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.window);
+ WriteParam(m, p.window_insert_after);
+ WriteParam(m, p.left);
+ WriteParam(m, p.top);
+ WriteParam(m, p.width);
+ WriteParam(m, p.height);
+ WriteParam(m, p.flags);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return ReadParam(m, iter, &p->window) &&
+ ReadParam(m, iter, &p->window_insert_after) &&
+ ReadParam(m, iter, &p->left) &&
+ ReadParam(m, iter, &p->top) &&
+ ReadParam(m, iter, &p->width) &&
+ ReadParam(m, iter, &p->height) &&
+ ReadParam(m, iter, &p->flags);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.window, l);
+ l->append(L", ");
+ LogParam(p.window_insert_after, l);
+ l->append(L", ");
+ LogParam(p.left, l);
+ l->append(L", ");
+ LogParam(p.top, l);
+ l->append(L", ");
+ LogParam(p.width, l);
+ l->append(L", ");
+ LogParam(p.height, l);
+ l->append(L", ");
+ LogParam(p.flags, l);
+ l->append(L")");
+ }
+};
+#endif // defined(OS_WIN)
+
} // namespace IPC
#define MESSAGES_INTERNAL_FILE \
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 98474ac..15daa28 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -860,4 +860,12 @@ IPC_BEGIN_MESSAGES(Automation)
// None expected
IPC_MESSAGE_ROUTED2(AutomationMsg_NavigationFailed, int, GURL)
+#if defined(OS_WIN)
+ // This message is an outgoing message from an automation client to Chrome.
+ // It is used to reposition a chrome tab window.
+ IPC_MESSAGE_ROUTED2(AutomationMsg_TabReposition,
+ int /* tab handle */,
+ IPC::Reposition_Params /* SetWindowPos params */)
+#endif // defined(OS_WIN)
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 07656e8..1ac8b75 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -606,3 +606,20 @@ bool TabProxy::OverrideEncoding(const std::wstring& encoding) {
&succeeded));
return succeeded;
}
+
+#if defined(OS_WIN)
+void TabProxy::Reposition(HWND window, HWND window_insert_after, int left,
+ int top, int width, int height, int flags) {
+
+ IPC::Reposition_Params params;
+ params.window = window;
+ params.window_insert_after = window_insert_after;
+ params.left = left;
+ params.top = top;
+ params.width = width;
+ params.height = height;
+ params.flags = flags;
+ sender_->Send(new AutomationMsg_TabReposition(0, handle_, params));
+}
+#endif // defined(OS_WIN)
+
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index dc10a13..3603763 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -285,6 +285,12 @@ class TabProxy : public AutomationResourceProxy {
// Uses the specified encoding to override encoding of the page in the tab.
bool OverrideEncoding(const std::wstring& encoding);
+#if defined(OS_WIN)
+ // Resizes the tab window.
+ void Reposition(HWND window, HWND window_insert_after, int left, int top,
+ int width, int height, int flags);
+#endif // defined(OS_WIN)
+
private:
DISALLOW_COPY_AND_ASSIGN(TabProxy);
};