Replace direct invocation of ShadowApplication.getApplicationContext()
with call to RuntimeEnvironment.application which provides the same instance.
Bug: None
Change-Id: I4e318955086dff990cb572a09c116d28a1023a34
Reviewed-on: https://webrtc-review.googlesource.com/73244
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23064}
diff --git a/examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java b/examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java
index 0724ec1..b97f1f0 100644
--- a/examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java
+++ b/examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java
@@ -11,11 +11,8 @@
package org.appspot.apprtc;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
@@ -39,8 +36,8 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowApplication;
import org.robolectric.shadows.ShadowLog;
/**
@@ -68,7 +65,7 @@
@Before
public void setUp() {
ShadowLog.stream = System.out;
- context = ShadowApplication.getInstance().getApplicationContext();
+ context = RuntimeEnvironment.application;
mockedAppRtcAudioManager = mock(AppRTCAudioManager.class);
mockedAudioManager = mock(AudioManager.class);
mockedBluetoothHeadset = mock(BluetoothHeadset.class);