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-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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LogSystem)); | 50 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LogSystem)); |
51 filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine)); | 51 filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine)); |
52 } | 52 } |
53 | 53 |
54 void TearDown() | 54 void TearDown() |
55 { | 55 { |
56 if (webRequest) | 56 if (webRequest) |
57 { | 57 { |
58 webRequest->Cancel(); | 58 webRequest->Cancel(); |
59 } | 59 } |
| 60 webRequest.reset(); |
| 61 filterEngine.reset(); |
| 62 BaseJsTest::TearDown(); |
60 } | 63 } |
61 }; | 64 }; |
62 | 65 |
63 typedef FilterEngineTestGeneric<LazyFileSystem, AdblockPlus::DefaultLogSystem>
FilterEngineTest; | 66 typedef FilterEngineTestGeneric<LazyFileSystem, AdblockPlus::DefaultLogSystem>
FilterEngineTest; |
64 typedef FilterEngineTestGeneric<VeryLazyFileSystem, LazyLogSystem> FilterEngin
eTestNoData; | 67 typedef FilterEngineTestGeneric<VeryLazyFileSystem, LazyLogSystem> FilterEngin
eTestNoData; |
65 | 68 |
66 struct MockFilterChangeCallback | 69 struct MockFilterChangeCallback |
67 { | 70 { |
68 MockFilterChangeCallback(int& timesCalled) : timesCalled(timesCalled) {} | 71 MockFilterChangeCallback(int& timesCalled) : timesCalled(timesCalled) {} |
69 | 72 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 633 |
631 TEST_F(FilterEngineWithFreshFolder, DisableSubscriptionsAutoSelectOnFirstRun) | 634 TEST_F(FilterEngineWithFreshFolder, DisableSubscriptionsAutoSelectOnFirstRun) |
632 { | 635 { |
633 auto jsEngine = createJsEngine(); | 636 auto jsEngine = createJsEngine(); |
634 FilterEngine::Prefs preSettings; | 637 FilterEngine::Prefs preSettings; |
635 preSettings["first_run_subscription_auto_select"] = jsEngine->NewValue(false); | 638 preSettings["first_run_subscription_auto_select"] = jsEngine->NewValue(false); |
636 auto filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine, pr
eSettings)); | 639 auto filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine, pr
eSettings)); |
637 const auto subscriptions = filterEngine->GetListedSubscriptions(); | 640 const auto subscriptions = filterEngine->GetListedSubscriptions(); |
638 EXPECT_EQ(0u, subscriptions.size()); | 641 EXPECT_EQ(0u, subscriptions.size()); |
639 } | 642 } |
OLD | NEW |