Index: test/FileSystemJsObject.cpp |
=================================================================== |
--- a/test/FileSystemJsObject.cpp |
+++ b/test/FileSystemJsObject.cpp |
@@ -10,19 +10,19 @@ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+#include <sstream> |
#include "BaseJsTest.h" |
#include "../src/Thread.h" |
-#include "../src/Utils.h" |
namespace |
{ |
class MockFileSystem : public AdblockPlus::FileSystem |
{ |
public: |
bool success; |
std::string contentToRead; |
@@ -50,17 +50,20 @@ namespace |
return std::tr1::shared_ptr<std::istream>(stream); |
} |
void Write(const std::string& path, std::tr1::shared_ptr<std::ostream> data) |
{ |
if (!success) |
throw std::runtime_error("Unable to write to " + path); |
lastWrittenPath = path; |
- lastWrittenContent = AdblockPlus::Utils::Slurp(*data); |
+ |
+ std::stringstream content; |
+ content << data->rdbuf(); |
+ lastWrittenContent = content.str(); |
} |
void Move(const std::string& fromPath, const std::string& toPath) |
{ |
if (!success) |
throw std::runtime_error("Unable to move " + fromPath + " to " |
+ toPath); |
movedFrom = fromPath; |