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

Side by Side Diff: base/idletimer_unittest.cc

Issue 8632: Disable flaky test IdleTimerTest.RepeatIdleReset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/idle_timer.h" 5 #include "base/idle_timer.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using base::Time; 9 using base::Time;
10 using base::TimeDelta; 10 using base::TimeDelta;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 test_task.Start(); 166 test_task.Start();
167 MessageLoop::current()->Run(); 167 MessageLoop::current()->Run();
168 168
169 // In a perfect world, the idle_counter should be 10. However, 169 // In a perfect world, the idle_counter should be 10. However,
170 // since timers aren't guaranteed to fire perfectly, this can 170 // since timers aren't guaranteed to fire perfectly, this can
171 // be less. Just expect more than 5 and no more than 10. 171 // be less. Just expect more than 5 and no more than 10.
172 EXPECT_GT(test_task.get_idle_counter(), 5); 172 EXPECT_GT(test_task.get_idle_counter(), 5);
173 EXPECT_LE(test_task.get_idle_counter(), 10); 173 EXPECT_LE(test_task.get_idle_counter(), 10);
174 } 174 }
175 175
176 TEST_F(IdleTimerTest, RepeatIdleReset) { 176 // TODO(darin): http://code.google.com/p/chromium/issues/detail?id=3780
177 TEST_F(IdleTimerTest, DISABLED_RepeatIdleReset) {
177 // Create an IdleTimer, which should fire repeatedly after 100ms. 178 // Create an IdleTimer, which should fire repeatedly after 100ms.
178 // Create a Quit timer which will fire after 1s. 179 // Create a Quit timer which will fire after 1s.
179 // Create a reset timer, which fires after 550ms 180 // Create a reset timer, which fires after 550ms
180 // Verify that we fired 9 times. 181 // Verify that we fired 9 times.
181 mock_timer_started = Time::Now(); 182 mock_timer_started = Time::Now();
182 TestIdleTask test_task(true); 183 TestIdleTask test_task(true);
183 184
184 ResetIdleTask reset_task; 185 ResetIdleTask reset_task;
185 TestFinishedTask finish_task; 186 TestFinishedTask finish_task;
186 187
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 225
225 test_task.Start(); 226 test_task.Start();
226 MessageLoop::current()->Run(); 227 MessageLoop::current()->Run();
227 228
228 reset_timer.Stop(); 229 reset_timer.Stop();
229 230
230 EXPECT_EQ(test_task.get_idle_counter(), 0); 231 EXPECT_EQ(test_task.get_idle_counter(), 0);
231 } 232 }
232 233
233 } // namespace 234 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698