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

Unified Diff: test/FileSystemJsObject.cpp

Issue 29367003: Issue #4711 - Rewrite legacy thread facilities
Patch Set: Created Dec. 7, 2016, 4:44 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
« src/Thread.h ('K') | « test/BaseJsTest.h ('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
@@ -17,7 +17,6 @@
#include <sstream>
#include "BaseJsTest.h"
-#include "../src/Thread.h"
namespace
{
@@ -102,7 +101,7 @@
std::string& error)
{
jsEngine->Evaluate("_fileSystem.read('', function(r) {result = r})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
content = jsEngine->Evaluate("result.content")->AsString();
error = jsEngine->Evaluate("result.error")->AsString();
}
@@ -152,7 +151,7 @@
TEST_F(FileSystemJsObjectTest, Write)
{
jsEngine->Evaluate("_fileSystem.write('foo', 'bar', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_EQ("foo", mockFileSystem->lastWrittenPath);
ASSERT_EQ("bar", mockFileSystem->lastWrittenContent);
ASSERT_EQ("", jsEngine->Evaluate("error")->AsString());
@@ -168,14 +167,14 @@
{
mockFileSystem->success = false;
jsEngine->Evaluate("_fileSystem.write('foo', 'bar', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_NE("", jsEngine->Evaluate("error")->AsString());
}
TEST_F(FileSystemJsObjectTest, Move)
{
jsEngine->Evaluate("_fileSystem.move('foo', 'bar', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_EQ("foo", mockFileSystem->movedFrom);
ASSERT_EQ("bar", mockFileSystem->movedTo);
ASSERT_EQ("", jsEngine->Evaluate("error")->AsString());
@@ -191,14 +190,14 @@
{
mockFileSystem->success = false;
jsEngine->Evaluate("_fileSystem.move('foo', 'bar', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_NE("", jsEngine->Evaluate("error")->AsString());
}
TEST_F(FileSystemJsObjectTest, Remove)
{
jsEngine->Evaluate("_fileSystem.remove('foo', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_EQ("foo", mockFileSystem->removedPath);
ASSERT_EQ("", jsEngine->Evaluate("error")->AsString());
}
@@ -213,7 +212,7 @@
{
mockFileSystem->success = false;
jsEngine->Evaluate("_fileSystem.remove('foo', function(e) {error = e})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_NE("", jsEngine->Evaluate("error")->AsString());
}
@@ -224,7 +223,7 @@
mockFileSystem->statIsFile = true;
mockFileSystem->statLastModified = 1337;
jsEngine->Evaluate("_fileSystem.stat('foo', function(r) {result = r})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_EQ("foo", mockFileSystem->statPath);
ASSERT_EQ("", jsEngine->Evaluate("result.error")->AsString());
ASSERT_TRUE(jsEngine->Evaluate("result.exists")->AsBool());
@@ -243,6 +242,6 @@
{
mockFileSystem->success = false;
jsEngine->Evaluate("_fileSystem.stat('foo', function(r) {result = r})");
- AdblockPlus::Sleep(50);
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
ASSERT_NE("", jsEngine->Evaluate("result.error")->AsString());
}
« src/Thread.h ('K') | « test/BaseJsTest.h ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld