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

Side by Side Diff: base/test/ios/wait_util.mm

Issue 2194283002: [ios] Use SpinRunLoopWithMinDelay in MetaTagsTestCase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comment Created 4 years, 4 months 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
« no previous file with comments | « base/test/ios/wait_util.h ('k') | ios/web/shell/test/meta_tags_egtest.mm » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "base/test/ios/wait_util.h" 5 #import "base/test/ios/wait_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 WaitUntilCondition(condition, nullptr, TimeDelta()); 50 WaitUntilCondition(condition, nullptr, TimeDelta());
51 } 51 }
52 52
53 void SpinRunLoopWithMaxDelay(TimeDelta max_delay) { 53 void SpinRunLoopWithMaxDelay(TimeDelta max_delay) {
54 scoped_nsobject<NSDate> beforeDate( 54 scoped_nsobject<NSDate> beforeDate(
55 [[NSDate alloc] initWithTimeIntervalSinceNow:max_delay.InSecondsF()]); 55 [[NSDate alloc] initWithTimeIntervalSinceNow:max_delay.InSecondsF()]);
56 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode 56 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
57 beforeDate:beforeDate]; 57 beforeDate:beforeDate];
58 } 58 }
59 59
60 void SpinRunLoopWithMinDelay(TimeDelta min_delay) {
61 ElapsedTimer timer;
62 while (timer.Elapsed() < min_delay) {
63 SpinRunLoopWithMaxDelay(base::TimeDelta::FromMilliseconds(10));
64 }
65 }
66
60 } // namespace ios 67 } // namespace ios
61 } // namespace test 68 } // namespace test
62 } // namespace base 69 } // namespace base
OLDNEW
« no previous file with comments | « base/test/ios/wait_util.h ('k') | ios/web/shell/test/meta_tags_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698