| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 suite('Bluetooth', function() { | 5 suite('Bluetooth', function() { |
| 6 var bluetoothPage = null; | 6 var bluetoothPage = null; |
| 7 | 7 |
| 8 /** @type {Bluetooth} */ | 8 /** @type {Bluetooth} */ |
| 9 var bluetoothApi_; | 9 var bluetoothApi_; |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 paired: false, | 31 paired: false, |
| 32 }, | 32 }, |
| 33 { | 33 { |
| 34 address: '00:00:00:00:00:02', | 34 address: '00:00:00:00:00:02', |
| 35 name: 'FakeUnPairedDevice2', | 35 name: 'FakeUnPairedDevice2', |
| 36 paired: false, | 36 paired: false, |
| 37 }, | 37 }, |
| 38 ]; | 38 ]; |
| 39 | 39 |
| 40 suiteSetup(function() { | 40 suiteSetup(function() { |
| 41 window.loadTimeData = new LoadTimeData; | 41 loadTimeData.overrideValues({ |
| 42 loadTimeData.data = { | |
| 43 bluetoothEnabled: 'bluetoothEnabled', | 42 bluetoothEnabled: 'bluetoothEnabled', |
| 44 bluetoothDisabled: 'bluetoothDisabled', | 43 bluetoothDisabled: 'bluetoothDisabled', |
| 45 bluetoothOn: 'bluetoothOn', | 44 bluetoothOn: 'bluetoothOn', |
| 46 bluetoothOff: 'bluetoothOff', | 45 bluetoothOff: 'bluetoothOff', |
| 47 bluetoothConnected: 'bluetoothConnected', | 46 bluetoothConnected: 'bluetoothConnected', |
| 48 bluetoothDisconnect: 'bluetoothDisconnect', | 47 bluetoothDisconnect: 'bluetoothDisconnect', |
| 49 bluetoothPair: 'bluetoothPair', | 48 bluetoothPair: 'bluetoothPair', |
| 50 bluetoothStartConnecting: 'bluetoothStartConnecting', | 49 bluetoothStartConnecting: 'bluetoothStartConnecting', |
| 51 | 50 }); |
| 52 }; | |
| 53 | 51 |
| 54 bluetoothApi_ = new settings.FakeBluetooth(); | 52 bluetoothApi_ = new settings.FakeBluetooth(); |
| 55 bluetoothPrivateApi_ = new settings.FakeBluetoothPrivate(bluetoothApi_); | 53 bluetoothPrivateApi_ = new settings.FakeBluetoothPrivate(bluetoothApi_); |
| 56 | 54 |
| 57 // Set globals to override Settings Bluetooth Page apis. | 55 // Set globals to override Settings Bluetooth Page apis. |
| 58 bluetoothApis.bluetoothApiForTest = bluetoothApi_; | 56 bluetoothApis.bluetoothApiForTest = bluetoothApi_; |
| 59 bluetoothApis.bluetoothPrivateApiForTest = bluetoothPrivateApi_; | 57 bluetoothApis.bluetoothPrivateApiForTest = bluetoothPrivateApi_; |
| 60 | 58 |
| 61 // Disable animations so sub-pages open within one event loop. | 59 // Disable animations so sub-pages open within one event loop. |
| 62 testing.Test.disableAnimationsAndTransitions(); | 60 testing.Test.disableAnimationsAndTransitions(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Ensure the device wass connected to. | 159 // Ensure the device wass connected to. |
| 162 expectEquals(1, bluetoothPrivateApi_.connectedDevices_.size); | 160 expectEquals(1, bluetoothPrivateApi_.connectedDevices_.size); |
| 163 | 161 |
| 164 // Close the dialog. | 162 // Close the dialog. |
| 165 dialog.close(); | 163 dialog.close(); |
| 166 Polymer.dom.flush(); | 164 Polymer.dom.flush(); |
| 167 assertFalse(dialog.$.dialog.open); | 165 assertFalse(dialog.$.dialog.open); |
| 168 }); | 166 }); |
| 169 }); | 167 }); |
| 170 }); | 168 }); |
| OLD | NEW |