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()); |
} |