| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/test/app/tab_test_util.h" | 5 #import "ios/chrome/test/app/tab_test_util.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 [tab.webController handleLowMemory]; | 153 [tab.webController handleLowMemory]; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 void CloseAllIncognitoTabs() { | 157 void CloseAllIncognitoTabs() { |
| 158 MainController* main_controller = chrome_test_util::GetMainController(); | 158 MainController* main_controller = chrome_test_util::GetMainController(); |
| 159 DCHECK(main_controller); | 159 DCHECK(main_controller); |
| 160 TabModel* tabModel = [[main_controller browserViewInformation] otrTabModel]; | 160 TabModel* tabModel = [[main_controller browserViewInformation] otrTabModel]; |
| 161 DCHECK(tabModel); | 161 DCHECK(tabModel); |
| 162 [tabModel closeAllTabs]; | 162 [tabModel closeAllTabs]; |
| 163 if (!IsIPadIdiom() || !experimental_flags::IsTabSwitcherEnabled()) { | 163 if (!IsIPadIdiom()) { |
| 164 // If the OTR BVC is active, wait until it isn't (since all of the | 164 // If the OTR BVC is active, wait until it isn't (since all of the |
| 165 // tabs are now closed) | 165 // tabs are now closed) |
| 166 testing::WaitUntilConditionOrTimeout(testing::kWaitForUIElementTimeout, ^{ | 166 testing::WaitUntilConditionOrTimeout(testing::kWaitForUIElementTimeout, ^{ |
| 167 return !IsIncognitoMode(); | 167 return !IsIncognitoMode(); |
| 168 }); | 168 }); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 TabView* GetTabViewForTab(Tab* tab) { | 172 TabView* GetTabViewForTab(Tab* tab) { |
| 173 MainController* main_controller = GetMainController(); | 173 MainController* main_controller = GetMainController(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 184 return [[GetMainController() browserViewInformation] mainTabModel] | 184 return [[GetMainController() browserViewInformation] mainTabModel] |
| 185 .tabUsageRecorder->EvictedTabsMapSize(); | 185 .tabUsageRecorder->EvictedTabsMapSize(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 FormInputAccessoryViewController* GetInputAccessoryViewController() { | 188 FormInputAccessoryViewController* GetInputAccessoryViewController() { |
| 189 Tab* current_tab = GetCurrentTab(); | 189 Tab* current_tab = GetCurrentTab(); |
| 190 return [current_tab inputAccessoryViewController]; | 190 return [current_tab inputAccessoryViewController]; |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace chrome_test_util | 193 } // namespace chrome_test_util |
| OLD | NEW |