Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 22 matching lines...) Expand all Loading... | |
33 @Override | 33 @Override |
34 protected void setUp() throws Exception | 34 protected void setUp() throws Exception |
35 { | 35 { |
36 super.setUp(); | 36 super.setUp(); |
37 | 37 |
38 jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem()); | 38 jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem()); |
39 jsEngine.setDefaultFileSystem(getContext().getFilesDir().getAbsolutePath()); | 39 jsEngine.setDefaultFileSystem(getContext().getFilesDir().getAbsolutePath()); |
40 jsEngine.setWebRequest(new ThrowingWebRequest()); | 40 jsEngine.setWebRequest(new ThrowingWebRequest()); |
41 } | 41 } |
42 | 42 |
43 // If the method returns null then a default implementation of the Log System | |
44 // provided by libadblockplus is used. | |
43 protected LogSystem createLogSystem() | 45 protected LogSystem createLogSystem() |
44 { | 46 { |
45 return null; | 47 return null; |
anton
2017/08/24 11:12:50
comment like "returning null log system make JsEng
sergei
2017/08/24 13:39:10
Done.
| |
46 } | 48 } |
47 | 49 |
48 protected Context getContext() | 50 protected Context getContext() |
49 { | 51 { |
50 return getInstrumentation().getTargetContext(); | 52 return getInstrumentation().getTargetContext(); |
51 } | 53 } |
52 } | 54 } |
LEFT | RIGHT |