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

Side by Side Diff: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/BaseJsTest.java

Issue 29533564: Issue 5556 - Update to use libadblockplus revision hg:566f64c8a2a8 (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: Created Sept. 1, 2017, 9:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 29
30 public abstract class BaseJsTest extends InstrumentationTestCase 30 public abstract class BaseJsTest extends InstrumentationTestCase
31 { 31 {
32 protected JsEngine jsEngine; 32 protected JsEngine jsEngine;
33 33
34 @Override 34 @Override
35 protected void setUp() throws Exception 35 protected void setUp() throws Exception
36 { 36 {
37 super.setUp(); 37 super.setUp();
38 38
39 jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem(), create WebRequest()); 39 jsEngine = new JsEngine(AppInfo.builder().build(), createLogSystem(), create WebRequest(),
40 jsEngine.setDefaultFileSystem(getContext().getFilesDir().getAbsolutePath()); 40 getContext().getFilesDir().getAbsolutePath());
41 } 41 }
42 42
43 // If the method returns null then a default implementation of the Log System 43 // If the method returns null then a default implementation of the Log System
44 // provided by libadblockplus is used. 44 // provided by libadblockplus is used.
45 protected LogSystem createLogSystem() 45 protected LogSystem createLogSystem()
46 { 46 {
47 return null; 47 return null;
48 } 48 }
49 49
50 protected WebRequest createWebRequest() 50 protected WebRequest createWebRequest()
51 { 51 {
52 return new ThrowingWebRequest(); 52 return new ThrowingWebRequest();
53 } 53 }
54 54
55 protected Context getContext() 55 protected Context getContext()
56 { 56 {
57 return getInstrumentation().getTargetContext(); 57 return getInstrumentation().getTargetContext();
58 } 58 }
59 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld