This source file includes following definitions.
- isSatisfied
package org.chromium.content.browser.test.util;
public class OrientationChangeObserverCriteria implements Criteria {
private final MockOrientationObserver mObserver;
private final int mTarget;
private final boolean mCheckTarget;
public OrientationChangeObserverCriteria(MockOrientationObserver observer) {
mObserver = observer;
mObserver.mHasChanged = false;
mCheckTarget = false;
mTarget = -1;
}
public OrientationChangeObserverCriteria(MockOrientationObserver observer, int target) {
mObserver = observer;
mObserver.mHasChanged = false;
mTarget = target;
mCheckTarget = true;
}
@Override
public boolean isSatisfied() {
if (!mObserver.mHasChanged)
return false;
return !mCheckTarget || mObserver.mOrientation == mTarget;
}
}