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

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

Issue 29351744: Issue 4399 - Add WebView inheritor with ad blocking (Closed)
Left Patch Set: updated README Created Sept. 14, 2016, 11:43 a.m.
Right Patch Set: changed packages, now using AdblockEngine (original ABPEngine), improved demo app Created Oct. 25, 2016, 11:20 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
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
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.tests; 18 package org.adblockplus.libadblockplus.tests;
19 19
20 import org.adblockplus.android.AndroidWebRequest; 20 import org.adblockplus.libadblockplus.android.AndroidWebRequest;
21 import org.adblockplus.libadblockplus.FilterEngine; 21 import org.adblockplus.libadblockplus.FilterEngine;
22 import org.adblockplus.libadblockplus.JsValue; 22 import org.adblockplus.libadblockplus.JsValue;
23 import org.adblockplus.libadblockplus.ServerResponse; 23 import org.adblockplus.libadblockplus.ServerResponse;
24 24
25 import org.junit.Test; 25 import org.junit.Test;
26 26
27 import java.net.MalformedURLException; 27 import java.net.MalformedURLException;
28 import java.net.URL;
29 import java.util.List; 28 import java.util.List;
30 29
31 public class AndroidWebRequestTest extends BaseJsTest 30 public class AndroidWebRequestTest extends BaseJsTest
32 { 31 {
33 @Override 32 @Override
34 protected void setUp() throws Exception 33 protected void setUp() throws Exception
35 { 34 {
36 super.setUp(); 35 super.setUp();
37 36
38 jsEngine.setWebRequest(new AndroidWebRequest(true)); 37 jsEngine.setWebRequest(new AndroidWebRequest(true));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 assertFalse(isDocumentWhitelisted); 125 assertFalse(isDocumentWhitelisted);
127 126
128 boolean isElemhideWhitelisted = filterEngine.isElemhideWhitelisted(url, null); 127 boolean isElemhideWhitelisted = filterEngine.isElemhideWhitelisted(url, null);
129 assertFalse(isElemhideWhitelisted); 128 assertFalse(isElemhideWhitelisted);
130 129
131 List<String> selectors = filterEngine.getElementHidingSelectors(url); 130 List<String> selectors = filterEngine.getElementHidingSelectors(url);
132 assertNotNull(selectors); 131 assertNotNull(selectors);
133 assertTrue(selectors.size() > 0); 132 assertTrue(selectors.size() > 0);
134 } 133 }
135 } 134 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld