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

Unified Diff: chrome/browser/ui/toolbar/media_router_action_unittest.cc

Issue 1417893005: Fix MRDialogDelegate and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 2 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 | « no previous file | chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/media_router_action_unittest.cc
diff --git a/chrome/browser/ui/toolbar/media_router_action_unittest.cc b/chrome/browser/ui/toolbar/media_router_action_unittest.cc
index e00b567f8e32b17166736d60538998047829507b..d558ee7ae5e80acb168cd14d73bb5aa4cf249cdc 100644
--- a/chrome/browser/ui/toolbar/media_router_action_unittest.cc
+++ b/chrome/browser/ui/toolbar/media_router_action_unittest.cc
@@ -25,7 +25,7 @@ class MockToolbarActionViewDelegate : public ToolbarActionViewDelegate {
MockToolbarActionViewDelegate() {}
~MockToolbarActionViewDelegate() {}
- MOCK_CONST_METHOD0(GetCurrentWebContents, content::WebContents*());
+ MOCK_CONST_METHOD0(GetCurrentWebContents, WebContents*());
MOCK_METHOD0(UpdateState, void());
MOCK_CONST_METHOD0(IsMenuRunning, bool());
MOCK_METHOD1(OnPopupShown, void(bool by_user));
@@ -36,8 +36,6 @@ class TestMediaRouterAction : public MediaRouterAction {
public:
explicit TestMediaRouterAction(Browser* browser)
: MediaRouterAction(browser),
- web_contents_(WebContents::Create(WebContents::CreateParams(
- browser->profile()))),
controller_(nullptr),
platform_delegate_(nullptr) {}
~TestMediaRouterAction() override {}
@@ -58,7 +56,6 @@ class TestMediaRouterAction : public MediaRouterAction {
return platform_delegate_;
}
- scoped_ptr<WebContents> web_contents_;
MediaRouterDialogControllerImpl* controller_;
MediaRouterActionPlatformDelegate* platform_delegate_;
};
@@ -107,15 +104,15 @@ class MediaRouterActionUnitTest : public MediaRouterTest {
~MediaRouterActionUnitTest() override {}
- // BrowserWithTestWindowTest:
+ // MediaRouterTest:
void SetUp() override {
- BrowserWithTestWindowTest::SetUp();
+ MediaRouterTest::SetUp();
action_.reset(new TestMediaRouterAction(browser()));
}
void TearDown() override {
action_.reset();
- BrowserWithTestWindowTest::TearDown();
+ MediaRouterTest::TearDown();
}
TestMediaRouterAction* action() { return action_.get(); }
@@ -287,21 +284,18 @@ TEST_F(MediaRouterActionUnitTest, IconPressedState) {
EXPECT_CALL(*mock_delegate, GetCurrentWebContents()).WillOnce(
testing::Return(initiator_));
- EXPECT_CALL(*mock_delegate, OnPopupClosed()).WillOnce(testing::Return());
+ EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1);
action()->SetDelegate(mock_delegate.get());
- EXPECT_CALL(*mock_delegate, OnPopupShown(true)).WillOnce(testing::Return());
+ EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1);
action()->ExecuteAction(true);
- EXPECT_CALL(*mock_delegate, OnPopupClosed()).WillOnce(testing::Return());
- dialog_controller_->CloseMediaRouterDialog();
+ EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1);
+ dialog_controller_->HideMediaRouterDialog();
- EXPECT_CALL(*mock_delegate, OnPopupClosed()).WillOnce(testing::Return());
- dialog_controller_->Reset();
-
- EXPECT_CALL(*mock_delegate, OnPopupShown(true)).WillOnce(testing::Return());
+ EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1);
dialog_controller_->CreateMediaRouterDialog();
- EXPECT_CALL(*mock_delegate, OnPopupClosed()).WillOnce(testing::Return());
- dialog_controller_->CloseMediaRouterDialog();
+ EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1);
+ dialog_controller_->HideMediaRouterDialog();
}
« no previous file with comments | « no previous file | chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698