diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 17:22:07 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 17:22:07 +0000 |
commit | d2bc6742a48ce48bd957cd812bf327dbfa7dce13 (patch) | |
tree | b8450f4be790881bf10f511289a0adf3aa6826ad | |
parent | d9c964d64dc835bcabbaaf1a88d0030bb2abadee (diff) | |
download | chromium_src-d2bc6742a48ce48bd957cd812bf327dbfa7dce13.zip chromium_src-d2bc6742a48ce48bd957cd812bf327dbfa7dce13.tar.gz chromium_src-d2bc6742a48ce48bd957cd812bf327dbfa7dce13.tar.bz2 |
Modify the expectations. Under some circumstances, the NCCALCSIZE event may be sent twice. Expect the sequence of NCCALCSIZE, MOVE, SIZE either 0 or 1 times.
BUG=None
TEST=chrome_frame_unittests --gtest_filter=Infobar*
Review URL: http://codereview.chromium.org/5549006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68178 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/test/infobar_unittests.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome_frame/test/infobar_unittests.cc b/chrome_frame/test/infobar_unittests.cc index b84c79a..63e910c 100644 --- a/chrome_frame/test/infobar_unittests.cc +++ b/chrome_frame/test/infobar_unittests.cc @@ -195,6 +195,22 @@ template <typename WINDOW, typename DELEGATE> void ExpectNcCalcSizeSequence( EXPECT_CALL(*mock_window, OnSize(0, CSize(modified_rect->right - modified_rect->left, modified_rect->bottom - modified_rect->top))); + + EXPECT_CALL(*mock_window, OnNcCalcSize(true, testing::_)) + .Times(testing::Between(0, 1)) + .WillOnce(RespondToNcCalcSize(0, natural_rect)); + EXPECT_CALL(*delegate, + AdjustDisplacedWindowDimensions(EqualRect(natural_rect))) + .Times(testing::Between(0, 1)) + .WillOnce(testing::SetArgumentPointee<0>(*modified_rect)); + EXPECT_CALL(*mock_window, OnMove(CPoint(modified_rect->left, + modified_rect->top))) + .Times(testing::Between(0, 1)); + EXPECT_CALL(*mock_window, + OnSize(0, CSize(modified_rect->right - modified_rect->left, + modified_rect->bottom - modified_rect->top))) + .Times(testing::Between(0, 1)); + } template <typename WINDOW, typename DELEGATE, typename MANAGER> @@ -211,6 +227,9 @@ template <typename WINDOW, typename DELEGATE, typename MANAGER> // and subclasses the displaced window on demand. manager->UpdateLayout(); + testing::Mock::VerifyAndClearExpectations(mock_window); + testing::Mock::VerifyAndClearExpectations(delegate); + ExpectNcCalcSizeSequence( mock_window, delegate, &natural_rects[1], &natural_rects[1]); // The second time through, trigger it through the original window. |