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

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

Issue 29347315: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Patch Set: fix for firstRun test Created July 12, 2016, 1:05 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/FilterEngineTest.java
diff --git a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java
index 4c649e08b2180aca754091187c5ad5051875af36..3aec7e02355b93a3d6b1834ff374143dc2432e86 100644
--- a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java
@@ -19,6 +19,7 @@ package org.adblockplus.libadblockplus.tests;
import org.adblockplus.libadblockplus.Filter;
import org.adblockplus.libadblockplus.FilterEngine;
+import org.adblockplus.libadblockplus.LazyWebRequest;
import org.adblockplus.libadblockplus.MockFilterChangeCallback;
import org.adblockplus.libadblockplus.Subscription;
@@ -320,7 +321,15 @@ public class FilterEngineTest extends FilterEngineGenericTest
@Test
public void testFirstRunFlag()
{
- assertFalse(filterEngine.isFirstRun());
+ jsEngine.setWebRequest(new LazyWebRequest());
+ jsEngine.setDefaultLogSystem();
+
+ LazyFileSystem lazyFileSystem = new LazyFileSystem();
+ lazyFileSystem.setPatternsIniExists(false);
+ jsEngine.setFileSystem(lazyFileSystem);
+
+ filterEngine = new FilterEngine(jsEngine);
+ assertTrue(filterEngine.isFirstRun());
}
@Test

Powered by Google App Engine
This is Rietveld