Fix AddWidgetTest flake
Test: ABTD

200 all PASS: https://android-build.googleplex.com/builds/tests/view?invocationId=I20300010100881398

Without this CL, 1/100 FAIL: https://android-build.googleplex.com/builds/abtd/run/L73700000956982533

Change-Id: Ia9d7746144e9838798332f4eea223a9529551713
diff --git a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
index 561f3cc..1f5590e 100644
--- a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
@@ -54,6 +54,8 @@
         clearHomescreen();
         mDevice.pressHome();
 
+        waitForLauncherCondition("Workspace didn't finish loading", l -> !l.isWorkspaceLoading());
+
         final LauncherAppWidgetProviderInfo widgetInfo =
                 TestViewHelpers.findWidgetProvider(this, false /* hasConfigureScreen */);