| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 2 |
| 3 // Bluetooth UUID constants: | 3 // Bluetooth UUID constants: |
| 4 // Services: | 4 // Services: |
| 5 var blacklist_test_service_uuid = "611c954a-263b-4f4a-aab6-01ddb953f985"; | 5 var blacklist_test_service_uuid = "611c954a-263b-4f4a-aab6-01ddb953f985"; |
| 6 // Characteristics: | 6 // Characteristics: |
| 7 var blacklist_exclude_reads_characteristic_uuid = | 7 var blacklist_exclude_reads_characteristic_uuid = |
| 8 "bad1c9a2-9a5b-4015-8b60-1579bbbf2135"; | 8 "bad1c9a2-9a5b-4015-8b60-1579bbbf2135"; |
| 9 | 9 |
| 10 // Sometimes we need to test that using either the name, alias, or UUID | 10 // Sometimes we need to test that using either the name, alias, or UUID |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (events.length >= expected_count) { | 143 if (events.length >= expected_count) { |
| 144 resolve(events); | 144 resolve(events); |
| 145 } else { | 145 } else { |
| 146 testRunner.getBluetoothManualChooserEvents(accumulate_events); | 146 testRunner.getBluetoothManualChooserEvents(accumulate_events); |
| 147 } | 147 } |
| 148 }; | 148 }; |
| 149 testRunner.getBluetoothManualChooserEvents(accumulate_events); | 149 testRunner.getBluetoothManualChooserEvents(accumulate_events); |
| 150 }); | 150 }); |
| 151 } | 151 } |
| 152 | 152 |
| 153 function setBluetoothFakeAdapter(adapter_name) { |
| 154 return new Promise(resolve => { |
| 155 testRunner.setBluetoothFakeAdapter(adapter_name, resolve); |
| 156 }); |
| 157 } |
| 158 |
| 153 // errorUUID(alias) returns a UUID with the top 32 bits of | 159 // errorUUID(alias) returns a UUID with the top 32 bits of |
| 154 // '00000000-97e5-4cd7-b9f1-f5a427670c59' replaced with the bits of |alias|. | 160 // '00000000-97e5-4cd7-b9f1-f5a427670c59' replaced with the bits of |alias|. |
| 155 // For example, errorUUID(0xDEADBEEF) returns | 161 // For example, errorUUID(0xDEADBEEF) returns |
| 156 // 'deadbeef-97e5-4cd7-b9f1-f5a427670c59'. The bottom 96 bits of error UUIDs | 162 // 'deadbeef-97e5-4cd7-b9f1-f5a427670c59'. The bottom 96 bits of error UUIDs |
| 157 // were generated as a type 4 (random) UUID. | 163 // were generated as a type 4 (random) UUID. |
| 158 function errorUUID(uuidAlias) { | 164 function errorUUID(uuidAlias) { |
| 159 // Make the number positive. | 165 // Make the number positive. |
| 160 uuidAlias >>>= 0; | 166 uuidAlias >>>= 0; |
| 161 // Append the alias as a hex number. | 167 // Append the alias as a hex number. |
| 162 var strAlias = '0000000' + uuidAlias.toString(16); | 168 var strAlias = '0000000' + uuidAlias.toString(16); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // interact with the device. So before we clean up the browser data | 319 // interact with the device. So before we clean up the browser data |
| 314 // we change the visibility which results in all devices disconnecing. | 320 // we change the visibility which results in all devices disconnecing. |
| 315 // TODO(ortuno): Remove setPageVisibility hack. In the future, the browser | 321 // TODO(ortuno): Remove setPageVisibility hack. In the future, the browser |
| 316 // will notify the renderer that the device disconnected so we won't need | 322 // will notify the renderer that the device disconnected so we won't need |
| 317 // this hack. | 323 // this hack. |
| 318 // https://crbug.com/581855 | 324 // https://crbug.com/581855 |
| 319 testRunner.setPageVisibility('hidden'); | 325 testRunner.setPageVisibility('hidden'); |
| 320 testRunner.setPageVisibility('visible'); | 326 testRunner.setPageVisibility('visible'); |
| 321 testRunner.setBluetoothMockDataSet(''); | 327 testRunner.setBluetoothMockDataSet(''); |
| 322 }); | 328 }); |
| OLD | NEW |