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 29382555: Issue 4977 - Request for compressed response in AndroidWebRequest (Closed)
Left Patch Set: diego's suggestions Created March 17, 2017, 5:58 a.m.
Right Patch Set: updated test Created March 28, 2017, 10:02 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
« no previous file with change/comment | « no previous file | libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-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
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld