Add a delay before toggling WiFi to let listening activity to start up
testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent() starts up a helper activity that listens to network connection/disconnection notification. In many cases the test fails because the activity is just able to start up and initialize itself before the first toggle event arrives and in many cases it just misses by a matter of 100ms. Added a short sleep after we start the activity and before we start toggling WiFi to let the activity a chance to receive the first notification. Bug: 70988664 Change-Id: Ie122770fc8447a936d079fae7bdce61b10cf6dc2
This commit is contained in:
@@ -502,6 +502,7 @@ public class ConnectivityManagerTest extends AndroidTestCase {
|
||||
startIntent.setComponent(new ComponentName("android.net.cts.appForApi23",
|
||||
"android.net.cts.appForApi23.ConnectivityListeningActivity"));
|
||||
mContext.startActivity(startIntent);
|
||||
Thread.sleep(200);
|
||||
|
||||
toggleWifi();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user