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

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

Issue 2926503002: [CrOS Tether] Create proto_test_util.cc/h and move CreateTestDeviceStatus() there. (Closed)
Patch Set: Created 3 years, 6 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/proto_test_util.h
diff --git a/chromeos/components/tether/proto_test_util.h b/chromeos/components/tether/proto_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..efb6120422381ba44926114e543962dbf3fd6839
--- /dev/null
+++ b/chromeos/components/tether/proto_test_util.h
@@ -0,0 +1,34 @@
+// Copyright 2017 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_PROTO_TEST_UTIL_H_
+#define CHROMEOS_COMPONENTS_TETHER_PROTO_TEST_UTIL_H_
+
+#include "chromeos/components/tether/proto/tether.pb.h"
+
+namespace chromeos {
+
+namespace tether {
+
+namespace proto_test_util {
+
+// Pass these constants to CreateTestDeviceStatus() to create a proto object
+// which does not have the associated field set.
+const char kDoNotSetStringField[] = "doNotSetField";
+const int kDoNotSetIntField = -100;
+
+} // namespace proto_test_util
+
+// Creates a DeviceStatus object using the parameters provided. If
+// |kDoNotSetStringField| or |kDoNotSetIntField| are passed, these fields will
+// not be set in the output.
+DeviceStatus CreateTestDeviceStatus(const std::string& cell_provider_name,
+ int battery_percentage,
+ int connection_strength);
+
+} // namespace tether
+
+} // namespace chromeos
+
+#endif // CHROMEOS_COMPONENTS_TETHER_PROTO_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698