| 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 <EarlGrey/EarlGrey.h> | 5 #import <EarlGrey/EarlGrey.h> |
| 6 #import <XCTest/XCTest.h> | 6 #import <XCTest/XCTest.h> |
| 7 | 7 |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 infobars::InfoBarManager* manager = GetCurrentInfoBarManager(); | 87 infobars::InfoBarManager* manager = GetCurrentInfoBarManager(); |
| 88 GREYAssertEqual(expected_count, manager->infobar_count(), | 88 GREYAssertEqual(expected_count, manager->infobar_count(), |
| 89 @"Incorrect number of infobars."); | 89 @"Incorrect number of infobars."); |
| 90 [[GREYCondition | 90 [[GREYCondition |
| 91 conditionWithName:condition_name | 91 conditionWithName:condition_name |
| 92 block:^BOOL { | 92 block:^BOOL { |
| 93 NSError* error = nil; | 93 NSError* error = nil; |
| 94 [[EarlGrey | 94 [[EarlGrey |
| 95 selectElementWithMatcher: | 95 selectElementWithMatcher: |
| 96 chrome_test_util::staticTextWithAccessibilityLabel( | 96 chrome_test_util::StaticTextWithAccessibilityLabel( |
| 97 base::SysUTF8ToNSString(kTestInfoBarTitle))] | 97 base::SysUTF8ToNSString(kTestInfoBarTitle))] |
| 98 assertWithMatcher:expected_visibility | 98 assertWithMatcher:expected_visibility |
| 99 error:&error]; | 99 error:&error]; |
| 100 return error == nil; | 100 return error == nil; |
| 101 }] waitWithTimeout:kTimeout]; | 101 }] waitWithTimeout:kTimeout]; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 // Tests functionality related to infobars. | 106 // Tests functionality related to infobars. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 [ChromeEarlGrey loadURL:ponyURL]; | 162 [ChromeEarlGrey loadURL:ponyURL]; |
| 163 | 163 |
| 164 // Close the first tab. Verify that there is only one tab remaining and its | 164 // Close the first tab. Verify that there is only one tab remaining and its |
| 165 // infobar is visible. | 165 // infobar is visible. |
| 166 chrome_test_util::CloseCurrentTab(); | 166 chrome_test_util::CloseCurrentTab(); |
| 167 chrome_test_util::AssertMainTabCount(1U); | 167 chrome_test_util::AssertMainTabCount(1U); |
| 168 VerifyTestInfoBarVisibleForCurrentTab(true); | 168 VerifyTestInfoBarVisibleForCurrentTab(true); |
| 169 } | 169 } |
| 170 | 170 |
| 171 @end | 171 @end |
| OLD | NEW |