Index: test/JsEngine.cpp |
=================================================================== |
--- a/test/JsEngine.cpp |
+++ b/test/JsEngine.cpp |
@@ -23,14 +23,6 @@ |
class JsEngineTest : public BaseJsTest |
{ |
}; |
- |
- bool callbackCalled = false; |
- AdblockPlus::JsValueList callbackParams; |
- void Callback(AdblockPlus::JsValueList& params) |
- { |
- callbackCalled = true; |
- callbackParams = params; |
- } |
} |
TEST_F(JsEngineTest, Evaluate) |
@@ -74,6 +66,14 @@ |
TEST_F(JsEngineTest, EventCallbacks) |
{ |
+ bool callbackCalled = false; |
+ AdblockPlus::JsValueList callbackParams; |
+ auto Callback = [&callbackCalled, &callbackParams](AdblockPlus::JsValueList& params) |
+ { |
+ callbackCalled = true; |
+ callbackParams = params; |
+ }; |
+ |
// Trigger event without a callback |
callbackCalled = false; |
jsEngine->Evaluate("_triggerEvent('foobar')"); |