Commit 11783bdb authored by Nika Layzell's avatar Nika Layzell
Browse files

Bug 1745116 - Make TestThreadMetrics check against how much time was actually spent, r=smaug

parent bc80bc67
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -173,14 +173,12 @@ class ThreadMetrics : public ::testing::Test {
  uint32_t mDispatchCount;
};

// Disabled on Windows x64 due to high failure rate in bug 1745116
#if !defined(_WIN64)
TEST_F(ThreadMetrics, CollectMetrics) {
  nsresult rv;
  initScheduler();

  // Dispatching a runnable that will last for +50ms
  nsCOMPtr<nsIRunnable> runnable = new TimedRunnable(25, 25);
  RefPtr<TimedRunnable> runnable = new TimedRunnable(25, 25);
  rv = Dispatch(runnable);
  ASSERT_TRUE(NS_SUCCEEDED(rv));

@@ -199,9 +197,8 @@ TEST_F(ThreadMetrics, CollectMetrics) {

  // Did we get incremented in the docgroup ?
  uint64_t duration = mCounter->GetExecutionDuration();
  ASSERT_GE(duration, 50000u);
  ASSERT_GE(duration, runnable->TotalSlept());
}
#endif

TEST_F(ThreadMetrics, CollectRecursiveMetrics) {
  nsresult rv;