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

Unified Diff: test/BaseJsTest.h

Issue 29428650: Issue 5180 - introduce asynchronous web request (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created May 3, 2017, 2:21 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 | « src/WebRequestJsObject.cpp ('k') | test/BaseJsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/BaseJsTest.h
diff --git a/test/BaseJsTest.h b/test/BaseJsTest.h
index cbd627b3e3b6c37a5c69fbc35b1ef44396b66267..99b958a9f9c61fd3b8c8d0cceb6f556ce267c588 100644
--- a/test/BaseJsTest.h
+++ b/test/BaseJsTest.h
@@ -67,10 +67,14 @@ public:
};
-class ThrowingWebRequest : public AdblockPlus::WebRequest
+class ThrowingWebRequest : public AdblockPlus::IWebRequest, public AdblockPlus::WebRequest
{
public:
- AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders) const
+ AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders) const override
+ {
+ throw std::runtime_error("Unexpected GET: " + url);
+ }
+ void GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders, const GetCallback&) override
{
throw std::runtime_error("Unexpected GET: " + url);
}
@@ -138,7 +142,8 @@ public:
}
};
-AdblockPlus::JsEnginePtr CreateJsEngine(const AdblockPlus::AppInfo& appInfo = AdblockPlus::AppInfo());
+AdblockPlus::JsEnginePtr CreateJsEngine(const AdblockPlus::AppInfo& appInfo = AdblockPlus::AppInfo(),
+ AdblockPlus::WebRequestPtr webRequest = AdblockPlus::WebRequestPtr(new ThrowingWebRequest()));
class BaseJsTest : public ::testing::Test
{
« no previous file with comments | « src/WebRequestJsObject.cpp ('k') | test/BaseJsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld