Bug 1388396 - bustage: Fix testBitmapNotScaledMoreThanTwoTimesTheSize. r=mcomella
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 13 Sep 2017 10:35:40 -0700
changeset 430245 77a524d860a0c2acddbcfe823bf60b6249d42c99
parent 430244 84a794ceb84b75cdbe365a7c7c6c430a7927a7b9
child 430246 a9e97f048dfff64219ca54be407d98e86721004c
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1388396
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1388396 - bustage: Fix testBitmapNotScaledMoreThanTwoTimesTheSize. r=mcomella MozReview-Commit-ID: BZ6dt5FE7FD
mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/processing/TestResizingProcessor.java
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/processing/TestResizingProcessor.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/processing/TestResizingProcessor.java
@@ -72,28 +72,29 @@ public class TestResizingProcessor {
         processor.process(request, response);
 
         verify(processor).resize(bitmap, request.getTargetSize());
         verify(bitmap).recycle();
         verify(response).updateBitmap(resizedBitmap);
     }
 
     @Test
-    public void testBitmapIsNotScaledMoreThanTwoTimesTheSize() {
+    public void testBitmapIsNotScaledMoreThanMaxScaleFactor() {
         final IconRequest request = createTestRequest();
 
-        final Bitmap bitmap = createBitmapMock(5);
+        final int initialSize = 5;
+        final Bitmap bitmap = createBitmapMock(initialSize);
         final IconResponse response = spy(IconResponse.create(bitmap));
 
         final ResizingProcessor processor = spy(new ResizingProcessor());
         final Bitmap resizedBitmap = mock(Bitmap.class);
         doReturn(resizedBitmap).when(processor).resize(any(Bitmap.class), anyInt());
         processor.process(request, response);
 
-        verify(processor).resize(bitmap, 10);
+        verify(processor).resize(bitmap, initialSize * ResizingProcessor.MAX_SCALE_FACTOR);
         verify(bitmap).recycle();
         verify(response).updateBitmap(resizedBitmap);
     }
 
     private IconRequest createTestRequest() {
         return Icons.with(RuntimeEnvironment.application)
                 .pageUrl(PAGE_URL)
                 .icon(IconDescriptor.createGenericIcon(ICON_URL))