| 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" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Verify url and tab count. | 167 // Verify url and tab count. |
| 168 [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText( | 168 [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText( |
| 169 destinationURL.GetContent())] | 169 destinationURL.GetContent())] |
| 170 assertWithMatcher:grey_notNil()]; | 170 assertWithMatcher:grey_notNil()]; |
| 171 chrome_test_util::AssertMainTabCount(2U); | 171 chrome_test_util::AssertMainTabCount(2U); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // Tests "Open in New Tab" on context menu on a link that requires scrolling | 174 // Tests "Open in New Tab" on context menu on a link that requires scrolling |
| 175 // on the page to verify that context menu can be properly triggered in the | 175 // on the page to verify that context menu can be properly triggered in the |
| 176 // current screen view. | 176 // current screen view. |
| 177 - (void)testContextMenuOpenInNewTabFromTallPage { | 177 // TODO(crbug.com/681130): Re-enable this test on device. |
| 178 #if TARGET_IPHONE_SIMULATOR |
| 179 #define MAYBE_testContextMenuOpenInNewTabFromTallPage \ |
| 180 testContextMenuOpenInNewTabFromTallPage |
| 181 #else |
| 182 #define MAYBE_testContextMenuOpenInNewTabFromTallPage \ |
| 183 FLAKY_testContextMenuOpenInNewTabFromTallPage |
| 184 #endif |
| 185 - (void)MAYBE_testContextMenuOpenInNewTabFromTallPage { |
| 178 // Set up test simple http server. | 186 // Set up test simple http server. |
| 179 std::map<GURL, std::string> responses; | 187 std::map<GURL, std::string> responses; |
| 180 GURL initialURL = | 188 GURL initialURL = |
| 181 web::test::HttpServer::MakeUrl("http://scenarioContextMenuOpenInNewTab"); | 189 web::test::HttpServer::MakeUrl("http://scenarioContextMenuOpenInNewTab"); |
| 182 GURL destinationURL = web::test::HttpServer::MakeUrl("http://destination"); | 190 GURL destinationURL = web::test::HttpServer::MakeUrl("http://destination"); |
| 183 | 191 |
| 184 // The initial page contains a link to the destination page that is below a | 192 // The initial page contains a link to the destination page that is below a |
| 185 // really tall div so that scrolling is required. | 193 // really tall div so that scrolling is required. |
| 186 responses[initialURL] = | 194 responses[initialURL] = |
| 187 "<div style='height:4000px'></div>" | 195 "<div style='height:4000px'></div>" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 SelectTabAtIndexInCurrentMode(1U); | 239 SelectTabAtIndexInCurrentMode(1U); |
| 232 | 240 |
| 233 // Verify url and tab count. | 241 // Verify url and tab count. |
| 234 [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText( | 242 [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText( |
| 235 destinationURL.GetContent())] | 243 destinationURL.GetContent())] |
| 236 assertWithMatcher:grey_notNil()]; | 244 assertWithMatcher:grey_notNil()]; |
| 237 chrome_test_util::AssertMainTabCount(2U); | 245 chrome_test_util::AssertMainTabCount(2U); |
| 238 } | 246 } |
| 239 | 247 |
| 240 @end | 248 @end |
| OLD | NEW |