Commit 8858c088 authored by vitaliii's avatar vitaliii Committed by Commit Bot

[Arc] Add a test for ToS hash calculation.


Bug: 781765,856583
Change-Id: Ia7feaf1119cc1f2f402646e66c832f656ca55e35
Reviewed-on: https://chromium-review.googlesource.com/1114612Reviewed-by: default avatarElijah Taylor <elijahtaylor@chromium.org>
Commit-Queue: vitaliii <vitaliii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571859}
parent 4fd0b876
...@@ -270,4 +270,19 @@ TEST_F(ArcSupportHostTest, SendFeedbackOnError) { ...@@ -270,4 +270,19 @@ TEST_F(ArcSupportHostTest, SendFeedbackOnError) {
fake_arc_support()->ClickSendFeedbackButton(); fake_arc_support()->ClickSendFeedbackButton();
} }
TEST_F(ArcSupportHostTest, CalculateToSHashInRightOrder) {
std::vector<int> output = ArcSupportHost::ComputePlayToSConsentIds(
"The quick brown fox jumps over the lazy dog");
// Expect length and 5 ints for the hash.
EXPECT_EQ(6, static_cast<int>(output.size()));
// Check string length.
EXPECT_EQ(43, output[0]);
// Verify the hash: 2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12.
EXPECT_EQ(static_cast<int>(0x2fd4e1c6), output[1]);
EXPECT_EQ(static_cast<int>(0x7a2d28fc), output[2]);
EXPECT_EQ(static_cast<int>(0xed849ee1), output[3]);
EXPECT_EQ(static_cast<int>(0xbb76e739), output[4]);
EXPECT_EQ(static_cast<int>(0x1b93eb12), output[5]);
}
} // namespace } // namespace
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment