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

Side by Side Diff: components/bubble/bubble_manager_mocks.cc

Issue 1572743002: Make sure bubbles in Views default to close before their RenderFrameHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Move DCHECK string into longer comment Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/bubble/bubble_manager_mocks.h ('k') | components/bubble/bubble_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/bubble/bubble_manager_mocks.h" 5 #include "components/bubble/bubble_manager_mocks.h"
6 6
7 MockBubbleUi::MockBubbleUi() {} 7 MockBubbleUi::MockBubbleUi() {}
8 8
9 MockBubbleUi::~MockBubbleUi() { Destroyed(); } 9 MockBubbleUi::~MockBubbleUi() { Destroyed(); }
10 10
11 MockBubbleDelegate::MockBubbleDelegate() : bubble_ui_(new MockBubbleUi) {} 11 MockBubbleDelegate::MockBubbleDelegate() : bubble_ui_(new MockBubbleUi) {}
12 12
13 MockBubbleDelegate::~MockBubbleDelegate() { Destroyed(); } 13 MockBubbleDelegate::~MockBubbleDelegate() { Destroyed(); }
14 14
15 // static 15 // static
16 scoped_ptr<MockBubbleDelegate> MockBubbleDelegate::Default() { 16 scoped_ptr<MockBubbleDelegate> MockBubbleDelegate::Default() {
17 MockBubbleDelegate* delegate = new MockBubbleDelegate; 17 MockBubbleDelegate* delegate = new MockBubbleDelegate;
18 EXPECT_CALL(*delegate, ShouldClose(testing::_)) 18 EXPECT_CALL(*delegate, ShouldClose(testing::_))
19 .WillOnce(testing::Return(true)); 19 .Times(testing::AtMost(1))
20 .WillRepeatedly(testing::Return(true));
20 EXPECT_CALL(*delegate, DidClose()); 21 EXPECT_CALL(*delegate, DidClose());
21 EXPECT_CALL(*delegate, Destroyed()); 22 EXPECT_CALL(*delegate, Destroyed());
22 return make_scoped_ptr(delegate); 23 return make_scoped_ptr(delegate);
23 } 24 }
24 25
25 // static 26 // static
26 scoped_ptr<MockBubbleDelegate> MockBubbleDelegate::Stubborn() { 27 scoped_ptr<MockBubbleDelegate> MockBubbleDelegate::Stubborn() {
27 MockBubbleDelegate* delegate = new MockBubbleDelegate; 28 MockBubbleDelegate* delegate = new MockBubbleDelegate;
28 EXPECT_CALL(*delegate, ShouldClose(testing::_)) 29 EXPECT_CALL(*delegate, ShouldClose(testing::_))
29 .WillRepeatedly(testing::Return(false)); 30 .WillRepeatedly(testing::Return(false));
30 EXPECT_CALL(*delegate, DidClose()); 31 EXPECT_CALL(*delegate, DidClose());
31 EXPECT_CALL(*delegate, Destroyed()); 32 EXPECT_CALL(*delegate, Destroyed());
32 return make_scoped_ptr(delegate); 33 return make_scoped_ptr(delegate);
33 } 34 }
OLDNEW
« no previous file with comments | « components/bubble/bubble_manager_mocks.h ('k') | components/bubble/bubble_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698