Search in sources :

Example 1 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project platform_frameworks_base by android.

the class IPrintManagerParametersTest method testRemovePrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.removePrintServicesChangeListener
     */
@MediumTest
public void testRemovePrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    // Removing unknown listeners is a no-op
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.removePrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 2 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by ResurrectionRemix.

the class IPrintManagerParametersTest method testRemovePrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.removePrintServicesChangeListener
     */
@MediumTest
public void testRemovePrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    // Removing unknown listeners is a no-op
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.removePrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 3 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project platform_frameworks_base by android.

the class IPrintManagerParametersTest method testAddPrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.addPrintServiceRecommendationsChangeListener
     */
@MediumTest
public void testAddPrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.addPrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 4 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by AOSPA.

the class IPrintManagerParametersTest method testAddPrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.addPrintServiceRecommendationsChangeListener
     */
@MediumTest
public void testAddPrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.addPrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 5 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by AOSPA.

the class IPrintManagerParametersTest method testRemovePrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.removePrintServicesChangeListener
     */
@MediumTest
public void testRemovePrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    // Removing unknown listeners is a no-op
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.removePrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

IRecommendationsChangeListener (android.printservice.recommendation.IRecommendationsChangeListener)10 MediumTest (android.test.suitebuilder.annotation.MediumTest)10