Commit 87eb5dd0 authored by pkotwicz's avatar pkotwicz Committed by Commit bot

Make WebAPK server use Murmur2 Hash version compatible with WebAPK server

BUG=662495

Review-Url: https://codereview.chromium.org/2477173002
Cr-Commit-Position: refs/heads/master@{#430195}
parent 5af2b4f8
...@@ -35,7 +35,7 @@ public class ManifestUpgradeDetectorFetcherTest extends ChromeTabbedActivityTest ...@@ -35,7 +35,7 @@ public class ManifestUpgradeDetectorFetcherTest extends ChromeTabbedActivityTest
private static final String WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH = private static final String WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH =
"/chrome/test/data/banners/manifest_long_icon_murmur2_hash.json"; "/chrome/test/data/banners/manifest_long_icon_murmur2_hash.json";
// Murmur2 hash of icon at {@link WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH}. // Murmur2 hash of icon at {@link WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH}.
private static final String LONG_ICON_MURMUR2_HASH = "17165487231247065090"; private static final String LONG_ICON_MURMUR2_HASH = "13495109619211221667";
// Scope for {@link WEB_MANIFEST_URL1}, {@link WEB_MANIFEST_URL2} and // Scope for {@link WEB_MANIFEST_URL1}, {@link WEB_MANIFEST_URL2} and
// {@link WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH}. // {@link WEB_MANIFEST_WITH_LONG_ICON_MURMUR2_HASH}.
......
...@@ -32,7 +32,7 @@ public class ManifestUpgradeDetectorTest extends ChromeTabbedActivityTestBase { ...@@ -32,7 +32,7 @@ public class ManifestUpgradeDetectorTest extends ChromeTabbedActivityTestBase {
private static final String WEBAPK_NAME = "Manifest test app"; private static final String WEBAPK_NAME = "Manifest test app";
private static final String WEBAPK_SHORT_NAME = "Manifest test app"; private static final String WEBAPK_SHORT_NAME = "Manifest test app";
private static final String WEBAPK_ICON_URL = "/chrome/test/data/banners/image-512px.png"; private static final String WEBAPK_ICON_URL = "/chrome/test/data/banners/image-512px.png";
private static final String WEBAPK_ICON_MURMUR2_HASH = "6537363487080720023"; private static final String WEBAPK_ICON_MURMUR2_HASH = "7742433188808797392";
private static final int WEBAPK_DISPLAY_MODE = WebDisplayMode.Standalone; private static final int WEBAPK_DISPLAY_MODE = WebDisplayMode.Standalone;
private static final int WEBAPK_ORIENTATION = ScreenOrientationValues.LANDSCAPE; private static final int WEBAPK_ORIENTATION = ScreenOrientationValues.LANDSCAPE;
private static final long WEBAPK_THEME_COLOR = 2147483648L; private static final long WEBAPK_THEME_COLOR = 2147483648L;
......
...@@ -47,7 +47,7 @@ void WebApkIconHasher::OnURLFetchComplete(const net::URLFetcher* source) { ...@@ -47,7 +47,7 @@ void WebApkIconHasher::OnURLFetchComplete(const net::URLFetcher* source) {
// browser process is a security bug. // browser process is a security bug.
std::string raw_image_data; std::string raw_image_data;
source->GetResponseAsString(&raw_image_data); source->GetResponseAsString(&raw_image_data);
uint64_t hash = MurmurHash64B(&raw_image_data.front(), raw_image_data.size(), uint64_t hash = MurmurHash64A(&raw_image_data.front(), raw_image_data.size(),
kMurmur2HashSeed); kMurmur2HashSeed);
callback_.Run(base::Uint64ToString(hash)); callback_.Run(base::Uint64ToString(hash));
} }
...@@ -26,7 +26,7 @@ const base::FilePath::CharType kTestDataDir[] = ...@@ -26,7 +26,7 @@ const base::FilePath::CharType kTestDataDir[] =
const char kIconUrl[] = "/android/google.png"; const char kIconUrl[] = "/android/google.png";
// Murmur2 hash for |kIconUrl|. // Murmur2 hash for |kIconUrl|.
const char kIconMurmur2Hash[] = "13321047016824288610"; const char kIconMurmur2Hash[] = "2081059568551351877";
// Runs WebApkIconHasher and blocks till the murmur2 hash is computed. // Runs WebApkIconHasher and blocks till the murmur2 hash is computed.
class WebApkIconHasherRunner { class WebApkIconHasherRunner {
......
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