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

Side by Side Diff: webkit/glue/webkit_glue_unittest.cc

Issue 11595003: webkit: Update the calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « webkit/glue/cpp_bound_class_unittest.cc ('k') | webkit/plugins/ppapi/quota_file_io_unittest.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/glue/webkit_glue.h" 5 #include "webkit/glue/webkit_glue.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 TEST(WebkitGlueTest, SuspendResumeSharedTimer) { 100 TEST(WebkitGlueTest, SuspendResumeSharedTimer) {
101 TestWebKitPlatformSupport platform_support; 101 TestWebKitPlatformSupport platform_support;
102 102
103 // Set a timer to fire as soon as possible. 103 // Set a timer to fire as soon as possible.
104 platform_support.setSharedTimerFireInterval(0); 104 platform_support.setSharedTimerFireInterval(0);
105 // Suspend timers immediately so the above timer wouldn't be fired. 105 // Suspend timers immediately so the above timer wouldn't be fired.
106 platform_support.SuspendSharedTimer(); 106 platform_support.SuspendSharedTimer();
107 // The above timer would have posted a task which can be processed out of the 107 // The above timer would have posted a task which can be processed out of the
108 // message loop. 108 // message loop.
109 MessageLoop::current()->RunAllPending(); 109 MessageLoop::current()->RunUntilIdle();
110 // Set a mock time after 1 second to simulate timers suspended for 1 second. 110 // Set a mock time after 1 second to simulate timers suspended for 1 second.
111 double new_time = base::Time::Now().ToDoubleT() + 1; 111 double new_time = base::Time::Now().ToDoubleT() + 1;
112 platform_support.set_mock_monotonically_increasing_time(new_time); 112 platform_support.set_mock_monotonically_increasing_time(new_time);
113 // Resume timers so that the timer set above will be set again to fire 113 // Resume timers so that the timer set above will be set again to fire
114 // immediately. 114 // immediately.
115 platform_support.ResumeSharedTimer(); 115 platform_support.ResumeSharedTimer();
116 EXPECT_TRUE(base::TimeDelta() == platform_support.shared_timer_delay()); 116 EXPECT_TRUE(base::TimeDelta() == platform_support.shared_timer_delay());
117 } 117 }
118 118
119 } // namespace 119 } // namespace
OLDNEW
« no previous file with comments | « webkit/glue/cpp_bound_class_unittest.cc ('k') | webkit/plugins/ppapi/quota_file_io_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698