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

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

Issue 2344133003: Add help link when Bluetooth adapter is off for WebBluetooth chooser (Closed)
Patch Set: address more comments Created 4 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 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 content::BluetoothChooser::AdapterPresence::POWERED_OFF); 735 content::BluetoothChooser::AdapterPresence::POWERED_OFF);
736 EXPECT_FALSE(table_view_.hidden); 736 EXPECT_FALSE(table_view_.hidden);
737 // Since "Bluetooth turned off." needs to be displayed on the |table_view_|, 737 // Since "Bluetooth turned off." needs to be displayed on the |table_view_|,
738 // the number of rows is 1. 738 // the number of rows is 1.
739 EXPECT_EQ(1, table_view_.numberOfRows); 739 EXPECT_EQ(1, table_view_.numberOfRows);
740 // |table_view_| should be disabled since there is no option shown. 740 // |table_view_| should be disabled since there is no option shown.
741 EXPECT_FALSE(table_view_.enabled); 741 EXPECT_FALSE(table_view_.enabled);
742 // No option selected. 742 // No option selected.
743 EXPECT_EQ(-1, table_view_.selectedRow); 743 EXPECT_EQ(-1, table_view_.selectedRow);
744 ExpectNoRowImage(0); 744 ExpectNoRowImage(0);
745 ExpectRowTextIs( 745 // TODO(juncai): test the row text is "Turn on Bluetooth to allow pairing"
746 0, l10n_util::GetNSString(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF)); 746 // after the Mac implementation is done.
747 // https://crbug.com/644168
747 EXPECT_FALSE(IsRowPaired(0)); 748 EXPECT_FALSE(IsRowPaired(0));
748 EXPECT_TRUE(spinner_.hidden); 749 EXPECT_TRUE(spinner_.hidden);
749 EXPECT_TRUE(status_.hidden); 750 EXPECT_TRUE(status_.hidden);
750 EXPECT_TRUE(rescan_button_.hidden); 751 EXPECT_TRUE(rescan_button_.hidden);
751 // Since the adapter is turned off, the previously selected option 752 // Since the adapter is turned off, the previously selected option
752 // becomes invalid, the OK button is disabled. 753 // becomes invalid, the OK button is disabled.
753 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions()); 754 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions());
754 EXPECT_FALSE(connect_button_.enabled); 755 EXPECT_FALSE(connect_button_.enabled);
755 EXPECT_TRUE(cancel_button_.enabled); 756 EXPECT_TRUE(cancel_button_.enabled);
756 757
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 MockChooserController::ConnectedPairedStatus::NONE); 909 MockChooserController::ConnectedPairedStatus::NONE);
909 910
910 // Select option 0 and press "Get help" button. 911 // Select option 0 and press "Get help" button.
911 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] 912 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0]
912 byExtendingSelection:NO]; 913 byExtendingSelection:NO];
913 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); 914 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0);
914 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); 915 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0);
915 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); 916 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1);
916 [help_button_ performClick:chooser_dialog_controller_]; 917 [help_button_ performClick:chooser_dialog_controller_];
917 } 918 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc ('k') | chrome/browser/ui/views/chooser_content_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698