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

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

Issue 29424615: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Patch Set: changed impl for reading file as bytes array, modified test. AndroidFileSystem now does not resolveā€¦ Created May 29, 2017, 11:26 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/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 40d1a24c4e9e12b22c3aeb58a9a515a2b00c482c..644be3cee52ae24266cae27d8df2570def4ea14a 100644
--- a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/FilterEngineTest.java
@@ -17,6 +17,7 @@
package org.adblockplus.libadblockplus.tests;
+import android.os.SystemClock;
import android.util.Log;
import org.adblockplus.libadblockplus.Filter;
import org.adblockplus.libadblockplus.FilterEngine;
@@ -331,6 +332,12 @@ public class FilterEngineTest extends FilterEngineGenericTest
@Test
public void testSetRemoveFilterChangeCallback()
{
+ // avoid callback with action "load"
+ while (filterEngine.getListedFilters().size() > 0)
+ {
+ filterEngine.getListedFilters().get(0).removeFromList();
+ }
+
MockFilterChangeCallback mockFilterChangeCallback = new MockFilterChangeCallback(0);
filterEngine.setFilterChangeCallback(mockFilterChangeCallback);

Powered by Google App Engine
This is Rietveld