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 | 6 |
7 #include "base/ios/ios_util.h" | 7 #include "base/ios/ios_util.h" |
8 #include "components/content_settings/core/common/content_settings.h" | 8 #include "components/content_settings/core/common/content_settings.h" |
9 #include "ios/chrome/test/app/settings_test_util.h" | 9 #include "ios/chrome/test/app/settings_test_util.h" |
10 #import "ios/chrome/test/app/tab_test_util.h" | 10 #import "ios/chrome/test/app/tab_test_util.h" |
11 #include "ios/chrome/test/app/web_view_interaction_test_util.h" | 11 #include "ios/chrome/test/app/web_view_interaction_test_util.h" |
12 #import "ios/chrome/test/earl_grey/chrome_assertions.h" | 12 #import "ios/chrome/test/earl_grey/chrome_assertions.h" |
13 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" | 13 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" |
14 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 14 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
15 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 15 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
16 #import "ios/web/public/test/http_server.h" | 16 #import "ios/web/public/test/http_server.h" |
17 #include "ios/web/public/test/http_server_util.h" | 17 #include "ios/web/public/test/http_server_util.h" |
18 | 18 |
| 19 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 20 #error "This file requires ARC support." |
| 21 #endif |
| 22 |
19 using chrome_test_util::AssertMainTabCount; | 23 using chrome_test_util::AssertMainTabCount; |
20 using chrome_test_util::TapWebViewElementWithId; | 24 using chrome_test_util::TapWebViewElementWithId; |
21 using chrome_test_util::WebViewContainingText; | 25 using chrome_test_util::WebViewContainingText; |
22 using web::test::HttpServer; | 26 using web::test::HttpServer; |
23 | 27 |
24 namespace { | 28 namespace { |
25 // Test link text and ids. | 29 // Test link text and ids. |
26 const char kNamedWindowLink[] = "openWindowWithName"; | 30 const char kNamedWindowLink[] = "openWindowWithName"; |
27 const char kUnnamedWindowLink[] = "openWindowNoName"; | 31 const char kUnnamedWindowLink[] = "openWindowNoName"; |
28 | 32 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 assertWithMatcher:grey_notNil()]; | 205 assertWithMatcher:grey_notNil()]; |
202 | 206 |
203 // Close the second opened window. Check that unnamed window 2 is closed. | 207 // Close the second opened window. Check that unnamed window 2 is closed. |
204 chrome_test_util::CloseTabAtIndex(1); | 208 chrome_test_util::CloseTabAtIndex(1); |
205 TapWebViewElementWithId(kCheckWindow2Link); | 209 TapWebViewElementWithId(kCheckWindow2Link); |
206 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kWindow2Closed)] | 210 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kWindow2Closed)] |
207 assertWithMatcher:grey_notNil()]; | 211 assertWithMatcher:grey_notNil()]; |
208 } | 212 } |
209 | 213 |
210 @end | 214 @end |
OLD | NEW |