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

Delta Between Two Patch Sets: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/MockFilterChangeCallback.java

Issue 29424615: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Left Patch Set: now using smart_ptr, changed impl for reading file as string, minor changes Created May 22, 2017, 1:03 p.m.
Right 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 package org.adblockplus.libadblockplus; 18 package org.adblockplus.libadblockplus;
19 19
20 import android.util.Log;
21
22 import org.adblockplus.libadblockplus.android.Utils;
23
20 public class MockFilterChangeCallback extends FilterChangeCallback 24 public class MockFilterChangeCallback extends FilterChangeCallback
21 { 25 {
22 private int timesCalled; 26 private static final String TAG = Utils.getTag(MockFilterChangeCallback.class) ;
27
28 private volatile int timesCalled;
23 29
24 public MockFilterChangeCallback(int timesCalled) 30 public MockFilterChangeCallback(int timesCalled)
25 { 31 {
26 this.timesCalled = timesCalled; 32 this.timesCalled = timesCalled;
27 } 33 }
28 34
29 public int getTimesCalled() 35 public int getTimesCalled()
30 { 36 {
31 return timesCalled; 37 return timesCalled;
32 } 38 }
33 39
34 @Override 40 @Override
35 public void filterChangeCallback(String action, JsValue jsValue) 41 public void filterChangeCallback(String action, JsValue jsValue)
36 { 42 {
43 Log.d(TAG, "callback: action=" + action + ", jsValue=" + jsValue);
37 timesCalled++; 44 timesCalled++;
38 } 45 }
39 } 46 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld