| 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 content::BluetoothChooser::AdapterPresence::POWERED_OFF); | 922 content::BluetoothChooser::AdapterPresence::POWERED_OFF); |
| 923 EXPECT_FALSE(table_view_.hidden); | 923 EXPECT_FALSE(table_view_.hidden); |
| 924 // Since "Bluetooth turned off." needs to be displayed on the |table_view_|, | 924 // Since "Bluetooth turned off." needs to be displayed on the |table_view_|, |
| 925 // the number of rows is 1. | 925 // the number of rows is 1. |
| 926 EXPECT_EQ(1, table_view_.numberOfRows); | 926 EXPECT_EQ(1, table_view_.numberOfRows); |
| 927 // |table_view_| should be disabled since there is no option shown. | 927 // |table_view_| should be disabled since there is no option shown. |
| 928 EXPECT_FALSE(table_view_.enabled); | 928 EXPECT_FALSE(table_view_.enabled); |
| 929 // No option selected. | 929 // No option selected. |
| 930 EXPECT_EQ(-1, table_view_.selectedRow); | 930 EXPECT_EQ(-1, table_view_.selectedRow); |
| 931 ExpectNoRowImage(0); | 931 ExpectNoRowImage(0); |
| 932 ExpectRowTextIs( | 932 // TODO(juncai): test the row text is "Turn on Bluetooth to allow pairing" |
| 933 0, l10n_util::GetNSString(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF)); | 933 // after the Mac implementation is done. |
| 934 // https://crbug.com/644168 |
| 934 EXPECT_FALSE(IsRowPaired(0)); | 935 EXPECT_FALSE(IsRowPaired(0)); |
| 935 EXPECT_TRUE(spinner_.hidden); | 936 EXPECT_TRUE(spinner_.hidden); |
| 936 EXPECT_TRUE(status_.hidden); | 937 EXPECT_TRUE(status_.hidden); |
| 937 EXPECT_TRUE(rescan_button_.hidden); | 938 EXPECT_TRUE(rescan_button_.hidden); |
| 938 // Since the adapter is turned off, the previously selected option | 939 // Since the adapter is turned off, the previously selected option |
| 939 // becomes invalid, the OK button is disabled. | 940 // becomes invalid, the OK button is disabled. |
| 940 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions()); | 941 EXPECT_EQ(0u, mock_chooser_controller_->NumOptions()); |
| 941 EXPECT_FALSE(connect_button_.enabled); | 942 EXPECT_FALSE(connect_button_.enabled); |
| 942 EXPECT_TRUE(cancel_button_.enabled); | 943 EXPECT_TRUE(cancel_button_.enabled); |
| 943 | 944 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 MockChooserController::ConnectedPairedStatus::NONE); | 1097 MockChooserController::ConnectedPairedStatus::NONE); |
| 1097 | 1098 |
| 1098 // Select option 0 and press "Get help" button. | 1099 // Select option 0 and press "Get help" button. |
| 1099 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] | 1100 [table_view_ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] |
| 1100 byExtendingSelection:NO]; | 1101 byExtendingSelection:NO]; |
| 1101 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); | 1102 EXPECT_CALL(*mock_chooser_controller_, Select(testing::_)).Times(0); |
| 1102 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); | 1103 EXPECT_CALL(*mock_chooser_controller_, Cancel()).Times(0); |
| 1103 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); | 1104 EXPECT_CALL(*mock_chooser_controller_, OpenHelpCenterUrl()).Times(1); |
| 1104 [help_button_ performClick:chooser_dialog_controller_]; | 1105 [help_button_ performClick:chooser_dialog_controller_]; |
| 1105 } | 1106 } |
| OLD | NEW |