12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file. 42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)package org.chromium.chrome.browser.util; 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)import android.test.InstrumentationTestCase; 82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)import android.test.suitebuilder.annotation.SmallTest; 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)import org.chromium.base.test.util.Feature; 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)public class HashUtilTest extends InstrumentationTestCase { 132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) @SmallTest 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) @Feature({"Sync", "Omaha"}) 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public void testMd5HashGivesCorrectString() { 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) assertEquals("8e8cd7e8797678284984aa304e779ba5", 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) HashUtil.getMd5Hash(new HashUtil.Params("Chrome for Android"))); 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // WARNING: The expected value for this must NEVER EVER change. Ever. 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // See http://crbug.com/179565. 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) assertEquals("6aa987da27016dade54b24ff5b846111", 222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) HashUtil.getMd5Hash(new HashUtil.Params("Chrome for Android").withSalt("mySalt"))); 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 25