summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 18:22:19 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 18:22:19 +0000
commitc4e944f68c080d06737f15ecb60fa69caf001275 (patch)
treeb10cb8b19f79b8c8d3d308e2ad083dae6fb27a92 /chrome/test/automation
parent197ea64be37bf1aeadde177a9e2d8bedcab8775c (diff)
downloadchromium_src-c4e944f68c080d06737f15ecb60fa69caf001275.zip
chromium_src-c4e944f68c080d06737f15ecb60fa69caf001275.tar.gz
chromium_src-c4e944f68c080d06737f15ecb60fa69caf001275.tar.bz2
Get tab HWND directly as result of CreateExternalTab automation call.
BUG=none TEST=none Review URL: http://codereview.chromium.org/119448 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rwxr-xr-xchrome/test/automation/automation_messages_internal.h5
-rw-r--r--chrome/test/automation/automation_proxy.cc3
-rw-r--r--chrome/test/automation/automation_proxy.h2
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc12
4 files changed, 14 insertions, 8 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 7682807..d746202 100755
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -426,12 +426,13 @@ IPC_BEGIN_MESSAGES(Automation)
// gfx::Rect - initial dimensions.
// style - window style to be used at the time of cration.
// incognito - use off-the-record profile
- IPC_SYNC_MESSAGE_ROUTED4_2(AutomationMsg_CreateExternalTab,
+ IPC_SYNC_MESSAGE_ROUTED4_3(AutomationMsg_CreateExternalTab,
HWND /* owner_or_parent*/,
gfx::Rect /* dimensions */,
unsigned int /* style */,
bool /* off-the-record profile */,
- HWND /* The window handle is returned here */,
+ HWND, // Tab container HWND
+ HWND, // Tab HWND
int /* Handle to the new tab */)
#endif // defined(OS_WIN)
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index e54f6a6..27f1701d 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -486,7 +486,7 @@ bool AutomationProxy::OpenNewBrowserWindow(bool show) {
// TODO(port): Replace HWNDs.
scoped_refptr<TabProxy> AutomationProxy::CreateExternalTab(HWND parent,
const gfx::Rect& dimensions, unsigned int style, bool incognito,
- HWND* external_tab_container) {
+ HWND* external_tab_container, HWND* tab) {
IPC::Message* response = NULL;
int handle = 0;
@@ -494,6 +494,7 @@ scoped_refptr<TabProxy> AutomationProxy::CreateExternalTab(HWND parent,
Send(new AutomationMsg_CreateExternalTab(0, parent, dimensions, style,
incognito,
external_tab_container,
+ tab,
&handle));
if (!succeeded) {
return NULL;
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index b1cec94..11bf615 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -194,7 +194,7 @@ class AutomationProxy : public IPC::Channel::Listener,
// that can be reparented in another process.
scoped_refptr<TabProxy> CreateExternalTab(HWND parent,
const gfx::Rect& dimensions, unsigned int style, bool incognito,
- HWND* external_tab_container);
+ HWND* external_tab_container, HWND* tab);
#endif // defined(OS_WIN)
int command_execution_timeout_ms() const {
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index bb838dd..c6c71c8 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -759,8 +759,9 @@ void AutomationProxyForExternalTab::OnForwardMessageToExternalHost(
TEST_F(ExternalTabTestType, CreateExternalTab) {
HWND external_tab_container = NULL;
+ HWND tab_wnd = NULL;
scoped_refptr<TabProxy> tab(automation()->CreateExternalTab(NULL, gfx::Rect(),
- WS_POPUP, false, &external_tab_container));
+ WS_POPUP, false, &external_tab_container, &tab_wnd));
EXPECT_TRUE(tab != NULL);
EXPECT_NE(FALSE, ::IsWindow(external_tab_container));
if (tab != NULL) {
@@ -774,12 +775,13 @@ TEST_F(ExternalTabTestType, CreateExternalTab) {
TEST_F(ExternalTabTestType, IncognitoMode) {
HWND external_tab_container = NULL;
+ HWND tab_wnd = NULL;
GURL url("http://anatomyofmelancholy.net");
std::string value_result;
// Create incognito tab
scoped_refptr<TabProxy> tab(automation()->CreateExternalTab(NULL, gfx::Rect(),
- WS_POPUP, true, &external_tab_container));
+ WS_POPUP, true, &external_tab_container, &tab_wnd));
EXPECT_TRUE(tab->SetCookie(url, "robert=burton; "
"expires=Thu, 13 Oct 2011 05:04:03 UTC;"));
EXPECT_TRUE(tab->GetCookieByName(url, "robert", &value_result));
@@ -790,9 +792,10 @@ TEST_F(ExternalTabTestType, IncognitoMode) {
value_result.empty();
clear_profile_ = false;
external_tab_container = NULL;
+ tab_wnd = NULL;
LaunchBrowserAndServer();
tab = automation()->CreateExternalTab(NULL, gfx::Rect(),
- WS_POPUP, false, &external_tab_container);
+ WS_POPUP, false, &external_tab_container, &tab_wnd);
EXPECT_TRUE(tab->GetCookieByName(url, "robert", &value_result));
EXPECT_EQ("", value_result);
}
@@ -802,8 +805,9 @@ TEST_F(ExternalTabTestType, ExternalTabPostMessage) {
static_cast<AutomationProxyForExternalTab*>(automation());
HWND external_tab_container = NULL;
+ HWND tab_wnd = NULL;
scoped_refptr<TabProxy> tab(proxy->CreateExternalTab(NULL, gfx::Rect(),
- WS_POPUP, false, &external_tab_container));
+ WS_POPUP, false, &external_tab_container, &tab_wnd));
EXPECT_TRUE(tab != NULL);
EXPECT_NE(FALSE, ::IsWindow(external_tab_container));
if (tab != NULL) {