diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 14:09:37 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 14:09:37 +0000 |
commit | bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9 (patch) | |
tree | ee15898939e4989b96c6419217696f63d7a5585b /chrome_frame/chrome_frame_npapi_unittest.cc | |
parent | e721ebe885b159f9b18047392be9a0f5834998fb (diff) | |
download | chromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.zip chromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.tar.gz chromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.tar.bz2 |
Handle automation server crashes. When Chrome crashes, we now handle the case and support document refresh or reload.
When chrome crashes, we draw a poor man's sad tab (":-("), so that can clearly be improved.
Another thing is that if the chrome instance that crashed held several navigational entries, then that history is lost.
TEST=There are a couple of tests included, so run those (*TabCrash*) and also verify that when the chrome automation server is killed that we do the right thing. Also check info in bug report.
BUG=25839
Review URL: http://codereview.chromium.org/3061036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_npapi_unittest.cc')
-rw-r--r-- | chrome_frame/chrome_frame_npapi_unittest.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/chrome_frame/chrome_frame_npapi_unittest.cc b/chrome_frame/chrome_frame_npapi_unittest.cc index e845bb5..324fad1 100644 --- a/chrome_frame/chrome_frame_npapi_unittest.cc +++ b/chrome_frame/chrome_frame_npapi_unittest.cc @@ -81,7 +81,7 @@ class MockNPAPI: public ChromeFrameNPAPI { class MockAutomationClient: public ChromeFrameAutomationClient { public: MOCK_METHOD2(Initialize, bool(ChromeFrameDelegate*, - const ChromeFrameLaunchParams&)); + ChromeFrameLaunchParams*)); MOCK_METHOD1(SetEnableExtensionAutomation, void(const std::vector<std::string>&)); // NOLINT }; @@ -91,6 +91,16 @@ class MockProxyService: public NpProxyService { 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 { @@ -125,13 +135,12 @@ class TestNPAPIPrivilegedApi: public ::testing::Test { 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 @@ TEST_F(TestNPAPIPrivilegedProperty, } // TODO(siggi): test invoking postPrivateMessage. + |