summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 19:08:02 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 19:08:02 +0000
commit63fb3f856dda398cc82782a6be635a8c55df4f85 (patch)
tree05a1a4accbf5fbb723fc428091d62b2928192ba1 /chrome_frame/test
parentbff69fd91bdab01463cb3505ccbbba51cd373d4b (diff)
downloadchromium_src-63fb3f856dda398cc82782a6be635a8c55df4f85.zip
chromium_src-63fb3f856dda398cc82782a6be635a8c55df4f85.tar.gz
chromium_src-63fb3f856dda398cc82782a6be635a8c55df4f85.tar.bz2
Allow TabContentsDelegate classes to specify whether InfoBars are enabled.
Allow ChromeFrame to pass infobar enabled parameter to ExternalTabContainer. BUG=2444936 Patch contributed by ericdingle@google.com Original review at http://codereview.chromium.org/890005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/automation_client_mock.cc73
-rw-r--r--chrome_frame/test/chrome_frame_automation_mock.h26
2 files changed, 85 insertions, 14 deletions
diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc
index f699635..b64a7cb 100644
--- a/chrome_frame/test/automation_client_mock.cc
+++ b/chrome_frame/test/automation_client_mock.cc
@@ -100,7 +100,17 @@ TEST(CFACWithChrome, CreateTooFast) {
.Times(1)
.WillOnce(QUIT_LOOP(loop));
- EXPECT_TRUE(client->Initialize(&cfd, timeout, false, profile, L"", false));
+ ChromeFrameLaunchParams cfp = {
+ timeout,
+ GURL(),
+ GURL(),
+ profile,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client->Initialize(&cfd, cfp));
loop.RunFor(10);
client->Uninitialize();
}
@@ -125,7 +135,17 @@ TEST(CFACWithChrome, CreateNotSoFast) {
EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(_, _))
.Times(0);
- EXPECT_TRUE(client->Initialize(&cfd, timeout, false, profile, L"", false));
+ ChromeFrameLaunchParams cfp = {
+ timeout,
+ GURL(),
+ GURL(),
+ profile,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client->Initialize(&cfd, cfp));
loop.RunFor(11);
client->Uninitialize();
@@ -165,7 +185,17 @@ TEST(CFACWithChrome, NavigateOk) {
.WillOnce(QUIT_LOOP(loop));
}
- EXPECT_TRUE(client->Initialize(&cfd, timeout, false, profile, L"", false));
+ ChromeFrameLaunchParams cfp = {
+ timeout,
+ GURL(),
+ GURL(),
+ profile,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client->Initialize(&cfd, cfp));
loop.RunFor(10);
client->Uninitialize();
client = NULL;
@@ -204,7 +234,17 @@ TEST(CFACWithChrome, NavigateFailed) {
.Times(1)
.WillOnce(QUIT_LOOP_SOON(loop, 2));
- EXPECT_TRUE(client->Initialize(&cfd, 10000, false, profile, L"", false));
+ ChromeFrameLaunchParams cfp = {
+ 10000,
+ GURL(),
+ GURL(),
+ profile,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client->Initialize(&cfd, cfp));
loop.RunFor(10);
client->Uninitialize();
@@ -237,7 +277,17 @@ TEST_F(CFACMockTest, MockedCreateTabOk) {
EXPECT_CALL(proxy_, CancelAsync(_)).Times(testing::AnyNumber());
// Here we go!
- EXPECT_TRUE(client_->Initialize(&cfd_, timeout, false, profile_, L"", false));
+ ChromeFrameLaunchParams cfp = {
+ timeout,
+ GURL(),
+ GURL(),
+ profile_,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client_->Initialize(&cfd_, cfp));
loop_.RunFor(10);
client_->Uninitialize();
}
@@ -262,8 +312,17 @@ TEST_F(CFACMockTest, MockedCreateTabFailed) {
Set_CFD_LaunchFailed(AUTOMATION_CREATE_TAB_FAILED);
// Here we go!
- EXPECT_TRUE(client_->Initialize(&cfd_, timeout_, false, profile_, L"",
- false));
+ ChromeFrameLaunchParams cfp = {
+ timeout_,
+ GURL(),
+ GURL(),
+ profile_,
+ L"",
+ false,
+ false,
+ false
+ };
+ EXPECT_TRUE(client_->Initialize(&cfd_, cfp));
loop_.RunFor(4);
client_->Uninitialize();
}
diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h
index 6fea200..d751f1b 100644
--- a/chrome_frame/test/chrome_frame_automation_mock.h
+++ b/chrome_frame/test/chrome_frame_automation_mock.h
@@ -20,13 +20,23 @@ class AutomationMockDelegate
AutomationMockDelegate(MessageLoop* caller_message_loop,
int launch_timeout, bool perform_version_check,
const std::wstring& profile_name,
- const std::wstring& extra_chrome_arguments, bool incognito)
+ const std::wstring& extra_chrome_arguments, bool incognito,
+ bool is_widget_mode)
: caller_message_loop_(caller_message_loop), is_connected_(false),
navigation_result_(false) {
test_server_.SetUp();
automation_client_ = new ChromeFrameAutomationClient;
- automation_client_->Initialize(this, launch_timeout, perform_version_check,
- profile_name, extra_chrome_arguments, incognito);
+ ChromeFrameLaunchParams cfp = {
+ launch_timeout,
+ GURL(),
+ GURL(),
+ profile_name,
+ extra_chrome_arguments,
+ perform_version_check,
+ incognito,
+ is_widget_mode
+ };
+ automation_client_->Initialize(this, cfp);
}
~AutomationMockDelegate() {
if (automation_client_.get()) {
@@ -130,7 +140,8 @@ class AutomationMockLaunch
typedef AutomationMockDelegate<AutomationMockLaunch> Base;
AutomationMockLaunch(MessageLoop* caller_message_loop,
int launch_timeout)
- : Base(caller_message_loop, launch_timeout, true, L"", L"", false) {
+ : Base(caller_message_loop, launch_timeout, true, L"", L"", false,
+ false) {
}
virtual void OnAutomationServerReady() {
Base::OnAutomationServerReady();
@@ -147,7 +158,8 @@ class AutomationMockNavigate
typedef AutomationMockDelegate<AutomationMockNavigate> Base;
AutomationMockNavigate(MessageLoop* caller_message_loop,
int launch_timeout)
- : Base(caller_message_loop, launch_timeout, true, L"", L"", false) {
+ : Base(caller_message_loop, launch_timeout, true, L"", L"", false,
+ false) {
}
virtual void OnLoad(int tab_handle, const GURL& url) {
Base::OnLoad(tab_handle, url);
@@ -161,7 +173,7 @@ class AutomationMockPostMessage
typedef AutomationMockDelegate<AutomationMockPostMessage> Base;
AutomationMockPostMessage(MessageLoop* caller_message_loop,
int launch_timeout)
- : Base(caller_message_loop, launch_timeout, true, L"", L"", false),
+ : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false),
postmessage_result_(false) {}
bool postmessage_result() const {
return postmessage_result_;
@@ -189,7 +201,7 @@ class AutomationMockHostNetworkRequestStart
typedef AutomationMockDelegate<AutomationMockHostNetworkRequestStart> Base;
AutomationMockHostNetworkRequestStart(MessageLoop* caller_message_loop,
int launch_timeout)
- : Base(caller_message_loop, launch_timeout, true, L"", L"", false),
+ : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false),
request_start_result_(false) {
if (automation()) {
automation()->set_use_chrome_network(false);