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

Side by Side Diff: test/BaseJsTest.h

Issue 29508569: Issue 5450 - don't expose std::shared_ptr<JsEngine> (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 7, 2017, 8:39 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
« no previous file with comments | « test/AppInfoJsObject.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 struct ThrowingPlatformCreationParameters: AdblockPlus::Platform::CreationParame ters 260 struct ThrowingPlatformCreationParameters: AdblockPlus::Platform::CreationParame ters
261 { 261 {
262 ThrowingPlatformCreationParameters(); 262 ThrowingPlatformCreationParameters();
263 }; 263 };
264 264
265 class BaseJsTest : public ::testing::Test 265 class BaseJsTest : public ::testing::Test
266 { 266 {
267 protected: 267 protected:
268 std::unique_ptr<AdblockPlus::Platform> platform; 268 std::unique_ptr<AdblockPlus::Platform> platform;
269 269
270 virtual void SetUp() 270 void SetUp() override
271 { 271 {
272 platform.reset(new AdblockPlus::Platform(ThrowingPlatformCreationParameters( ))); 272 platform.reset(new AdblockPlus::Platform(ThrowingPlatformCreationParameters( )));
273 } 273 }
274
275 AdblockPlus::JsEngine& GetJsEngine()
276 {
277 if (!platform)
278 throw std::runtime_error("Platform must be initialized");
279 return platform->GetJsEngine();
280 }
281
282 void TearDown() override
283 {
284 if (platform)
285 platform.reset();
286 }
274 }; 287 };
275 288
276 #endif 289 #endif
OLDNEW
« no previous file with comments | « test/AppInfoJsObject.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld