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 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ | 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ |
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 9 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
10 #include "device/bluetooth/test/mock_bluetooth_device.h" | 10 #include "device/bluetooth/test/mock_bluetooth_device.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 // |EmptyAdapter| | 107 // |EmptyAdapter| |
108 // Inherits from |PoweredAdapter| | 108 // Inherits from |PoweredAdapter| |
109 // Devices Added: | 109 // Devices Added: |
110 // None. | 110 // None. |
111 // Mock Functions: | 111 // Mock Functions: |
112 // - StartDiscoverySessionWithFilter: | 112 // - StartDiscoverySessionWithFilter: |
113 // Run success callback with |DiscoverySession|. | 113 // Run success callback with |DiscoverySession|. |
114 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 114 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
115 GetEmptyAdapter(); | 115 GetEmptyAdapter(); |
116 | 116 |
117 // |PowerValueAdapter|(tx_power, rssi) | |
118 // Inherits from |EmptyAdapter| | |
119 // Internal Structure: | |
120 // - |HeartRateDevice| | |
121 // - Mock Functions: | |
122 // - GetInquiryTxPower(): Returns tx_power | |
123 // - GetInquiryRSSI(): Returns rssi | |
124 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | |
125 GetPowerValueAdapter(int tx_power, int rssi); | |
palmer
2015/11/04 21:57:19
Not int8 or int16?
ortuno
2015/11/04 22:45:58
Done.
| |
126 | |
127 // |PowerPresenceAdapter|(tx_power_present, rssi_present) | |
128 // Inherits from |EmptyAdapter| | |
129 // Internal Structure: | |
130 // - |HeartRateDevice| | |
131 // - Mock Functions: | |
132 // - GetInquiryTxPower(): If tx_power_present is true, returns -10, | |
133 // the TxPower of a device broadcasting at 0.1mW. Otherwise | |
134 // returns 127 which denotes a missing Tx Power. | |
135 // TODO(ortuno): Change 127 to -128 when Tx Power Unknown value gets | |
136 // fixed: http://crbug.com/551572 | |
137 // - GetInquiryRSSI(): If rssi_present is true returns -51, | |
138 // the RSSI at 1m from a device broadcasting at 0.1mW. Otherwise | |
139 // returns 127 which denotes a missing RSSI. | |
140 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | |
141 GetPowerPresenceAdapter(bool tx_power_present, bool rssi_present); | |
142 | |
117 // |GlucoseHeartRateAdapter| | 143 // |GlucoseHeartRateAdapter| |
118 // Inherits from |EmptyAdapter| | 144 // Inherits from |EmptyAdapter| |
119 // Devices added: | 145 // Devices added: |
120 // - |GlucoseDevice| | 146 // - |GlucoseDevice| |
121 // - |HeartRateDevice| | 147 // - |HeartRateDevice| |
122 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 148 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
123 GetGlucoseHeartRateAdapter(); | 149 GetGlucoseHeartRateAdapter(); |
124 | 150 |
125 // |SecondDiscoveryFindsHeartRateAdapter| | 151 // |SecondDiscoveryFindsHeartRateAdapter| |
126 // Inherits from |PoweredAdapter| | 152 // Inherits from |PoweredAdapter| |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 | 496 |
471 // Function to turn an integer into an MAC address of the form | 497 // Function to turn an integer into an MAC address of the form |
472 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 498 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
473 // returns "00:00:DE:AD:BE:EF". | 499 // returns "00:00:DE:AD:BE:EF". |
474 static std::string makeMACAddress(uint64_t addr); | 500 static std::string makeMACAddress(uint64_t addr); |
475 }; | 501 }; |
476 | 502 |
477 } // namespace content | 503 } // namespace content |
478 | 504 |
479 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ | 505 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ |
OLD | NEW |