OLD | NEW |
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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 // Select option 1. | 922 // Select option 1. |
923 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:1] | 923 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:1] |
924 byExtendingSelection:NO]; | 924 byExtendingSelection:NO]; |
925 EXPECT_EQ(1, table_view_.selectedRow); | 925 EXPECT_EQ(1, table_view_.selectedRow); |
926 EXPECT_TRUE(connect_button_.enabled); | 926 EXPECT_TRUE(connect_button_.enabled); |
927 EXPECT_TRUE(cancel_button_.enabled); | 927 EXPECT_TRUE(cancel_button_.enabled); |
928 | 928 |
929 mock_chooser_controller_->OnAdapterPresenceChanged( | 929 mock_chooser_controller_->OnAdapterPresenceChanged( |
930 content::BluetoothChooser::AdapterPresence::POWERED_OFF); | 930 content::BluetoothChooser::AdapterPresence::POWERED_OFF); |
931 EXPECT_FALSE(adapter_off_help_button_.hidden); | 931 EXPECT_FALSE(adapter_off_help_button_.hidden); |
932 EXPECT_NSEQ( | 932 EXPECT_NSEQ(l10n_util::GetNSString( |
933 l10n_util::GetNSString(IDS_BLUETOOTH_DEVICE_CHOOSER_TURN_ADAPTER_OFF), | 933 IDS_BLUETOOTH_DEVICE_CHOOSER_TURN_ON_BLUETOOTH_LINK_TEXT), |
934 adapter_off_help_button_.title); | 934 adapter_off_help_button_.title); |
935 EXPECT_TRUE(table_view_.hidden); | 935 EXPECT_TRUE(table_view_.hidden); |
936 EXPECT_TRUE(spinner_.hidden); | 936 EXPECT_TRUE(spinner_.hidden); |
937 EXPECT_TRUE(status_.hidden); | 937 EXPECT_TRUE(status_.hidden); |
938 EXPECT_TRUE(rescan_button_.hidden); | 938 EXPECT_TRUE(rescan_button_.hidden); |
939 // Since the adapter is turned off, the previously selected option | 939 // Since the adapter is turned off, the previously selected option |
940 // becomes invalid, the OK button is disabled. | 940 // becomes invalid, the OK button is disabled. |
941 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions()); | 941 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions()); |
942 EXPECT_FALSE(connect_button_.enabled); | 942 EXPECT_FALSE(connect_button_.enabled); |
943 EXPECT_TRUE(cancel_button_.enabled); | 943 EXPECT_TRUE(cancel_button_.enabled); |
944 | 944 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 MockChooserController::ConnectedPairedStatus::NONE); | 1110 MockChooserController::ConnectedPairedStatus::NONE); |
1111 | 1111 |
1112 // Select option 0 and press "Get help" button. | 1112 // Select option 0 and press "Get help" button. |
1113 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] | 1113 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] |
1114 byExtendingSelection:NO]; | 1114 byExtendingSelection:NO]; |
1115 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); | 1115 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); |
1116 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); | 1116 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); |
1117 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); | 1117 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); |
1118 [help_button_ performClick:chooser_dialog_controller_]; | 1118 [help_button_ performClick:chooser_dialog_controller_]; |
1119 } | 1119 } |
OLD | NEW |