Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1228)

Unified Diff: ppapi/tests/test_utils.cc

Issue 8515014: Fix flaky PPAPITest.FlashClipboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do the same thing for IsFormatAvailable. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ppapi/tests/test_flash_clipboard.cc ('K') | « ppapi/tests/test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« ppapi/tests/test_flash_clipboard.cc ('K') | « ppapi/tests/test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698