Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 base::mac::ScopedNSAutoreleasePool pool; | 172 base::mac::ScopedNSAutoreleasePool pool; |
| 173 NSArray *appWindows = [NSApp windows]; | 173 NSArray *appWindows = [NSApp windows]; |
| 174 for (NSWindow *window in appWindows) { | 174 for (NSWindow *window in appWindows) { |
| 175 windows.insert(window); | 175 windows.insert(window); |
| 176 } | 176 } |
| 177 return windows; | 177 return windows; |
| 178 } | 178 } |
| 179 | 179 |
| 180 std::set<NSWindow*> CocoaTest::WindowsLeft() { | 180 std::set<NSWindow*> CocoaTest::WindowsLeft() { |
| 181 const std::set<NSWindow*> windows(ApplicationWindows()); | 181 const std::set<NSWindow*> windows(ApplicationWindows()); |
| 182 std::set<NSWindow*> windows_left; | 182 std::set<NSWindow*> windows_left = |
| 183 std::set_difference(windows.begin(), windows.end(), | 183 base::STLSetDifference<NSWindow*>(windows, initial_windows); |
|
Lei Zhang
2013/08/10 08:26:10
typo
Haojian Wu
2013/08/10 09:47:29
Done.
| |
| 184 initial_windows_.begin(), initial_windows_.end(), | |
| 185 std::inserter(windows_left, windows_left.begin())); | |
| 186 return windows_left; | 184 return windows_left; |
| 187 } | 185 } |
| 188 | 186 |
| 189 CocoaTestHelperWindow* CocoaTest::test_window() { | 187 CocoaTestHelperWindow* CocoaTest::test_window() { |
| 190 if (!test_window_) { | 188 if (!test_window_) { |
| 191 test_window_ = [[CocoaTestHelperWindow alloc] init]; | 189 test_window_ = [[CocoaTestHelperWindow alloc] init]; |
| 192 if (base::debug::BeingDebugged()) { | 190 if (base::debug::BeingDebugged()) { |
| 193 [test_window_ orderFront:nil]; | 191 [test_window_ orderFront:nil]; |
| 194 } else { | 192 } else { |
| 195 [test_window_ orderBack:nil]; | 193 [test_window_ orderBack:nil]; |
| 196 } | 194 } |
| 197 } | 195 } |
| 198 return test_window_; | 196 return test_window_; |
| 199 } | 197 } |
| 200 | 198 |
| 201 } // namespace ui | 199 } // namespace ui |
| OLD | NEW |