Index: ppapi/tests/test_utils.cc |
diff --git a/ppapi/tests/test_utils.cc b/ppapi/tests/test_utils.cc |
index fb5f7625ab3927e8006ef27a7f7bd4541a9e086a..df13fde8b21399b85407f5ff8ad0af870189846d 100644 |
--- a/ppapi/tests/test_utils.cc |
+++ b/ppapi/tests/test_utils.cc |
@@ -5,10 +5,17 @@ |
#include "ppapi/tests/test_utils.h" |
#include <stdio.h> |
+#if defined(_MSC_VER) |
+#include <windows.h> |
+#else |
+#include <unistd.h> |
+#endif |
#include "ppapi/c/pp_errors.h" |
#include "ppapi/cpp/module.h" |
+const int kActionTimeoutMs = 10000; |
+ |
const PPB_Testing_Dev* GetTestingInterface() { |
static const PPB_Testing_Dev* g_testing_interface = |
reinterpret_cast<PPB_Testing_Dev const*>( |
@@ -24,6 +31,14 @@ std::string ReportError(const char* method, int32_t error) { |
return result; |
} |
+void PlatformSleep(int duration_ms) { |
+#if defined(_MSC_VER) |
+ ::Sleep(duration_ms); |
+#else |
+ usleep(duration_ms * 1000); |
+#endif |
+} |
+ |
TestCompletionCallback::TestCompletionCallback(PP_Instance instance) |
: have_result_(false), |
result_(PP_OK_COMPLETIONPENDING), |