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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller_unittest.mm

Issue 2746313002: Remove RenderFrameHost pointer from ChooserController. (Closed)
Patch Set: Fix Android build and juncai@ comment. Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 CocoaProfileTest::SetUp(); 53 CocoaProfileTest::SetUp();
54 ASSERT_TRUE(browser()); 54 ASSERT_TRUE(browser());
55 } 55 }
56 56
57 // Create a ChooserDialogCocoa. 57 // Create a ChooserDialogCocoa.
58 void CreateChooserDialog() { 58 void CreateChooserDialog() {
59 content::WebContents* web_contents = 59 content::WebContents* web_contents =
60 content::WebContents::Create(content::WebContents::CreateParams( 60 content::WebContents::Create(content::WebContents::CreateParams(
61 profile(), content::SiteInstance::Create(profile()))); 61 profile(), content::SiteInstance::Create(profile())));
62 ASSERT_TRUE(web_contents); 62 ASSERT_TRUE(web_contents);
63 std::unique_ptr<MockChooserController> chooser_controller( 63 auto chooser_controller = base::MakeUnique<MockChooserController>();
64 new MockChooserController(web_contents->GetMainFrame()));
65 ASSERT_TRUE(chooser_controller);
66 mock_chooser_controller_ = chooser_controller.get(); 64 mock_chooser_controller_ = chooser_controller.get();
67 chooser_dialog_.reset( 65 chooser_dialog_.reset(
68 new ChooserDialogCocoa(web_contents, std::move(chooser_controller))); 66 new ChooserDialogCocoa(web_contents, std::move(chooser_controller)));
69 ASSERT_TRUE(chooser_dialog_); 67 ASSERT_TRUE(chooser_dialog_);
70 chooser_dialog_controller_ = 68 chooser_dialog_controller_ =
71 chooser_dialog_->chooser_dialog_cocoa_controller_.get(); 69 chooser_dialog_->chooser_dialog_cocoa_controller_.get();
72 ASSERT_TRUE(chooser_dialog_controller_); 70 ASSERT_TRUE(chooser_dialog_controller_);
73 device_chooser_content_view_ = 71 device_chooser_content_view_ =
74 [chooser_dialog_controller_ deviceChooserContentView]; 72 [chooser_dialog_controller_ deviceChooserContentView];
75 ASSERT_TRUE(device_chooser_content_view_); 73 ASSERT_TRUE(device_chooser_content_view_);
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 MockChooserController::ConnectedPairedStatus::NONE); 1220 MockChooserController::ConnectedPairedStatus::NONE);
1223 1221
1224 // Select option 0 and press "Get help" button. 1222 // Select option 0 and press "Get help" button.
1225 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] 1223 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0]
1226 byExtendingSelection:NO]; 1224 byExtendingSelection:NO];
1227 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); 1225 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0);
1228 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); 1226 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0);
1229 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); 1227 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1);
1230 [help_button_ performClick:chooser_dialog_controller_]; 1228 [help_button_ performClick:chooser_dialog_controller_];
1231 } 1229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698