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

Unified Diff: chromeos/components/tether/connect_tethering_operation_unittest.cc

Issue 2926503002: [CrOS Tether] Create proto_test_util.cc/h and move CreateTestDeviceStatus() there. (Closed)
Patch Set: Included missing dep. 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
« no previous file with comments | « chromeos/components/tether/BUILD.gn ('k') | chromeos/components/tether/device_status_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/components/tether/connect_tethering_operation_unittest.cc
diff --git a/chromeos/components/tether/connect_tethering_operation_unittest.cc b/chromeos/components/tether/connect_tethering_operation_unittest.cc
index cb736b23c36f2740be246a5c57d25f7d95ca33f9..404a4da7ec03264127168bfb49d60f17030911e8 100644
--- a/chromeos/components/tether/connect_tethering_operation_unittest.cc
+++ b/chromeos/components/tether/connect_tethering_operation_unittest.cc
@@ -13,6 +13,7 @@
#include "chromeos/components/tether/message_wrapper.h"
#include "chromeos/components/tether/mock_tether_host_response_recorder.h"
#include "chromeos/components/tether/proto/tether.pb.h"
+#include "chromeos/components/tether/proto_test_util.h"
#include "components/cryptauth/remote_device_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -63,20 +64,6 @@ std::string CreateConnectTetheringRequestString() {
return MessageWrapper(request).ToRawMessage();
}
-DeviceStatus CreateFakeDeviceStatus() {
- WifiStatus wifi_status;
- wifi_status.set_status_code(
- WifiStatus_StatusCode::WifiStatus_StatusCode_NOT_CONNECTED);
-
- DeviceStatus device_status;
- device_status.set_battery_percentage(75);
- device_status.set_cell_provider("Google Fi");
- device_status.set_connection_strength(4);
- device_status.mutable_wifi_status()->CopyFrom(wifi_status);
-
- return device_status;
-}
-
std::string CreateConnectTetheringResponseString(
ConnectTetheringResponse_ResponseCode response_code,
bool use_proto_without_ssid_and_password) {
@@ -91,7 +78,8 @@ std::string CreateConnectTetheringResponseString(
response.set_password(std::string(kTestPassword));
}
- response.mutable_device_status()->CopyFrom(CreateFakeDeviceStatus());
+ response.mutable_device_status()->CopyFrom(
+ CreateDeviceStatusWithFakeFields());
return MessageWrapper(response).ToRawMessage();
}
« no previous file with comments | « chromeos/components/tether/BUILD.gn ('k') | chromeos/components/tether/device_status_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698