Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: chrome_frame/chrome_frame_npapi_unittest.cc

Issue 3061036: Handle automation server crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | chrome_frame/chrome_frame_plugin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_frame_npapi_unittest.cc
===================================================================
--- chrome_frame/chrome_frame_npapi_unittest.cc (revision 55540)
+++ chrome_frame/chrome_frame_npapi_unittest.cc (working copy)
@@ -81,7 +81,7 @@
class MockAutomationClient: public ChromeFrameAutomationClient {
public:
MOCK_METHOD2(Initialize, bool(ChromeFrameDelegate*,
- const ChromeFrameLaunchParams&));
+ ChromeFrameLaunchParams*));
MOCK_METHOD1(SetEnableExtensionAutomation,
void(const std::vector<std::string>&)); // NOLINT
};
@@ -91,7 +91,17 @@
MOCK_METHOD2(Initialize, bool(NPP instance, ChromeFrameAutomationClient*));
};
+namespace {
+MATCHER_P4(LaunchParamEq, version_check, extra, incognito, widget,
+ "Basic check for ChromeFrameLaunchParams") {
+ return arg->version_check() == version_check &&
+ arg->extra_arguments().compare(extra) == 0 &&
+ arg->incognito() == incognito,
+ arg->widget_mode() == widget;
+}
+}
+
// Test fixture to allow testing the privileged NPAPI APIs
class TestNPAPIPrivilegedApi: public ::testing::Test {
public:
@@ -125,13 +135,12 @@
EXPECT_CALL(*mock_proxy, Initialize(_, _)).WillRepeatedly(Return(false));
+ scoped_refptr<ChromeFrameLaunchParams> launch_params(
+ new ChromeFrameLaunchParams(GURL(), GURL(), FilePath(), profile_name,
+ extra_args, is_incognito, true));
+
EXPECT_CALL(*mock_automation,
- Initialize(_, AllOf(
- Field(&ChromeFrameLaunchParams::perform_version_check, true),
- Field(&ChromeFrameLaunchParams::extra_chrome_arguments,
- StrEq(extra_args)),
- Field(&ChromeFrameLaunchParams::incognito_mode, is_incognito),
- Field(&ChromeFrameLaunchParams::is_widget_mode, true))))
+ Initialize(_, LaunchParamEq(true, extra_args, is_incognito, true)))
.WillOnce(Return(true));
if (expect_privilege_check) {
@@ -554,3 +563,4 @@
}
// TODO(siggi): test invoking postPrivateMessage.
+
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | chrome_frame/chrome_frame_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698