OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 import java.net.MalformedURLException; | 27 import java.net.MalformedURLException; |
28 import java.util.List; | 28 import java.util.List; |
29 | 29 |
30 public class AndroidWebRequestTest extends BaseJsTest | 30 public class AndroidWebRequestTest extends BaseJsTest |
31 { | 31 { |
32 @Override | 32 @Override |
33 protected void setUp() throws Exception | 33 protected void setUp() throws Exception |
34 { | 34 { |
35 super.setUp(); | 35 super.setUp(); |
36 | 36 |
37 jsEngine.setWebRequest(new AndroidWebRequest(true)); | 37 jsEngine.setWebRequest(new AndroidWebRequest(true, true)); |
38 } | 38 } |
39 | 39 |
40 @Test | 40 @Test |
41 public void testRealWebRequest() | 41 public void testRealWebRequest() |
42 { | 42 { |
43 // This URL should redirect to easylist-downloads.adblockplus.org and we | 43 // This URL should redirect to easylist-downloads.adblockplus.org and we |
44 // should get the actual filter list back. | 44 // should get the actual filter list back. |
45 jsEngine.evaluate( | 45 jsEngine.evaluate( |
46 "_webRequest.GET('https://easylist-downloads.adblockplus.org/easylist.txt'
, {}, " + | 46 "_webRequest.GET('https://easylist-downloads.adblockplus.org/easylist.txt'
, {}, " + |
47 "function(result) {foo = result;} )"); | 47 "function(result) {foo = result;} )"); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 assertFalse(isDocumentWhitelisted); | 132 assertFalse(isDocumentWhitelisted); |
133 | 133 |
134 boolean isElemhideWhitelisted = filterEngine.isElemhideWhitelisted(url, null
); | 134 boolean isElemhideWhitelisted = filterEngine.isElemhideWhitelisted(url, null
); |
135 assertFalse(isElemhideWhitelisted); | 135 assertFalse(isElemhideWhitelisted); |
136 | 136 |
137 List<String> selectors = filterEngine.getElementHidingSelectors(url); | 137 List<String> selectors = filterEngine.getElementHidingSelectors(url); |
138 assertNotNull(selectors); | 138 assertNotNull(selectors); |
139 assertTrue(selectors.size() > 0); | 139 assertTrue(selectors.size() > 0); |
140 } | 140 } |
141 } | 141 } |
OLD | NEW |