26
26
import android .annotation .SuppressLint ;
27
27
import android .content .Context ;
28
28
import android .graphics .Canvas ;
29
+ import android .os .Build .VERSION_CODES ;
29
30
import android .view .View .MeasureSpec ;
30
31
import android .view .ViewGroup .LayoutParams ;
31
32
import androidx .test .core .app .ApplicationProvider ;
40
41
41
42
/** Tests for {@link MemoryView}. */
42
43
@ RunWith (RobolectricTestRunner .class )
43
- @ Config (sdk = Config . OLDEST_SDK )
44
+ @ Config (sdk = VERSION_CODES . M )
44
45
public class MemoryViewTest {
45
46
46
47
private static final int BYTES_IN_MB = 1024 * 1024 ;
@@ -70,7 +71,7 @@ public void setUpRuntime() {
70
71
public void memoryView_correctText_withProvidedRuntime () {
71
72
memoryView .refreshMemStats (runtime );
72
73
73
- assertThat (memoryView .getText ().toString ()).isEqualTo ("used: 25MB / 100MB (25%)" );
74
+ assertThat (memoryView .getText ().toString ()).isEqualTo ("used: 25 MB / 100 MB (25%)" );
74
75
}
75
76
76
77
@ Test
@@ -85,7 +86,7 @@ public void memoryView_pathNotEmpty_afterRefreshing() {
85
86
assertThat (shadowCanvas .getPathPaintHistoryCount ()).isEqualTo (1 );
86
87
87
88
ShadowPath drawnPath = shadowOf (shadowCanvas .getDrawnPath (0 ));
88
- assertThat (drawnPath .getPoints ().get (0 )).isEqualTo (new Point (34f , 250f , MOVE_TO ));
89
+ assertThat (drawnPath .getPoints ().get (0 )).isEqualTo (new Point (36f , 250f , MOVE_TO ));
89
90
}
90
91
91
92
@ SuppressLint ("WrongCall" ) // Testing onDraw
0 commit comments