diff -r 000000000000 -r 6474c204b198 mobile/android/tests/background/junit3/src/sync/helpers/ExpectInvalidRequestFetchDelegate.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mobile/android/tests/background/junit3/src/sync/helpers/ExpectInvalidRequestFetchDelegate.java Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,24 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +package org.mozilla.gecko.background.sync.helpers; + +import org.mozilla.gecko.sync.repositories.InvalidRequestException; +import org.mozilla.gecko.sync.repositories.domain.Record; + +public class ExpectInvalidRequestFetchDelegate extends DefaultFetchDelegate { + public static final String LOG_TAG = "ExpInvRequestFetchDel"; + + @Override + public void onFetchFailed(Exception ex, Record rec) { + if (ex instanceof InvalidRequestException) { + onDone(); + } else { + performNotify("Expected InvalidRequestException but got ", ex); + } + } + + private void onDone() { + performNotify(); + } +}