| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/test/ui_cocoa_test_helper.h" | 5 #import "ui/base/test/ui_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/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // seconds. The loop exit condition attempts to be scalable. | 100 // seconds. The loop exit condition attempts to be scalable. |
| 101 | 101 |
| 102 // Get the set of windows which weren't present when the test | 102 // Get the set of windows which weren't present when the test |
| 103 // started. | 103 // started. |
| 104 std::set<NSWindow*> windows_left(WindowsLeft()); | 104 std::set<NSWindow*> windows_left(WindowsLeft()); |
| 105 | 105 |
| 106 while (!windows_left.empty()) { | 106 while (!windows_left.empty()) { |
| 107 // Cover delayed actions by spinning the loop at least once after | 107 // Cover delayed actions by spinning the loop at least once after |
| 108 // this timeout. | 108 // this timeout. |
| 109 const NSTimeInterval kCloseTimeoutSeconds = | 109 const NSTimeInterval kCloseTimeoutSeconds = |
| 110 TestTimeouts::action_timeout_ms() / 1000.0; | 110 TestTimeouts::action_timeout().InSecondsF(); |
| 111 | 111 |
| 112 // Cover chains of delayed actions by spinning the loop at least | 112 // Cover chains of delayed actions by spinning the loop at least |
| 113 // this many times. | 113 // this many times. |
| 114 const int kCloseSpins = 3; | 114 const int kCloseSpins = 3; |
| 115 | 115 |
| 116 // Track the set of remaining windows so that everything can be | 116 // Track the set of remaining windows so that everything can be |
| 117 // reset if progress is made. | 117 // reset if progress is made. |
| 118 std::set<NSWindow*> still_left = windows_left; | 118 std::set<NSWindow*> still_left = windows_left; |
| 119 | 119 |
| 120 NSDate* start_date = [NSDate date]; | 120 NSDate* start_date = [NSDate date]; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (base::debug::BeingDebugged()) { | 192 if (base::debug::BeingDebugged()) { |
| 193 [test_window_ orderFront:nil]; | 193 [test_window_ orderFront:nil]; |
| 194 } else { | 194 } else { |
| 195 [test_window_ orderBack:nil]; | 195 [test_window_ orderBack:nil]; |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 return test_window_; | 198 return test_window_; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace ui | 201 } // namespace ui |
| OLD | NEW |