Home
last modified time | relevance | path

Searched refs:listener (Results 1 – 25 of 131) sorted by relevance

123456

/cts/tests/tests/view/src/android/view/cts/
DViewTreeObserverTest.java85 final MockOnGlobalFocusChangeListener listener = new MockOnGlobalFocusChangeListener(); in testAddOnGlobalFocusChangeListener() local
86 mViewTreeObserver.addOnGlobalFocusChangeListener(listener); in testAddOnGlobalFocusChangeListener()
87 assertFalse(listener.hasCalledOnGlobalFocusChanged()); in testAddOnGlobalFocusChangeListener()
99 return listener.hasCalledOnGlobalFocusChanged() in testAddOnGlobalFocusChangeListener()
100 && listener.oldFocus == view1 && listener.newFocus == view2; in testAddOnGlobalFocusChangeListener()
110 MockOnGlobalLayoutListener listener = new MockOnGlobalLayoutListener(); in testAddOnGlobalLayoutListener() local
111 assertFalse(listener.hasCalledOnGlobalLayout()); in testAddOnGlobalLayoutListener()
112 mViewTreeObserver.addOnGlobalLayoutListener(listener); in testAddOnGlobalLayoutListener()
114 assertTrue(listener.hasCalledOnGlobalLayout()); in testAddOnGlobalLayoutListener()
121 MockOnPreDrawListener listener = new MockOnPreDrawListener(); in testAddOnPreDrawListener() local
[all …]
DOrientationListenerTest.java45 MockOrientationListener listener = new MockOrientationListener(mContext); in testRegisterationOfOrientationListener() local
46 listener.disable(); in testRegisterationOfOrientationListener()
47 listener.enable(); in testRegisterationOfOrientationListener()
61 MockOrientationListener listener = new MockOrientationListener(mContext); in testOnSensorChanged() local
72 listener.reset(); in testOnSensorChanged()
78 MockOrientationListener listener = new MockOrientationListener(mContext); in testOnOrientationChanged() local
79 listener.enable(); in testOnOrientationChanged()
DOrientationEventListenerTest.java37 MockOrientationEventListener listener = new MockOrientationEventListener(mContext); in testEnableAndDisable() local
38 listener.enable(); in testEnableAndDisable()
39 listener.disable(); in testEnableAndDisable()
47 MockOrientationEventListener listener = new MockOrientationEventListener(mContext); in testCanDetectOrientation() local
48 assertEquals(hasSensor, listener.canDetectOrientation()); in testCanDetectOrientation()
DViewStubTest.java77 MockOnInflateListener listener = new MockOnInflateListener(); in testSetVisibility() local
78 viewStub1.setOnInflateListener(listener); in testSetVisibility()
79 assertFalse(listener.hasCalledOnInflate()); in testSetVisibility()
86 assertFalse(listener.hasCalledOnInflate()); in testSetVisibility()
93 assertTrue(listener.hasCalledOnInflate()); in testSetVisibility()
136 final MockOnInflateListener listener = new MockOnInflateListener(); in testSetOnInflateListener() local
138 viewStub.setOnInflateListener(listener); in testSetOnInflateListener()
139 assertFalse(listener.hasCalledOnInflate()); in testSetOnInflateListener()
141 assertTrue(listener.hasCalledOnInflate()); in testSetOnInflateListener()
174 final MockOnInflateListener listener = new MockOnInflateListener(); in testInflate() local
[all …]
/cts/tests/tests/widget/src/android/widget/cts/
DRadioGroupTest.java78 MockOnHierarchyChangeListener listener = new MockOnHierarchyChangeListener(); in testSetOnHierarchyChangeListener() local
79 mDefaultRadioGroup.setOnHierarchyChangeListener(listener); in testSetOnHierarchyChangeListener()
82 listener.reset(); in testSetOnHierarchyChangeListener()
84 assertSame(mDefaultRadioGroup, listener.getOnChildViewRemovedParentParam()); in testSetOnHierarchyChangeListener()
85 assertSame(button3, listener.getOnChildViewRemovedChildParam()); in testSetOnHierarchyChangeListener()
87 listener.reset(); in testSetOnHierarchyChangeListener()
89 assertSame(mDefaultRadioGroup, listener.getOnChildViewAddedParentParam()); in testSetOnHierarchyChangeListener()
90 assertSame(button3, listener.getOnChildViewAddedChildParam()); in testSetOnHierarchyChangeListener()
119 MockOnCheckedChangeListener listener = new MockOnCheckedChangeListener(); in testInternalCheckedStateTracker() local
120 mDefaultRadioGroup.setOnCheckedChangeListener(listener); in testInternalCheckedStateTracker()
[all …]
DTimePickerTest.java103 MockOnTimeChangeListener listener = new MockOnTimeChangeListener(); in testSetOnTimeChangedListener() local
104 mTimePicker.setOnTimeChangedListener(listener); in testSetOnTimeChangedListener()
107 assertEquals(initialHour, listener.getNotifiedHourOfDay()); in testSetOnTimeChangedListener()
108 assertEquals(initialMinute, listener.getNotifiedMinute()); in testSetOnTimeChangedListener()
111 listener.reset(); in testSetOnTimeChangedListener()
113 assertFalse(listener.hasCalledOnTimeChanged()); in testSetOnTimeChangedListener()
116 assertTrue(listener.hasCalledOnTimeChanged()); in testSetOnTimeChangedListener()
117 assertEquals(initialHour + 1, listener.getNotifiedHourOfDay()); in testSetOnTimeChangedListener()
118 assertEquals(initialMinute, listener.getNotifiedMinute()); in testSetOnTimeChangedListener()
119 assertSame(mTimePicker, listener.getNotifiedView()); in testSetOnTimeChangedListener()
[all …]
DSeekBarTest.java61 MockOnSeekBarListener listener = new MockOnSeekBarListener(); in testSetOnSeekBarChangeListener() local
63 mSeekBar.setOnSeekBarChangeListener(listener); in testSetOnSeekBarChangeListener()
64 listener.reset(); in testSetOnSeekBarChangeListener()
73 assertTrue(listener.hasCalledOnStartTrackingTouch()); in testSetOnSeekBarChangeListener()
75 assertTrue(listener.hasCalledOnProgressChanged()); in testSetOnSeekBarChangeListener()
77 listener.reset(); in testSetOnSeekBarChangeListener()
84 assertTrue(listener.hasCalledOnProgressChanged()); in testSetOnSeekBarChangeListener()
86 listener.reset(); in testSetOnSeekBarChangeListener()
93 assertTrue(listener.hasCalledOnStopTrackingTouch()); in testSetOnSeekBarChangeListener()
DSlidingDrawerTest.java257 MockOnDrawerOpenListener listener = new MockOnDrawerOpenListener(); in testSetOnDrawerOpenListener() local
258 drawer.setOnDrawerOpenListener(listener); in testSetOnDrawerOpenListener()
260 assertFalse(listener.hadOpenedDrawer()); in testSetOnDrawerOpenListener()
263 assertTrue(listener.hadOpenedDrawer()); in testSetOnDrawerOpenListener()
269 MockOnDrawerCloseListener listener = new MockOnDrawerCloseListener(); in testSetOnDrawerCloseListener() local
270 drawer.setOnDrawerCloseListener(listener); in testSetOnDrawerCloseListener()
272 assertFalse(listener.hadClosedDrawer()); in testSetOnDrawerCloseListener()
275 assertFalse(listener.hadClosedDrawer()); in testSetOnDrawerCloseListener()
278 assertTrue(listener.hadClosedDrawer()); in testSetOnDrawerCloseListener()
283 MockOnDrawerScrollListener listener = new MockOnDrawerScrollListener(); in testSetOnDrawerScrollListener() local
[all …]
DPopupMenuTest.java55 TestPopupDismissListener listener = new TestPopupDismissListener(); in testOnDismissListener() local
56 popupMenu.setOnDismissListener(listener); in testOnDismissListener()
64 assertEquals(0, listener.getDismissCount()); in testOnDismissListener()
72 assertEquals(1, listener.getDismissCount()); in testOnDismissListener()
80 assertEquals(1, listener.getDismissCount()); in testOnDismissListener()
/cts/tests/tests/transition/src/android/transition/cts/
DTransitionManagerTest.java42 assertFalse(mTransition.listener.resumed); in testBeginDelayedTransition()
43 assertFalse(mTransition.listener.paused); in testBeginDelayedTransition()
44 assertFalse(mTransition.listener.canceled); in testBeginDelayedTransition()
45 assertNotNull(mTransition.listener.transition); in testBeginDelayedTransition()
46 assertEquals(TestTransition.class, mTransition.listener.transition.getClass()); in testBeginDelayedTransition()
47 assertTrue(mTransition != mTransition.listener.transition); in testBeginDelayedTransition()
62 assertFalse(mTransition.listener.resumed); in testGo()
63 assertFalse(mTransition.listener.paused); in testGo()
64 assertFalse(mTransition.listener.canceled); in testGo()
65 assertNotNull(mTransition.listener.transition); in testGo()
[all …]
DBaseTransitionTest.java58 waitForStart(mTransition.listener); in waitForStart()
61 …protected static void waitForStart(SimpleTransitionListener listener) throws InterruptedException { in waitForStart() argument
63 synchronized (listener) { in waitForStart()
64 while (!listener.started) { in waitForStart()
70 listener.wait(waitTime); in waitForStart()
76 waitForEnd(mTransition.listener, waitMillis); in waitForEnd()
79 protected static void waitForEnd(SimpleTransitionListener listener, long waitMillis) in waitForEnd() argument
82 synchronized (listener) { in waitForEnd()
83 while (!listener.ended) { in waitForEnd()
89 listener.wait(waitTime); in waitForEnd()
[all …]
/cts/tests/tests/hardware/src/android/hardware/cts/helpers/sensoroperations/
DTestSensorOperation.java74 void execute(TestSensorManager sensorManager, TestSensorEventListener listener) in execute() argument
124 TestSensorEventListener listener = new TestSensorEventListener(mEnvironment, mHandler); in execute() local
130 mExecutor.execute(mSensorManager, listener); in execute()
139 mExecutor.execute(mSensorManager, listener); in execute()
144 List<TestSensorEvent> collectedEvents = listener.getCollectedEvents(); in execute()
149 trySaveCollectedEvents(parent, listener); in execute()
198 private void trySaveCollectedEvents(ISensorTestNode parent, TestSensorEventListener listener) { in trySaveCollectedEvents() argument
214 listener.logCollectedEventsToFile(sanitizedFileName, mDeviceWakeUpTimeMs); in trySaveCollectedEvents()
231 public void execute(TestSensorManager sensorManager, TestSensorEventListener listener) in createOperation()
234 CountDownLatch latch = sensorManager.registerListener(listener, eventCount); in createOperation()
[all …]
/cts/tests/tests/mediastress/src/android/mediastress/cts/
DSurfaceTextureGLSurfaceView.java32 public SurfaceTextureGLSurfaceView(Context context, OnSurfaceChangedListener listener) { in SurfaceTextureGLSurfaceView() argument
33 this(context, null, listener); in SurfaceTextureGLSurfaceView()
37 OnSurfaceChangedListener listener) { in SurfaceTextureGLSurfaceView() argument
39 mListener = listener; in SurfaceTextureGLSurfaceView()
40 init(listener); in SurfaceTextureGLSurfaceView()
43 private void init(OnSurfaceChangedListener listener) { in init() argument
45 mRenderer = new SurfaceTextureRenderer(listener); in init()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/p2p/testcase/
DGoTestCase.java46 ActionListenerTest listener = new ActionListenerTest(); in executeTest() local
52 listener); in executeTest()
53 if (!listener.check(ActionListenerTest.SUCCESS, TIMEOUT)) { in executeTest()
62 listener); in executeTest()
63 if (!listener.check(ActionListenerTest.SUCCESS, TIMEOUT)) { in executeTest()
72 listener); in executeTest()
73 if (!listener.check(ActionListenerTest.SUCCESS, TIMEOUT)) { in executeTest()
81 mP2pMgr.createGroup(mChannel, listener); in executeTest()
82 if (!listener.check(ActionListenerTest.SUCCESS, TIMEOUT)) { in executeTest()
/cts/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/
DCameraSessionUtils.java172 public static CameraCaptureSession configureAndVerifySession(SessionListener listener, in configureAndVerifySession() argument
177 checkNotNull(listener); in configureAndVerifySession()
183 CameraCaptureSession session = listener.getConfiguredSession(device, outputs, handler); in configureAndVerifySession()
184 if (new MockUtil().isMock(listener)) { in configureAndVerifySession()
185 verify(listener, never()).onConfigureFailed(any(CameraCaptureSession.class)); in configureAndVerifySession()
186 verify(listener, never()).onClosed(eq(session)); in configureAndVerifySession()
187 verify(listener, atLeastOnce()).onConfigured(eq(session)); in configureAndVerifySession()
212 public static Pair<TotalCaptureResult, Long> captureAndVerifyResult(CaptureCallback listener, in captureAndVerifyResult() argument
215 checkNotNull(listener); in captureAndVerifyResult()
220 Pair<TotalCaptureResult, Long> result = listener.getCapturedResult(session, request, in captureAndVerifyResult()
[all …]
/cts/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/
DJarHostTestTest.java76 ITestInvocationListener listener = EasyMock.createMock(ITestInvocationListener.class); in testRun() local
81 listener.testRunStarted(RUN_NAME, 1); in testRun()
82 listener.testStarted(expectedTest); in testRun()
83 listener.testEnded(expectedTest, Collections.EMPTY_MAP); in testRun()
84 listener.testRunEnded(EasyMock.anyLong(), EasyMock.eq(Collections.EMPTY_MAP)); in testRun()
90 EasyMock.replay(listener); in testRun()
91 mJarTest.run(listener); in testRun()
92 EasyMock.verify(listener); in testRun()
/cts/tests/tests/hardware/src/android/hardware/camera2/cts/
DCaptureRequestTest.java147 SimpleCaptureCallback listener = new SimpleCaptureCallback(); in testBlackLevelLock() local
159 startPreview(requestBuilder, previewSz, listener); in testBlackLevelLock()
160 waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY); in testBlackLevelLock()
162 verifyBlackLevelLockResults(listener, NUM_FRAMES_VERIFIED, /*maxLockOffCnt*/0); in testBlackLevelLock()
166 listener = new SimpleCaptureCallback(); in testBlackLevelLock()
167 startPreview(requestBuilder, previewSz, listener); in testBlackLevelLock()
168 waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY); in testBlackLevelLock()
170 verifyBlackLevelLockResults(listener, NUM_FRAMES_VERIFIED, /*maxLockOffCnt*/1); in testBlackLevelLock()
210 SimpleCaptureCallback listener = new SimpleCaptureCallback(); in testLensShadingMap() local
226 listener = new SimpleCaptureCallback(); in testLensShadingMap()
[all …]
/cts/tests/tests/accessibility/src/android/view/accessibility/cts/
DCaptioningManagerTest.java59 MockCaptioningChangeListener listener = new MockCaptioningChangeListener(); in testChangeListener() local
60 mManager.addCaptioningChangeListener(listener); in testChangeListener()
63 assertTrue("Observed enabled change", listener.wasEnabledChangedCalled); in testChangeListener()
66 assertTrue("Observed user style change", listener.wasUserStyleChangedCalled); in testChangeListener()
69 assertTrue("Observed locale change", listener.wasLocaleChangedCalled); in testChangeListener()
72 assertTrue("Observed font scale change", listener.wasFontScaleChangedCalled); in testChangeListener()
74 mManager.removeCaptioningChangeListener(listener); in testChangeListener()
76 listener.reset(); in testChangeListener()
79 assertFalse("Did not observe enabled change", listener.wasEnabledChangedCalled); in testChangeListener()
82 mManager.removeCaptioningChangeListener(listener); in testChangeListener()
/cts/tests/tests/animation/src/android/animation/cts/
DAnimatorTest.java127 MyListener listener = new MyListener(); in testSetListener() local
128 assertFalse(listener.mStart); in testSetListener()
129 assertFalse(listener.mEnd); in testSetListener()
130 assertEquals(listener.mRepeat, 0); in testSetListener()
131 mAnimator.addListener(listener); in testSetListener()
136 assertTrue(listener.mStart); in testSetListener()
137 assertFalse(listener.mEnd); in testSetListener()
138 assertTrue(listener.mRepeat >= 0); in testSetListener()
146 assertTrue(listener.mCancel); in testSetListener()
154 assertTrue(listener.mEnd); in testSetListener()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/
DWavAnalyzer.java12 private final Listener listener; field in WavAnalyzer
25 public WavAnalyzer(byte[] byteData, int sampleRate, Listener listener) { in WavAnalyzer() argument
26 this.listener = listener; in WavAnalyzer()
45 listener.sendMessage("Calculating... Please wait...\n"); in doWork()
49 listener.sendMessage("WARNING: May have missed the prefix." in doWork()
66 listener.sendMessage("WARNING: Data is clipped." in isClipped()
87 listener.sendMessage("WARNING: Inconsistent result across trials." in isConsistent()
101 listener.sendMessage( in responsePassesHifiTest()
108 listener.sendMessage("WARNING: Signal is too weak or background noise is too strong." in responsePassesHifiTest()
120 listener.sendMessage( in responsePassesHifiTest()
[all …]
/cts/tests/tests/location/src/android/location/cts/
DLocationManagerTest.java380 final MockLocationListener listener = new MockLocationListener(); in doLocationUpdatesWithLocationListener() local
386 mManager.requestLocationUpdates(providerName, 0, 0, listener); in doLocationUpdatesWithLocationListener()
387 listener.setLocationRequested(); in doLocationUpdatesWithLocationListener()
393 assertTrue(listener.hasCalledLocationRequested(TEST_TIME_OUT)); in doLocationUpdatesWithLocationListener()
395 assertTrue(listener.hasCalledOnLocationChanged(TEST_TIME_OUT)); in doLocationUpdatesWithLocationListener()
396 Location location = listener.getLocation(); in doLocationUpdatesWithLocationListener()
403 listener.reset(); in doLocationUpdatesWithLocationListener()
404 assertFalse(listener.hasCalledOnLocationChanged(0)); in doLocationUpdatesWithLocationListener()
405 mManager.removeUpdates(listener); in doLocationUpdatesWithLocationListener()
407 assertFalse(listener.hasCalledOnLocationChanged(TEST_TIME_OUT)); in doLocationUpdatesWithLocationListener()
[all …]
/cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/
DSingleJUnitTestResultParser.java44 public SingleJUnitTestResultParser(TestIdentifier testId, ITestRunListener listener) { in SingleJUnitTestResultParser() argument
47 mTestListeners.add(listener); in SingleJUnitTestResultParser()
86 for (ITestRunListener listener : mTestListeners) { in doTestEnded()
87 listener.testFailed(mTestId, mStackTrace.toString()); in doTestEnded()
91 for (ITestRunListener listener : mTestListeners) { in doTestEnded()
92 listener.testEnded(mTestId, emptyMap); in doTestEnded()
DGeeTestResultParser.java219 public GeeTestResultParser(String testRunId, ITestRunListener listener) { in GeeTestResultParser() argument
222 mTestListeners.add(listener); in GeeTestResultParser()
358 for (ITestRunListener listener : mTestListeners) { in reportTestRunStarted()
359 listener.testRunStarted(mTestRunId, mNumTestsExpected); in reportTestRunStarted()
369 for (ITestRunListener listener : mTestListeners) { in reportTestRunEnded()
370 listener.testRunEnded(mTotalRunTime, getRunMetrics()); in reportTestRunEnded()
491 for (ITestRunListener listener : mTestListeners) { in processTestStartedTag()
492 listener.testStarted(testId); in processTestStartedTag()
551 for (ITestRunListener listener : mTestListeners) { in doTestEnded()
552 listener.testFailed(testId, mCurrentTestResult.getTrace()); in doTestEnded()
[all …]
/cts/tests/tests/content/src/android/content/cts/
DClipboardManagerListenerActivity.java38 public synchronized void addPrimaryClipChangedListener(OnPrimaryClipChangedListener listener) { in addPrimaryClipChangedListener() argument
39 mClipboardManager.addPrimaryClipChangedListener(listener); in addPrimaryClipChangedListener()
42 … public synchronized void removePrimaryClipChangedListener(OnPrimaryClipChangedListener listener) { in removePrimaryClipChangedListener() argument
43 mClipboardManager.removePrimaryClipChangedListener(listener); in removePrimaryClipChangedListener()
/cts/tests/tests/hardware/src/android/hardware/cts/helpers/
DTestSensorManager.java72 public void registerListener(TestSensorEventListener listener) { in registerListener() argument
78 mTestSensorEventListener = listener; in registerListener()
99 TestSensorEventListener listener, in registerListener() argument
107 CountDownLatch latch = listener.getLatchForSensorEvents(eventCount); in registerListener()
108 mTestSensorEventListener = listener; in registerListener()
139 TestSensorEventListener listener, in registerListener() argument
141 return registerListener(listener, eventCount, true); in registerListener()

123456