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

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

Issue 29405564: Issue 5121 - Use Acceptable Ads API in libadblockplus (Closed)
Left Patch Set: Created April 7, 2017, 7:03 a.m.
Right Patch Set: minor cleanup suggestions by Serge Created May 4, 2017, 6:17 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « dependencies ('k') | libadblockplus-android/jni/JniFilterEngine.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 List<Subscription> listedSubscriptions = filterEngine.getListedSubscriptions (); 418 List<Subscription> listedSubscriptions = filterEngine.getListedSubscriptions ();
419 for (Subscription eachSubscription : listedSubscriptions) 419 for (Subscription eachSubscription : listedSubscriptions)
420 { 420 {
421 if (eachSubscription.isAcceptableAds()) 421 if (eachSubscription.isAcceptableAds())
422 { 422 {
423 return; 423 return;
424 } 424 }
425 } 425 }
426 fail("AA subscription not found in listed subscriptions when enabled"); 426 fail("AA subscription not found in listed subscriptions when enabled");
427 } 427 }
428
429 @Test
430 public void testIsAcceptableAdsIfDisabled()
431 {
432 if (filterEngine.isAcceptableAdsEnabled())
433 {
434 filterEngine.setAcceptableAdsEnabled(false);
435 }
436 assertFalse(filterEngine.isAcceptableAdsEnabled());
437
438 List<Subscription> listedSubscriptions = filterEngine.getListedSubscriptions ();
439 for (Subscription eachSubscription : listedSubscriptions)
440 {
441 if (eachSubscription.isAcceptableAds())
442 {
443 fail("AA subscription found in listed subscriptions when disabled");
anton 2017/04/07 07:08:17 for some reason the test fails for now
sergei 2017/04/07 08:01:22 You need to also check whether it's disabled. The
anton 2017/04/07 08:06:49 there is (and there were) no 'disabled' property i
sergei 2017/04/07 09:51:03 Actually it's a good point, I think we need either
444 }
445 }
446 }
447 } 428 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld