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

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

Issue 29526696: Issue 5556 - remove WebRequest setter (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: Created Aug. 24, 2017, 5:24 p.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-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
index 86a5e5328f02d01ba5b13d9229963a557754dd28..e0283f33a80f4fc416183a526200cf1e165f854b 100644
--- a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java
@@ -22,6 +22,7 @@ import org.adblockplus.libadblockplus.JsEngine;
import org.adblockplus.libadblockplus.LazyLogSystem;
import org.adblockplus.libadblockplus.LogSystem;
import org.adblockplus.libadblockplus.ThrowingWebRequest;
+import org.adblockplus.libadblockplus.WebRequest;
import android.content.Context;
import android.test.InstrumentationTestCase;
@@ -35,9 +36,8 @@ public abstract class BaseJsTest extends InstrumentationTestCase
{
super.setUp();
- jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem());
+ jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem(), createWebRequest());
jsEngine.setDefaultFileSystem(getContext().getFilesDir().getAbsolutePath());
- jsEngine.setWebRequest(new ThrowingWebRequest());
}
// If the method returns null then a default implementation of the Log System
@@ -47,6 +47,11 @@ public abstract class BaseJsTest extends InstrumentationTestCase
return null;
}
+ protected WebRequest createWebRequest()
+ {
+ return new ThrowingWebRequest();
+ }
+
protected Context getContext()
{
return getInstrumentation().getTargetContext();

Powered by Google App Engine
This is Rietveld