mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Improving tests to fix testBindNormalWidget_withoutConfig, and beyond
1. Make waitXXX methods fail if the condition diesn’t turn true. 2. Waiting for loading to complete in tearDown instead of reloading the model 3. Avoiding waiting for load-complete where loading didn’t start 4. Disabling last test in AddConfigWidgetTest 5. Waiting for loading to complete inside setupAndVerifyContents(), not outside 6. Unifying how we wait for loader to complete 7. Adding more logging Bug: 117332845 Test: running all Nexus tests Change-Id: I3070e1ac2b9161179cc3e0800b0cd8162807389a
This commit is contained in:
@@ -106,7 +106,7 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
|
||||
|
||||
// Open widget tray and wait for load complete.
|
||||
final UiObject2 widgetContainer = openWidgetsTray();
|
||||
assertTrue(Wait.atMost(Condition.minChildCount(widgetContainer, 2), DEFAULT_UI_TIMEOUT));
|
||||
Wait.atMost(null, Condition.minChildCount(widgetContainer, 2), DEFAULT_UI_TIMEOUT);
|
||||
|
||||
// Drag widget to homescreen
|
||||
WidgetConfigStartupMonitor monitor = new WidgetConfigStartupMonitor();
|
||||
@@ -128,12 +128,12 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
|
||||
|
||||
setResult(acceptConfig);
|
||||
if (acceptConfig) {
|
||||
assertTrue(Wait.atMost(new WidgetSearchCondition(), DEFAULT_ACTIVITY_TIMEOUT));
|
||||
Wait.atMost(null, new WidgetSearchCondition(), DEFAULT_ACTIVITY_TIMEOUT);
|
||||
assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId));
|
||||
} else {
|
||||
// Verify that the widget id is deleted.
|
||||
assertTrue(Wait.atMost(() -> mAppWidgetManager.getAppWidgetInfo(mWidgetId) == null,
|
||||
DEFAULT_ACTIVITY_TIMEOUT));
|
||||
Wait.atMost(null, () -> mAppWidgetManager.getAppWidgetInfo(mWidgetId) == null,
|
||||
DEFAULT_ACTIVITY_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user