I am trying to write unit tests for my application.  I have a button
that initiates a call, and to test it I am trying to use an Activity
Monitor to block the call, but for some reason the call is allowed to
execute, causing the test to fail.  My test case is written as
follows:

public void test2Launches() {
                Instrumentation instr = getInstrumentation();
                IntentFilter callFilter = new IntentFilter(Intent.ACTION_CALL);
                Instrumentation.ActivityMonitor monitor =
instr.addMonitor(callFilter, null, true);
                mActivity.runOnUiThread(
                                new Runnable() {

                                        public void run() {
                                                mCallButton.requestFocus();

                                        }
                                }
                );
                this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
                assertEquals(1, monitor.getHits());
        }

Any help on why this isn't working would be appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to