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

Unified Diff: test/FileSystemJsObject.cpp

Issue 29371607: Issue #3593 - Make isolate a fully internal member of the engine
Patch Set: improve unit tests to go with isolate change Created Jan. 16, 2017, 3:53 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 | « test/DefaultFileSystem.cpp ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/FileSystemJsObject.cpp
===================================================================
--- a/test/FileSystemJsObject.cpp
+++ b/test/FileSystemJsObject.cpp
@@ -44,9 +44,9 @@
{
if (!success)
throw std::runtime_error("Unable to read " + path);
- std::stringstream* const stream = new std::stringstream;
+ const auto stream = std::make_shared<std::stringstream>();
*stream << contentToRead;
- return std::shared_ptr<std::istream>(stream);
+ return stream;
}
void Write(const std::string& path, std::shared_ptr<std::istream> data)
@@ -116,9 +116,15 @@
void SetUp()
{
BaseJsTest::SetUp();
- mockFileSystem = MockFileSystemPtr(new MockFileSystem);
+ mockFileSystem = std::make_shared<MockFileSystem>();
jsEngine->SetFileSystem(mockFileSystem);
}
+
+ void TearDown()
+ {
+ mockFileSystem.reset();
+ BaseJsTest::TearDown();
+ }
};
}
« no previous file with comments | « test/DefaultFileSystem.cpp ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld