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

Unified Diff: chromeos/components/tether/mock_local_device_data_provider.h

Issue 2604063003: [CrOS Tether] Create BleScanner, a class which scan BLE advertisements and identifies nearby device… (Closed)
Patch Set: Add missing dependency. Created 3 years, 11 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: chromeos/components/tether/mock_local_device_data_provider.h
diff --git a/chromeos/components/tether/mock_local_device_data_provider.h b/chromeos/components/tether/mock_local_device_data_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..40fa92448c269ae2c6f574cab358e9c2a229cbd6
--- /dev/null
+++ b/chromeos/components/tether/mock_local_device_data_provider.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_COMPONENTS_TETHER_MOCK_LOCAL_DEVICE_DATA_PROVIDER_H
+#define CHROMEOS_COMPONENTS_TETHER_MOCK_LOCAL_DEVICE_DATA_PROVIDER_H
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+#include "chromeos/components/tether/local_device_data_provider.h"
+
+namespace cryptauth {
+class BeaconSeed;
+}
+
+namespace chromeos {
+
+namespace tether {
+
+// Test double for LocalDeviceDataProvider.
+class MockLocalDeviceDataProvider : public LocalDeviceDataProvider {
+ public:
+ MockLocalDeviceDataProvider();
+ ~MockLocalDeviceDataProvider() override;
+
+ void SetPublicKey(std::unique_ptr<std::string> public_key);
+ void SetBeaconSeeds(
+ std::unique_ptr<std::vector<cryptauth::BeaconSeed>> beacon_seeds);
+
+ // LocalDeviceDataProvider:
+ bool GetLocalDeviceData(
+ std::string* public_key_out,
+ std::vector<cryptauth::BeaconSeed>* beacon_seeds_out) const override;
+
+ private:
+ std::unique_ptr<std::string> public_key_;
+ std::unique_ptr<std::vector<cryptauth::BeaconSeed>> beacon_seeds_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockLocalDeviceDataProvider);
+};
+
+} // namespace tether
+
+} // namespace chromeos
+
+#endif // CHROMEOS_COMPONENTS_TETHER_MOCK_LOCAL_DEVICE_DATA_PROVIDER_H
« no previous file with comments | « chromeos/components/tether/local_device_data_provider.h ('k') | chromeos/components/tether/mock_local_device_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698