| OLD | NEW |
| 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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 { | 74 { |
| 75 fileSystem = new TestFileSystem(); | 75 fileSystem = new TestFileSystem(); |
| 76 fileSystemPtr.reset(fileSystem); | 76 fileSystemPtr.reset(fileSystem); |
| 77 | 77 |
| 78 Reset(); | 78 Reset(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void Reset(const AdblockPlus::FilterEngine::Prefs& preconfiguredPrefs = | 81 void Reset(const AdblockPlus::FilterEngine::Prefs& preconfiguredPrefs = |
| 82 AdblockPlus::FilterEngine::Prefs()) | 82 AdblockPlus::FilterEngine::Prefs()) |
| 83 { | 83 { |
| 84 jsEngine = AdblockPlus::JsEngine::New(); | 84 jsEngine = createJsEngine(); |
| 85 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem)); | 85 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem)); |
| 86 jsEngine->SetFileSystem(fileSystemPtr); | 86 jsEngine->SetFileSystem(fileSystemPtr); |
| 87 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest)); | 87 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest)); |
| 88 | 88 |
| 89 filterEngine.reset( | 89 filterEngine.reset( |
| 90 new AdblockPlus::FilterEngine(jsEngine, preconfiguredPrefs)); | 90 new AdblockPlus::FilterEngine(jsEngine, preconfiguredPrefs)); |
| 91 } | 91 } |
| 92 }; | 92 }; |
| 93 } | 93 } |
| 94 | 94 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 AdblockPlus::Sleep(100); | 196 AdblockPlus::Sleep(100); |
| 197 | 197 |
| 198 ASSERT_FALSE(fileSystem->prefsContents.empty()); | 198 ASSERT_FALSE(fileSystem->prefsContents.empty()); |
| 199 | 199 |
| 200 Reset(preconfiguredPrefs); | 200 Reset(preconfiguredPrefs); |
| 201 | 201 |
| 202 ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool()); | 202 ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool()); |
| 203 ASSERT_FALSE(filterEngine->GetPref("suppress_first_run_page")->AsBool()); | 203 ASSERT_FALSE(filterEngine->GetPref("suppress_first_run_page")->AsBool()); |
| 204 } | 204 } |
| OLD | NEW |