| OLD | NEW |
| 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 /** @fileoverview Suite of tests for settings-bluetooth-page. */ | 5 /** @fileoverview Suite of tests for settings-bluetooth-page. */ |
| 6 | 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 | 8 |
| 9 var bluetoothPage = bluetoothPage || {}; | 9 var bluetoothPage = bluetoothPage || {}; |
| 10 | 10 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 MockInteractions.tap(devices[0].$$('div')); | 174 MockInteractions.tap(devices[0].$$('div')); |
| 175 Polymer.dom.flush(); | 175 Polymer.dom.flush(); |
| 176 // Ensure the pairing dialog is shown. | 176 // Ensure the pairing dialog is shown. |
| 177 assertTrue(!!dialog.$$('#pairing')); | 177 assertTrue(!!dialog.$$('#pairing')); |
| 178 // Ensure the device is connected to. | 178 // Ensure the device is connected to. |
| 179 expectEquals(1, self.bluetoothPrivateApi_.connectedDevices_.size); | 179 expectEquals(1, self.bluetoothPrivateApi_.connectedDevices_.size); |
| 180 var deviceAddress = | 180 var deviceAddress = |
| 181 self.bluetoothPrivateApi_.connectedDevices_.keys().next().value; | 181 self.bluetoothPrivateApi_.connectedDevices_.keys().next().value; |
| 182 | 182 |
| 183 // Close the dialog. | 183 // Close the dialog. |
| 184 var close = dialog.$$('#closePair'); | 184 var close = dialog.$.dialog.getCloseButton(); |
| 185 assertTrue(!!close); | 185 assertTrue(!!close); |
| 186 MockInteractions.tap(close); | 186 MockInteractions.tap(close); |
| 187 Polymer.dom.flush(); | 187 Polymer.dom.flush(); |
| 188 expectFalse(dialog.$.dialog.opened); | 188 expectFalse(dialog.$.dialog.opened); |
| 189 var response = self.bluetoothPrivateApi_.pairingResponses_[deviceAddress]; | 189 var response = self.bluetoothPrivateApi_.pairingResponses_[deviceAddress]; |
| 190 assertTrue(!!response); | 190 assertTrue(!!response); |
| 191 expectEquals(chrome.bluetoothPrivate.PairingResponse.CANCEL, | 191 expectEquals(chrome.bluetoothPrivate.PairingResponse.CANCEL, |
| 192 response.response); | 192 response.response); |
| 193 }); | 193 }); |
| 194 }); | 194 }); |
| 195 | 195 |
| 196 // Run all registered tests. | 196 // Run all registered tests. |
| 197 mocha.run(); | 197 mocha.run(); |
| 198 }); | 198 }); |
| OLD | NEW |