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

Unified Diff: test/JsEngine.cpp

Issue 4949583905947648: Issue 1280 - Update v8, the second part (Closed)
Patch Set: Created Oct. 27, 2014, 10:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/ConsoleJsObject.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')");
« no previous file with comments | « test/ConsoleJsObject.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld