| 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 #include "ios/chrome/test/earl_grey/chrome_util.h" | 5 #include "ios/chrome/test/earl_grey/chrome_util.h" |
| 6 | 6 |
| 7 #import <EarlGrey/EarlGrey.h> | 7 #import <EarlGrey/EarlGrey.h> |
| 8 | 8 |
| 9 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" | 9 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" |
| 10 #import "ios/chrome/test/app/chrome_test_util.h" | 10 #import "ios/chrome/test/app/chrome_test_util.h" |
| 11 #import "ios/testing/wait_util.h" | 11 #import "ios/testing/wait_util.h" |
| 12 #import "ios/web/public/test/earl_grey/web_view_matchers.h" | 12 #import "ios/web/public/test/earl_grey/web_view_matchers.h" |
| 13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
| 14 namespace { | 18 namespace { |
| 15 const NSTimeInterval kWaitForToolbarAnimationTimeout = 1.0; | 19 const NSTimeInterval kWaitForToolbarAnimationTimeout = 1.0; |
| 16 } // namespace | 20 } // namespace |
| 17 | 21 |
| 18 namespace chrome_test_util { | 22 namespace chrome_test_util { |
| 19 | 23 |
| 20 void AssertToolbarNotVisible() { | 24 void AssertToolbarNotVisible() { |
| 21 ConditionBlock condition = ^{ | 25 ConditionBlock condition = ^{ |
| 22 id<GREYMatcher> toolsMenuButton = | 26 id<GREYMatcher> toolsMenuButton = |
| 23 grey_allOf(grey_accessibilityID(kToolbarToolsMenuButtonIdentifier), | 27 grey_allOf(grey_accessibilityID(kToolbarToolsMenuButtonIdentifier), |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 assertWithMatcher:grey_notNil() | 47 assertWithMatcher:grey_notNil() |
| 44 error:&error]; | 48 error:&error]; |
| 45 return error == nil; | 49 return error == nil; |
| 46 }; | 50 }; |
| 47 GREYAssert(testing::WaitUntilConditionOrTimeout( | 51 GREYAssert(testing::WaitUntilConditionOrTimeout( |
| 48 kWaitForToolbarAnimationTimeout, condition), | 52 kWaitForToolbarAnimationTimeout, condition), |
| 49 @"The toolbar is not visible."); | 53 @"The toolbar is not visible."); |
| 50 } | 54 } |
| 51 | 55 |
| 52 } // namespace chrome_test_util | 56 } // namespace chrome_test_util |
| OLD | NEW |