| 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-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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 #ifndef MOCKS_H | 18 #ifndef MOCKS_H |
| 19 #define MOCKS_H | 19 #define MOCKS_H |
| 20 | 20 |
| 21 #include <thread> | 21 #include <thread> |
| 22 | 22 |
| 23 #include <AdblockPlus.h> | 23 #include <AdblockPlus.h> |
| 24 #include <AdblockPlus/Platform.h> | 24 #include <AdblockPlus/Platform.h> |
| 25 #include <gtest/gtest.h> | 25 #include <gtest/gtest.h> |
| 26 #include "../src/Thread.h" | |
| 27 | 26 |
| 28 // Strictly speaking in each test there should be a special implementation of | 27 // Strictly speaking in each test there should be a special implementation of |
| 29 // an interface, which is merely referenced by a wrapper and the latter should | 28 // an interface, which is merely referenced by a wrapper and the latter should |
| 30 // be injected into JsEngine or what ever. However the everthing a test often | 29 // be injected into JsEngine or what ever. However the everthing a test often |
| 31 // actually needs is the access to pending tasks. Therefore instantiation of | 30 // actually needs is the access to pending tasks. Therefore instantiation of |
| 32 // implemenation of an interface, creation of shared tasks and sharing them | 31 // implemenation of an interface, creation of shared tasks and sharing them |
| 33 // with tasks in test is located in this class. | 32 // with tasks in test is located in this class. |
| 34 // | 33 // |
| 35 // Task is passed as an additional template parameter instead of using traits | 34 // Task is passed as an additional template parameter instead of using traits |
| 36 // (CRTP does not work with types in derived class) merely to simplify the code | 35 // (CRTP does not work with types in derived class) merely to simplify the code |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 268 } |
| 270 | 269 |
| 271 void TearDown() override | 270 void TearDown() override |
| 272 { | 271 { |
| 273 if (platform) | 272 if (platform) |
| 274 platform.reset(); | 273 platform.reset(); |
| 275 } | 274 } |
| 276 }; | 275 }; |
| 277 | 276 |
| 278 #endif | 277 #endif |
| OLD | NEW |