Home | History | Annotate | Download | only in publisher1
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package android.content.pm.cts.shortcut.backup.publisher1;
     17 
     18 import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith;
     19 
     20 import android.content.pm.cts.shortcut.device.common.ShortcutManagerDeviceTestBase;
     21 
     22 public class ShortcutManagerPostBackupTest extends ShortcutManagerDeviceTestBase {
     23     public void testWithUninstall() {
     24         assertWith(getManager().getDynamicShortcuts())
     25                 .isEmpty();
     26 
     27         assertWith(getManager().getPinnedShortcuts())
     28                 .haveIds("s1", "s3", "ms1", "ms2")
     29                 .areAllEnabled();
     30 
     31         assertWith(getManager().getManifestShortcuts())
     32                 .haveIds("ms1", "ms2")
     33                 .areAllPinned()
     34                 .areAllEnabled();
     35     }
     36 
     37     public void testWithNoUninstall() {
     38         // Ideally this shouldn't be cleared, but for now it will be.
     39 //        assertWith(getManager().getDynamicShortcuts())
     40 //                .isEmpty();
     41 
     42         assertWith(getManager().getPinnedShortcuts())
     43                 .isEmpty();
     44 
     45         // Should still have the manifest shortcuts.
     46         assertWith(getManager().getManifestShortcuts())
     47                 .haveIds("ms1", "ms2")
     48                 .areAllEnabled();
     49     }
     50 }
     51