Adding temporary logging to diagnose testPendingWidget_autoRestored
This test fails Bug: 117332845 Test: running Launcher Change-Id: I300c856992b3d1f559c4c31525a45e2c4a960f11
This commit is contained in:
parent
f76ea29772
commit
c052e4e68a
|
@ -212,6 +212,11 @@ public class LauncherModel extends BroadcastReceiver
|
|||
|
||||
static void checkItemInfoLocked(
|
||||
final long itemId, final ItemInfo item, StackTraceElement[] stackTrace) {
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Checking item: " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
ItemInfo modelItem = sBgDataModel.itemsIdMap.get(itemId);
|
||||
if (modelItem != null && item != modelItem) {
|
||||
// check all the data is consistent
|
||||
|
|
|
@ -296,6 +296,11 @@ public class LoaderResults {
|
|||
final ArrayList<LauncherAppWidgetInfo> appWidgets,
|
||||
final Executor executor) {
|
||||
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
// Bind the workspace items
|
||||
int N = workspaceItems.size();
|
||||
for (int i = 0; i < N; i += ITEMS_CHUNK) {
|
||||
|
|
|
@ -124,6 +124,11 @@ public class LoaderTask implements Runnable {
|
|||
mPackageInstaller = PackageInstallerCompat.getInstance(mApp.getContext());
|
||||
mAppWidgetManager = AppWidgetManagerCompat.getInstance(mApp.getContext());
|
||||
mIconCache = mApp.getIconCache();
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
}
|
||||
|
||||
protected synchronized void waitForIdle() {
|
||||
|
|
|
@ -109,6 +109,11 @@ public class ModelWriter {
|
|||
}
|
||||
|
||||
private void checkItemInfoLocked(long itemId, ItemInfo item, StackTraceElement[] stackTrace) {
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Checking item: " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
ItemInfo modelItem = mBgDataModel.itemsIdMap.get(itemId);
|
||||
if (modelItem != null && item != modelItem) {
|
||||
// check all the data is consistent
|
||||
|
@ -358,6 +363,11 @@ public class ModelWriter {
|
|||
private final long mItemId;
|
||||
|
||||
UpdateItemRunnable(ItemInfo item, ContentWriter writer) {
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
mItem = item;
|
||||
mWriter = writer;
|
||||
mItemId = item.id;
|
||||
|
|
|
@ -144,6 +144,10 @@ public class BindWidgetTest extends AbstractLauncherUiTest {
|
|||
|
||||
@Test
|
||||
public void testPendingWidget_autoRestored() {
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS && com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Test Started @ " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
// A non-restored widget with no config screen gets restored automatically.
|
||||
LauncherAppWidgetProviderInfo info = findWidgetProvider(false);
|
||||
|
||||
|
@ -152,10 +156,20 @@ public class BindWidgetTest extends AbstractLauncherUiTest {
|
|||
item.restoreStatus = LauncherAppWidgetInfo.FLAG_ID_NOT_VALID;
|
||||
|
||||
setupAndVerifyContents(item, LauncherAppWidgetHostView.class, info.label);
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Test Ended @ " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPendingWidget_withConfigScreen() throws Exception {
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Test Started @ " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
// A non-restored widget with config screen get bound and shows a 'Click to setup' UI.
|
||||
LauncherAppWidgetProviderInfo info = findWidgetProvider(true);
|
||||
|
||||
|
@ -176,6 +190,11 @@ public class BindWidgetTest extends AbstractLauncherUiTest {
|
|||
assertNotNull(AppWidgetManager.getInstance(mTargetContext)
|
||||
.getAppWidgetInfo(mCursor.getInt(mCursor.getColumnIndex(
|
||||
LauncherSettings.Favorites.APPWIDGET_ID))));
|
||||
if (com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
&& com.android.launcher3.Utilities.IS_DEBUG_DEVICE) {
|
||||
android.util.Log.d("b/117332845",
|
||||
"Test Ended @ " + android.util.Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
}
|
||||
|
||||
@Test @Ignore
|
||||
|
|
Loading…
Reference in New Issue