Auto-tools/Projects/Robocop/WritingTests: Difference between revisions

Jump to navigation Jump to search
Line 39: Line 39:
We have infrastructure for testing content providers in an isolated environment. This means that we ensure that any updates to the databases behind content providers will not affect or be affected by the Fennec app.
We have infrastructure for testing content providers in an isolated environment. This means that we ensure that any updates to the databases behind content providers will not affect or be affected by the Fennec app.


To write a content provider test, you should follow the same file naming and Java packaging guidelines described for UI tests. However, you should create a class that inherits from ''ContentProviderTest'' instead of ''BaseTest'' or ''ActivityInstrumentationTestCase2''. Each Content Provider test class must have those the same three methods than UI tests (setUp(), test[YourFeature]() and tearDown) with one important difference: the ''setUp()'' method should call the following parent method:
To write a content provider test, you should follow the same file naming and Java packaging guidelines described for UI tests. However, you should create a class that inherits from ''ContentProviderTest'' instead of ''BaseTest'' or ''ActivityInstrumentationTestCase2''. Each Content Provider test class must have the same three methods as UI tests (setUp(), test[YourFeature]() and tearDown) with one important difference: the ''setUp()'' method should call the following parent method:


<pre>
<pre>
Confirmed users
1,759

edits

Navigation menu