Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h

Issue 1236073003: bluetooth: Tests refactoring: BaseAdapter, FailStartDiscoveryAdapter... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Address jyasskin's comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
index 40aa323c1febe8276201c6137979551c62dbc12c..fe77cd4363d176d06c3ac24a1b1c0e560f9000dc 100644
--- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
+++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
@@ -17,6 +17,11 @@ namespace content {
// Implements fake adapters with named mock data set for use in tests as a
// result of layout tests calling testRunner.setBluetoothMockDataSet.
+
+// We have a complete “GenericAccessAdapter”, meaning it has a device which has
+// a Generic Access service with a Device Name characteristic with a descriptor.
+// The other adapters are named based on their particular non-expected behavior.
+
class LayoutTestBluetoothAdapterProvider {
public:
// Returns a BluetoothAdapter. Its behavior depends on |fake_adapter_name|.
@@ -24,15 +29,51 @@ class LayoutTestBluetoothAdapterProvider {
const std::string& fake_adapter_name);
private:
- // Returns "EmptyAdapter" fake BluetoothAdapter with the following
- // characteristics:
- // - |StartDiscoverySessionWithFilter| runs the success callback with
- // |DiscoverySession|
- // as argument.
- // - |GetDevices| returns an empty list of devices.
+ // Adapters
+
+ // |BaseAdapter|
+ // Devices Added:
+ // None.
+ // Mock Functions:
+ // - GetDevices:
+ // Returns a list of devices added to the adapter.
+ // - GetDevice:
+ // Returns a device matching the address provided if the device was
+ // added to the adapter.
+ static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
+ GetBaseAdapter();
+
+ // |FailStartDiscoveryAdapter|
+ // Inherits from |BaseAdapter|
+ // Devices added:
+ // None.
+ // Mock Functions:
+ // - StartDiscoverySessionWithFilter:
+ // Run error callback.
+ static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
+ GetFailStartDiscoveryAdapter();
+
+ // |EmptyAdapter|
+ // Inherits from |BaseAdapter|
+ // Devices added:
+ // None.
+ // Mock Functions:
+ // - StartDiscoverySessionWithFilter:
+ // Run success callback with |DiscoverySession|.
static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
GetEmptyAdapter();
+ // Discovery Sessions
+
+ // |DiscoverySession|
+ // Mock Functions:
+ // - Stop:
+ // Run success callback.
+ static scoped_ptr<testing::NiceMock<device::MockBluetoothDiscoverySession>>
+ GetDiscoverySession();
+
+ // The functions after this haven't been updated to the new design yet.
+
// Returns a fake BluetoothAdapter that asserts that its
// StartDiscoverySessionWithFilter() method is called with a filter consisting
// of the standard battery, heart rate, and glucose services.
@@ -83,11 +124,6 @@ class LayoutTestBluetoothAdapterProvider {
static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
GetUnconnectableDeviceAdapter();
- // Returns a fake |DiscoverySession| with the following characteristics:
- // - |Stop| runs the success callback.
- static scoped_ptr<testing::NiceMock<device::MockBluetoothDiscoverySession>>
- GetDiscoverySession();
-
// Returns an |EmptyDevice| with the following characeteristics:
// - |GetAddress| returns "Empty Mock Device instanceID".
// - |GetName| returns "Empty Mock Device name".
« no previous file with comments | « no previous file | content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698