buffet: Send modelManifestId with device registration
modelManifestId is ID of manifest with useful information
that can be used by device clients.
modelManifestId is the same value as modelId from /privet/info.
CQ-DEPEND=CL:251381
BUG=brillo:295
TEST=unittests
Change-Id: Ic847c30badd9aa8b97f3deb7939813cc95195f02
Reviewed-on: https://chromium-review.googlesource.com/251141
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/device_registration_info_unittest.cc b/buffet/device_registration_info_unittest.cc
index 2b274e0..ee49b0a 100644
--- a/buffet/device_registration_info_unittest.cc
+++ b/buffet/device_registration_info_unittest.cc
@@ -72,6 +72,7 @@
data->SetString(storage_keys::kDisplayName, "");
data->SetString(storage_keys::kDescription, "");
data->SetString(storage_keys::kLocation, "");
+ data->SetString(storage_keys::kModelId, "");
}
// Add the test device registration information.
@@ -185,6 +186,7 @@
config_store->SetString("display_name", "Coffee Pot");
config_store->SetString("description", "Easy to clean");
config_store->SetString("location", "Kitchen");
+ config_store->SetString("model_id", "AAA");
config_store->SetString("oauth_url", test_data::kOAuthURL);
config_store->SetString("service_url", test_data::kServiceURL);
dev_reg_ = std::unique_ptr<DeviceRegistrationInfo>(
@@ -236,6 +238,7 @@
data.SetString(storage_keys::kDisplayName, "k");
data.SetString(storage_keys::kDescription, "l");
data.SetString(storage_keys::kLocation, "m");
+ data.SetString(storage_keys::kModelId, "n");
storage_->Save(&data);
@@ -342,6 +345,8 @@
EXPECT_EQ("Easy to clean", value);
EXPECT_TRUE(json->GetString("deviceDraft.location", &value));
EXPECT_EQ("Kitchen", value);
+ EXPECT_TRUE(json->GetString("deviceDraft.modelManifestId", &value));
+ EXPECT_EQ("AAA", value);
EXPECT_TRUE(json->GetString("deviceDraft.displayName", &value));
EXPECT_EQ("Coffee Pot", value);
base::DictionaryValue* commandDefs = nullptr;