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

Side by Side Diff: test/BaseJsTest.h

Issue 10805001: Fixed: FileSystem;:Write should take an istream instance for input, not ostream (Closed)
Patch Set: Created May 24, 2013, 9:35 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/Utils.cpp ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 22 matching lines...) Expand all
33 }; 33 };
34 34
35 class ThrowingFileSystem : public AdblockPlus::FileSystem 35 class ThrowingFileSystem : public AdblockPlus::FileSystem
36 { 36 {
37 std::tr1::shared_ptr<std::istream> Read(const std::string& path) const 37 std::tr1::shared_ptr<std::istream> Read(const std::string& path) const
38 { 38 {
39 throw std::runtime_error("Not implemented"); 39 throw std::runtime_error("Not implemented");
40 } 40 }
41 41
42 void Write(const std::string& path, 42 void Write(const std::string& path,
43 std::tr1::shared_ptr<std::ostream> content) 43 std::tr1::shared_ptr<std::istream> content)
44 { 44 {
45 throw std::runtime_error("Not implemented"); 45 throw std::runtime_error("Not implemented");
46 } 46 }
47 47
48 void Move(const std::string& fromPath, const std::string& toPath) 48 void Move(const std::string& fromPath, const std::string& toPath)
49 { 49 {
50 throw std::runtime_error("Not implemented"); 50 throw std::runtime_error("Not implemented");
51 } 51 }
52 52
53 void Remove(const std::string& path) 53 void Remove(const std::string& path)
(...skipping 28 matching lines...) Expand all
82 if (path == "patterns.ini") 82 if (path == "patterns.ini")
83 { 83 {
84 std::string dummyData("# Adblock Plus preferences\n[Subscription]\nurl=~fl ~"); 84 std::string dummyData("# Adblock Plus preferences\n[Subscription]\nurl=~fl ~");
85 return std::tr1::shared_ptr<std::istream>(new std::istringstream(dummyData )); 85 return std::tr1::shared_ptr<std::istream>(new std::istringstream(dummyData ));
86 } 86 }
87 else 87 else
88 return std::tr1::shared_ptr<std::istream>(); 88 return std::tr1::shared_ptr<std::istream>();
89 } 89 }
90 90
91 void Write(const std::string& path, 91 void Write(const std::string& path,
92 std::tr1::shared_ptr<std::ostream> content) 92 std::tr1::shared_ptr<std::istream> content)
93 { 93 {
94 } 94 }
95 95
96 void Move(const std::string& fromPath, const std::string& toPath) 96 void Move(const std::string& fromPath, const std::string& toPath)
97 { 97 {
98 } 98 }
99 99
100 void Remove(const std::string& path) 100 void Remove(const std::string& path)
101 { 101 {
102 } 102 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 virtual void SetUp() 137 virtual void SetUp()
138 { 138 {
139 jsEngine = AdblockPlus::JsEngine::New(); 139 jsEngine = AdblockPlus::JsEngine::New();
140 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem)); 140 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem));
141 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem)); 141 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem));
142 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest)); 142 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest));
143 } 143 }
144 }; 144 };
145 145
146 #endif 146 #endif
OLDNEW
« no previous file with comments | « src/Utils.cpp ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld