Index: test/UpdateCheck.cpp |
=================================================================== |
--- a/test/UpdateCheck.cpp |
+++ b/test/UpdateCheck.cpp |
@@ -49,17 +49,17 @@ |
protected: |
AdblockPlus::AppInfo appInfo; |
TestWebRequest* webRequest; |
AdblockPlus::WebRequestPtr webRequestPtr; |
AdblockPlus::JsEnginePtr jsEngine; |
FilterEnginePtr filterEngine; |
bool eventCallbackCalled; |
- AdblockPlus::JsConstValueList eventCallbackParams; |
+ AdblockPlus::JsValueList eventCallbackParams; |
bool updateCallbackCalled; |
std::string updateError; |
void SetUp() |
{ |
webRequest = new TestWebRequest(); |
webRequestPtr.reset(webRequest); |
@@ -81,17 +81,17 @@ |
} |
void ForceUpdateCheck() |
{ |
filterEngine->ForceUpdateCheck( |
std::bind(&UpdateCheckTest::UpdateCallback, this, std::placeholders::_1)); |
} |
- void EventCallback(const AdblockPlus::JsConstValueList& params) |
+ void EventCallback(const AdblockPlus::JsValueList& params) |
{ |
eventCallbackCalled = true; |
eventCallbackParams = params; |
} |
void UpdateCallback(const std::string& error) |
{ |
updateCallbackCalled = true; |
@@ -114,17 +114,17 @@ |
ForceUpdateCheck(); |
AdblockPlus::Sleep(100); |
ASSERT_FALSE(eventCallbackCalled); |
ASSERT_TRUE(updateCallbackCalled); |
ASSERT_FALSE(updateError.empty()); |
- std::string expectedUrl(filterEngine->GetPref("update_url_release")->AsString()); |
+ std::string expectedUrl(filterEngine->GetPref("update_url_release").AsString()); |
std::string platform = jsEngine->Evaluate("require('info').platform")->AsString(); |
std::string platformVersion = jsEngine->Evaluate("require('info').platformVersion")->AsString(); |
FindAndReplace(expectedUrl, "%NAME%", appInfo.name); |
FindAndReplace(expectedUrl, "%TYPE%", "1"); // manual update |
expectedUrl += "&addonName=" + appInfo.name + |
"&addonVersion=" + appInfo.version + |
"&application=" + appInfo.application + |
@@ -149,21 +149,21 @@ |
Reset(); |
ForceUpdateCheck(); |
AdblockPlus::Sleep(100); |
ASSERT_TRUE(eventCallbackCalled); |
ASSERT_EQ(1u, eventCallbackParams.size()); |
- ASSERT_EQ("https://foo.bar/", eventCallbackParams[0]->AsString()); |
+ ASSERT_EQ("https://foo.bar/", eventCallbackParams[0].AsString()); |
ASSERT_TRUE(updateCallbackCalled); |
ASSERT_TRUE(updateError.empty()); |
- std::string expectedUrl(filterEngine->GetPref("update_url_devbuild")->AsString()); |
+ std::string expectedUrl(filterEngine->GetPref("update_url_devbuild").AsString()); |
std::string platform = jsEngine->Evaluate("require('info').platform")->AsString(); |
std::string platformVersion = jsEngine->Evaluate("require('info').platformVersion")->AsString(); |
FindAndReplace(expectedUrl, "%NAME%", appInfo.name); |
FindAndReplace(expectedUrl, "%TYPE%", "1"); // manual update |
expectedUrl += "&addonName=" + appInfo.name + |
"&addonVersion=" + appInfo.version + |
"&application=" + appInfo.application + |
@@ -188,17 +188,17 @@ |
Reset(); |
ForceUpdateCheck(); |
AdblockPlus::Sleep(100); |
ASSERT_TRUE(eventCallbackCalled); |
ASSERT_EQ(1u, eventCallbackParams.size()); |
- ASSERT_EQ("https://foo.bar/", eventCallbackParams[0]->AsString()); |
+ ASSERT_EQ("https://foo.bar/", eventCallbackParams[0].AsString()); |
ASSERT_TRUE(updateCallbackCalled); |
ASSERT_TRUE(updateError.empty()); |
} |
TEST_F(UpdateCheckTest, WrongApplication) |
{ |
webRequest->response.status = AdblockPlus::WebRequest::NS_OK; |
webRequest->response.responseStatus = 200; |