From 45eeac5526bab9717103d3fff27dc5eae9194950 Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Thu, 27 Apr 2017 09:50:24 -0700 Subject: [PATCH] Bug 1360047 - Generate random GUIDs more reliably in TestFxAccountDeviceListUpdater. r=eoger MozReview-Commit-ID: 9Ak99iIxOzY --HG-- extra : rebase_source : 784fe09fadff525affb81563deb3044b5d8ca859 --- .../gecko/fxa/devices/TestFxAccountDeviceListUpdater.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/devices/TestFxAccountDeviceListUpdater.java b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/devices/TestFxAccountDeviceListUpdater.java index 1e122ef18556..adfb276903d0 100644 --- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/devices/TestFxAccountDeviceListUpdater.java +++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/devices/TestFxAccountDeviceListUpdater.java @@ -27,6 +27,7 @@ import org.mozilla.gecko.fxa.login.State; import org.robolectric.shadows.ShadowContentResolver; import java.util.List; +import java.util.UUID; import static java.util.Objects.deepEquals; import static org.junit.Assert.assertEquals; @@ -176,7 +177,7 @@ public class TestFxAccountDeviceListUpdater { private ContentValues createMockRemoteClientValues(String name) { final long now = System.currentTimeMillis(); ContentValues cli = new ContentValues(); - cli.put(BrowserContract.RemoteDevices.GUID, "R" + Math.floor(Math.random() * 10)); + cli.put(BrowserContract.RemoteDevices.GUID, UUID.randomUUID().toString()); cli.put(BrowserContract.RemoteDevices.NAME, name); cli.put(BrowserContract.RemoteDevices.TYPE, "mobile"); cli.put(BrowserContract.RemoteDevices.IS_CURRENT_DEVICE, false);