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

Side by Side Diff: chrome/browser/ui/cocoa/cocoa_test_helper.mm

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/ui/cocoa/cocoa_test_helper.h" 5 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
6 6
7 #include "base/debug/debugger.h" 7 #include "base/debug/debugger.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // one to two spins through the event loop to see a change. 104 // one to two spins through the event loop to see a change.
105 105
106 // NOTE(shess): Under valgrind, -nextEventMatchingMask:* in one test 106 // NOTE(shess): Under valgrind, -nextEventMatchingMask:* in one test
107 // needed to run twice, once taking .2 seconds, the next time .6 107 // needed to run twice, once taking .2 seconds, the next time .6
108 // seconds. The loop exit condition attempts to be scalable. 108 // seconds. The loop exit condition attempts to be scalable.
109 109
110 // Get the set of windows which weren't present when the test 110 // Get the set of windows which weren't present when the test
111 // started. 111 // started.
112 std::set<NSWindow*> windows_left(WindowsLeft()); 112 std::set<NSWindow*> windows_left(WindowsLeft());
113 113
114 while (windows_left.size() > 0) { 114 while (!windows_left.empty()) {
115 // Cover delayed actions by spinning the loop at least once after 115 // Cover delayed actions by spinning the loop at least once after
116 // this timeout. 116 // this timeout.
117 const NSTimeInterval kCloseTimeoutSeconds = 117 const NSTimeInterval kCloseTimeoutSeconds =
118 TestTimeouts::action_timeout_ms() / 1000.0; 118 TestTimeouts::action_timeout_ms() / 1000.0;
119 119
120 // Cover chains of delayed actions by spinning the loop at least 120 // Cover chains of delayed actions by spinning the loop at least
121 // this many times. 121 // this many times.
122 const int kCloseSpins = 3; 122 const int kCloseSpins = 3;
123 123
124 // Track the set of remaining windows so that everything can be 124 // Track the set of remaining windows so that everything can be
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (!test_window_) { 198 if (!test_window_) {
199 test_window_ = [[CocoaTestHelperWindow alloc] init]; 199 test_window_ = [[CocoaTestHelperWindow alloc] init];
200 if (base::debug::BeingDebugged()) { 200 if (base::debug::BeingDebugged()) {
201 [test_window_ orderFront:nil]; 201 [test_window_ orderFront:nil];
202 } else { 202 } else {
203 [test_window_ orderBack:nil]; 203 [test_window_ orderBack:nil];
204 } 204 }
205 } 205 }
206 return test_window_; 206 return test_window_;
207 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/clear_browsing_data_controller.mm ('k') | chrome/browser/ui/cocoa/task_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698