summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/automation_client_mock.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 04:34:43 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 04:34:43 +0000
commit354bcbaf8603cb5800737f86a84ee465166b2b4e (patch)
tree863753d52b8f9dfb54e676bbf3d1b38a968df061 /chrome_frame/test/automation_client_mock.cc
parent0e097f90d5bba038b5826ebac2870aadde28d2ca (diff)
downloadchromium_src-354bcbaf8603cb5800737f86a84ee465166b2b4e.zip
chromium_src-354bcbaf8603cb5800737f86a84ee465166b2b4e.tar.gz
chromium_src-354bcbaf8603cb5800737f86a84ee465166b2b4e.tar.bz2
Add support for gcf:about:plugins in chrome frame full tab mode. The URL validation code path
in ChromeFrame now takes in an interface NavigationConstraints which allows the delegateslike the ActiveX, ActiveDocument and the NPAPI plugins to control the navigation decisions. We no longer refer to the InternetSecurityManager interface which is IE only for performing zone decisions in the ChromeFrame NPAPI plugin. Fixes bug http://code.google.com/p/chromium/issues/detail?id=66118 BUG=66118 TEST=Covered by additional CanNavigate unit tests. Review URL: http://codereview.chromium.org/5698005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/automation_client_mock.cc')
-rw-r--r--chrome_frame/test/automation_client_mock.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc
index c02d7e0d..729ecbd 100644
--- a/chrome_frame/test/automation_client_mock.cc
+++ b/chrome_frame/test/automation_client_mock.cc
@@ -4,9 +4,10 @@
#include "chrome_frame/test/automation_client_mock.h"
#include "base/callback.h"
-#include "net/base/net_errors.h"
#include "chrome_frame/custom_sync_call_context.h"
+#include "chrome_frame/navigation_constraints.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
+#include "net/base/net_errors.h"
#define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
#include "testing/gmock_mutant.h"
@@ -85,8 +86,8 @@ ACTION_P4(HandleCreateTab, tab_handle, external_tab_container, tab_wnd,
delete context;
}
-ACTION_P4(InitiateNavigation, client, url, referrer, privileged) {
- client->InitiateNavigation(url, referrer, privileged);
+ACTION_P4(InitiateNavigation, client, url, referrer, constraints) {
+ client->InitiateNavigation(url, referrer, constraints);
}
// We mock ChromeFrameDelegate only. The rest is with real AutomationProxy
@@ -151,6 +152,8 @@ TEST(CFACWithChrome, CreateNotSoFast) {
TEST(CFACWithChrome, NavigateOk) {
MockCFDelegate cfd;
+ NavigationConstraintsImpl navigation_constraints;
+
chrome_frame_test::TimedMsgLoop loop;
const std::string url = "about:version";
const FilePath profile_path(
@@ -162,7 +165,8 @@ TEST(CFACWithChrome, NavigateOk) {
EXPECT_CALL(cfd, OnAutomationServerReady())
.WillOnce(InitiateNavigation(client.get(),
- url, std::string(), false));
+ url, std::string(),
+ &navigation_constraints));
EXPECT_CALL(cfd, GetBounds(_)).Times(testing::AnyNumber());
@@ -196,6 +200,7 @@ TEST(CFACWithChrome, NavigateOk) {
TEST(CFACWithChrome, NavigateFailed) {
MockCFDelegate cfd;
+ NavigationConstraintsImpl navigation_constraints;
chrome_frame_test::TimedMsgLoop loop;
const FilePath profile_path(
chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter"));
@@ -210,7 +215,7 @@ TEST(CFACWithChrome, NavigateFailed) {
EXPECT_CALL(cfd, OnAutomationServerReady())
.WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
client.get(), &ChromeFrameAutomationClient::InitiateNavigation,
- url, std::string(), false))));
+ url, std::string(), &navigation_constraints))));
EXPECT_CALL(cfd, GetBounds(_)).Times(testing::AnyNumber());
EXPECT_CALL(cfd, OnNavigationStateChanged(_, _)).Times(testing::AnyNumber());
@@ -419,6 +424,8 @@ TEST_F(CFACMockTest, OnChannelError) {
TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) {
int timeout = 500;
+ NavigationConstraintsImpl navigation_constraints;
+
CreateTab();
SetAutomationServerOk(1);
@@ -439,7 +446,7 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) {
EXPECT_CALL(cfd_, OnAutomationServerReady())
.WillOnce(InitiateNavigation(client_.get(),
std::string("http://www.nonexistent.com"),
- std::string(), false));
+ std::string(), &navigation_constraints));
EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property(
&IPC::SyncMessage::type, AutomationMsg_NavigateInExternalTab::ID),