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

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

Issue 29424615: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Left Patch Set: using method from c++ utils Created April 28, 2017, 10:44 a.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:
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-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
(...skipping 24 matching lines...) Expand all
35 { 35 {
36 return patternsIniExists; 36 return patternsIniExists;
37 } 37 }
38 38
39 public void setPatternsIniExists(boolean patternsIniExists) 39 public void setPatternsIniExists(boolean patternsIniExists)
40 { 40 {
41 this.patternsIniExists = patternsIniExists; 41 this.patternsIniExists = patternsIniExists;
42 } 42 }
43 43
44 @Override 44 @Override
45 public String read(String path) 45 public byte[] read(String path)
46 { 46 {
47 String result;
47 if (path.equals(PATTERNS_INI)) 48 if (path.equals(PATTERNS_INI))
48 { 49 {
49 return "# Adblock Plus preferences\n[Subscription]\nurl=~fl~"; 50 result = "# Adblock Plus preferences\n[Subscription]\nurl=~fl~";
50 } 51 }
51 else if (path.equals("prefs.json")) 52 else if (path.equals("prefs.json"))
52 { 53 {
53 return "{}"; 54 result = "{}";
54 } 55 }
55 else 56 else
56 { 57 {
57 return ""; 58 result = "";
58 } 59 }
60 return result.getBytes();
59 } 61 }
60 62
61 @Override 63 @Override
62 public void write(String path, String data) 64 public void write(String path, byte[] data)
63 { 65 {
64 66
65 } 67 }
66 68
67 @Override 69 @Override
68 public void move(String fromPath, String toPath) 70 public void move(String fromPath, String toPath)
69 { 71 {
70 72
71 } 73 }
72 74
(...skipping 18 matching lines...) Expand all
91 } 93 }
92 } 94 }
93 95
94 @Override 96 @Override
95 protected void setUp() throws Exception 97 protected void setUp() throws Exception
96 { 98 {
97 super.setUp(); 99 super.setUp();
98 100
99 jsEngine.setWebRequest(new LazyWebRequest()); 101 jsEngine.setWebRequest(new LazyWebRequest());
100 jsEngine.setDefaultLogSystem(); 102 jsEngine.setDefaultLogSystem();
101 jsEngine.setFileSystem(new PatternsIniStubFileSystem()); 103 jsEngine.setFileSystem(new PatternsIniStubFileSystem());
sergei 2017/05/22 12:09:06 Just for reference, I would expect that the propos
anton 2017/05/22 13:04:37 Acknowledged.
102 104
103 filterEngine = new FilterEngine(jsEngine); 105 filterEngine = new FilterEngine(jsEngine);
104 } 106 }
105 } 107 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld