Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java

Issue 29344967: Issue 4031 - Implement tests for libadblockplus-android (Closed)
Patch Set: fixed "B" to "b" (Fhd) Created Sept. 13, 2016, 5:57 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
similarity index 51%
copy from libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java
copy to libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
index 7e655ba71e65c7a8bfbfe9a4fa9c6b30a385ba55..c8c66f67396a8a5321b7755068748df226ae1c0d 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
@@ -15,24 +15,27 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.adblockplus.libadblockplus;
+package org.adblockplus.libadblockplus.tests;
-public class AdblockPlusException extends RuntimeException
-{
- private static final long serialVersionUID = -8127654134450836743L;
+import org.adblockplus.libadblockplus.AppInfo;
+import org.adblockplus.libadblockplus.JsEngine;
+import org.adblockplus.libadblockplus.LazyLogSystem;
+import org.adblockplus.libadblockplus.ThrowingWebRequest;
- public AdblockPlusException(final String message)
- {
- super(message);
- }
+import android.test.AndroidTestCase;
- public AdblockPlusException(final String message, final Throwable throwable)
- {
- super(message, throwable);
- }
+public abstract class BaseJsTest extends AndroidTestCase
+{
+ protected JsEngine jsEngine;
- public AdblockPlusException(final Throwable throwable)
+ @Override
+ protected void setUp() throws Exception
{
- super(throwable);
+ super.setUp();
+
+ jsEngine = new JsEngine(AppInfo.builder().build());
+ jsEngine.setDefaultLogSystem();
+ jsEngine.setDefaultFileSystem(getContext().getFilesDir().getAbsolutePath());
+ jsEngine.setWebRequest(new ThrowingWebRequest());
}
}

Powered by Google App Engine
This is Rietveld