Run V8 in predictable mode for pdfium_test
authorJochen Eisinger <jochen@chromium.org>
Fri, 29 May 2015 08:22:32 +0000 (10:22 +0200)
committerJochen Eisinger <jochen@chromium.org>
Fri, 29 May 2015 08:22:32 +0000 (10:22 +0200)
This won't post tasks to the background threads

BUG=none
R=kcc@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1157123003

samples/pdfium_test.cc
testing/embedder_test.cpp

index a91e132..d5bf3c0 100644 (file)
@@ -582,6 +582,9 @@ int main(int argc, const char* argv[]) {
   v8::Platform* platform = v8::platform::CreateDefaultPlatform();
   v8::V8::InitializePlatform(platform);
   v8::V8::Initialize();
+  // By enabling predicatble mode, V8 won't post any background tasks.
+  const char predictable_flag[] = "--predictable";
+  v8::V8::SetFlagsFromString(predictable_flag, strlen(predictable_flag));
 
 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
   v8::StartupData natives;
index 9b21609..70c32af 100644 (file)
@@ -193,6 +193,9 @@ EmbedderTest::~EmbedderTest() {
 
 void EmbedderTest::SetUp() {
     v8::V8::InitializeICU();
+    // By enabling predicatble mode, V8 won't post any background tasks.
+    const char predictable_flag[] = "--predictable";
+    v8::V8::SetFlagsFromString(predictable_flag, strlen(predictable_flag));
 
 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
     ASSERT_TRUE(GetExternalData(g_exe_path_, "natives_blob.bin", &natives_));