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

Unified Diff: test/BaseJsTest.h

Issue 29512648: Issue 5475 - Update adblockpluscore dependency to revision hg:b935a0402215 (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 11, 2017, 12:36 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
Index: test/BaseJsTest.h
diff --git a/test/BaseJsTest.h b/test/BaseJsTest.h
index f112b85fad6a2dd862c4dc0d5db554a5b4c79a76..1f7b79298e5d8f3d4d0227efad9e02c8cc93d985 100644
--- a/test/BaseJsTest.h
+++ b/test/BaseJsTest.h
@@ -108,34 +108,29 @@ public:
class ThrowingFileSystem : public AdblockPlus::IFileSystem
{
public:
- void Read(const std::string& path, const ReadCallback& callback) const override
+ void Read(const std::string& fileName, const ReadCallback& callback) const override
{
throw std::runtime_error("Not implemented");
}
- void Write(const std::string& path, const IOBuffer& data,
+ void Write(const std::string& fileName, const IOBuffer& data,
const Callback& callback) override
{
throw std::runtime_error("Not implemented");
}
- void Move(const std::string& fromPath, const std::string& toPath,
+ void Move(const std::string& fromFileName, const std::string& toFileName,
const Callback& callback) override
{
throw std::runtime_error("Not implemented");
}
- void Remove(const std::string& path, const Callback& callback) override
+ void Remove(const std::string& fileName, const Callback& callback) override
{
throw std::runtime_error("Not implemented");
}
- void Stat(const std::string& path, const StatCallback& callback) const override
- {
- throw std::runtime_error("Not implemented");
- }
-
- std::string Resolve(const std::string& path) const override
+ void Stat(const std::string& fileName, const StatCallback& callback) const override
{
throw std::runtime_error("Not implemented");
}
@@ -165,16 +160,16 @@ public:
{
}
- void Read(const std::string& path, const ReadCallback& callback) const override
+ void Read(const std::string& fileName, const ReadCallback& callback) const override
{
- scheduler([path, callback]
+ scheduler([fileName, callback]
{
- if (path == "patterns.ini")
+ if (fileName == "patterns.ini")
{
- std::string dummyData = "# Adblock Plus preferences\n[Subscription]\nurl=~fl~";
+ std::string dummyData = "# Adblock Plus preferences\n[Subscription]\nurl=~user~0000";
callback(IOBuffer(dummyData.cbegin(), dummyData.cend()), "");
}
- else if (path == "prefs.json")
+ else if (fileName == "prefs.json")
{
std::string dummyData = "{}";
callback(IOBuffer(dummyData.cbegin(), dummyData.cend()), "");
@@ -182,39 +177,33 @@ public:
});
}
- void Write(const std::string& path, const IOBuffer& data,
+ void Write(const std::string& fileName, const IOBuffer& data,
const Callback& callback) override
{
}
- void Move(const std::string& fromPath, const std::string& toPath,
+ void Move(const std::string& fromFileName, const std::string& toFileName,
const Callback& callback) override
{
}
- void Remove(const std::string& path, const Callback& callback) override
+ void Remove(const std::string& fileName, const Callback& callback) override
{
}
- void Stat(const std::string& path, const StatCallback& callback) const override
+ void Stat(const std::string& fileName, const StatCallback& callback) const override
{
- scheduler([path, callback]
+ scheduler([fileName, callback]
{
StatResult result;
- if (path == "patterns.ini")
+ if (fileName == "patterns.ini")
{
result.exists = true;
- result.isFile = true;
}
callback(result, "");
});
}
-
- std::string Resolve(const std::string& path) const override
- {
- return path;
- }
public:
Scheduler scheduler;
};
« libadblockplus.gyp ('K') | « src/Notification.cpp ('k') | test/DefaultFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld