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 <UIKit/UIKit.h> | 6 #import <UIKit/UIKit.h> |
7 #import <XCTest/XCTest.h> | 7 #import <XCTest/XCTest.h> |
8 | 8 |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "ios/chrome/browser/ui/ui_util.h" | 10 #include "ios/chrome/browser/ui/ui_util.h" |
11 #include "ios/chrome/grit/ios_strings.h" | 11 #include "ios/chrome/grit/ios_strings.h" |
12 #import "ios/chrome/test/app/chrome_test_util.h" | 12 #import "ios/chrome/test/app/chrome_test_util.h" |
13 #import "ios/chrome/test/app/settings_test_util.h" | 13 #import "ios/chrome/test/app/settings_test_util.h" |
14 #import "ios/chrome/test/app/tab_test_util.h" | 14 #import "ios/chrome/test/app/tab_test_util.h" |
15 #include "ios/chrome/test/app/web_view_interaction_test_util.h" | 15 #include "ios/chrome/test/app/web_view_interaction_test_util.h" |
16 #import "ios/chrome/test/earl_grey/chrome_actions.h" | 16 #import "ios/chrome/test/earl_grey/chrome_actions.h" |
17 #import "ios/chrome/test/earl_grey/chrome_assertions.h" | 17 #import "ios/chrome/test/earl_grey/chrome_assertions.h" |
18 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" | 18 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" |
19 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 19 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
20 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 20 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
21 #include "ios/chrome/test/earl_grey/chrome_util.h" | 21 #include "ios/chrome/test/earl_grey/chrome_util.h" |
22 #import "ios/testing/wait_util.h" | 22 #import "ios/testing/wait_util.h" |
23 #import "ios/web/public/test/earl_grey/web_view_matchers.h" | 23 #import "ios/web/public/test/earl_grey/web_view_matchers.h" |
24 #import "ios/web/public/test/http_server.h" | 24 #import "ios/web/public/test/http_server.h" |
25 #import "ios/web/public/test/http_server_util.h" | 25 #import "ios/web/public/test/http_server_util.h" |
26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
27 | 27 |
| 28 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 29 #error "This file requires ARC support." |
| 30 #endif |
| 31 |
28 using chrome_test_util::ButtonWithAccessibilityLabelId; | 32 using chrome_test_util::ButtonWithAccessibilityLabelId; |
29 | 33 |
30 namespace { | 34 namespace { |
31 const char kUrlChromiumLogoPage[] = | 35 const char kUrlChromiumLogoPage[] = |
32 "http://ios/testing/data/http_server_files/chromium_logo_page.html"; | 36 "http://ios/testing/data/http_server_files/chromium_logo_page.html"; |
33 const char kUrlChromiumLogoImg[] = | 37 const char kUrlChromiumLogoImg[] = |
34 "http://ios/testing/data/http_server_files/chromium_logo.png"; | 38 "http://ios/testing/data/http_server_files/chromium_logo.png"; |
35 const char kUrlInitialPage[] = "http://scenarioContextMenuOpenInNewTab"; | 39 const char kUrlInitialPage[] = "http://scenarioContextMenuOpenInNewTab"; |
36 const char kUrlDestinationPage[] = "http://destination"; | 40 const char kUrlDestinationPage[] = "http://destination"; |
37 const char kChromiumImageID[] = "chromium_image"; | 41 const char kChromiumImageID[] = "chromium_image"; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 SelectTabAtIndexInCurrentMode(1U); | 251 SelectTabAtIndexInCurrentMode(1U); |
248 | 252 |
249 // Verify url and tab count. | 253 // Verify url and tab count. |
250 [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText( | 254 [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText( |
251 destinationURL.GetContent())] | 255 destinationURL.GetContent())] |
252 assertWithMatcher:grey_notNil()]; | 256 assertWithMatcher:grey_notNil()]; |
253 chrome_test_util::AssertMainTabCount(2U); | 257 chrome_test_util::AssertMainTabCount(2U); |
254 } | 258 } |
255 | 259 |
256 @end | 260 @end |
OLD | NEW |