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

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

Issue 1138913006: bluetooth: Refactor LayoutTestBluetoothAdapterProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-testing-remove-mocking
Patch Set: Use lambdas for creating a discovery session. Created 5 years, 7 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
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 a4f44645e48763bc52c9b206aa2fcaf02a5ca806..ffeed8834f240994e940ae2cf2bf975d1d151e4c 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
@@ -9,6 +9,7 @@
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
+#include "device/bluetooth/test/mock_bluetooth_discovery_session.h"
namespace content {
@@ -35,17 +36,11 @@ class LayoutTestBluetoothAdapterProvider {
static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
GetSingleEmptyDeviceAdapter();
- // Calls |callback| with a DiscoverySession with the following
+ // Returns a fake DiscoverySession with the following
// characteristics:
- // - |Stop| will invoke |SuccessfulDiscoverySessionStop|.
- static void SuccessfulDiscoverySession(
- const device::BluetoothAdapter::DiscoverySessionCallback& callback,
- const device::BluetoothAdapter::ErrorCallback& error_callback);
-
- // Calls |callback|.
- static void SuccessfulDiscoverySessionStop(
- const base::Closure& callback,
- const base::Closure& error_callback);
+ // - |Stop(callback, error_callback)| will run callback.
+ static scoped_ptr<testing::NiceMock<device::MockBluetoothDiscoverySession>>
+ GetDiscoverySession();
// Returns an |EmptyDevice| with the following characeteristics:
// - |GetAddress| returns "Empty Mock Device instanceID".

Powered by Google App Engine
This is Rietveld 408576698