nick252 / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

pressBack() doesn't call onBackPressed(). #163

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple Activity
2. Override onBackPressed() with some extra code
3. Write a test that calls pressBack()

What is the expected output? What do you see instead?

What I'd expect is the code in onBackPressed would get called.  However, that 
code is not getting called.

What version of the product are you using? On what operating system?

Espresso 2.1 on Mac OSX with Genymotion version 2.3.0.

Please provide any additional information below.

Some sample code:

@Override
public void onBackPressed() {
     Log.e("MALTZ", "is this working??");
     super.onBackPressed();
}

@Test
@MediumTest
public void test_Example() {
        getActivity();
        pressBack();
}

When running test_Example I don't see any log statements.

Original issue reported on code.google.com by ma...@yelp.com on 7 Jul 2015 at 5:51