Commit efad31ae authored by sczs's avatar sczs Committed by Commit Bot

[ios] Disables Legacy NTP Feed Tests if Discover is enabled.

Bug: 1085419
Change-Id: I1bcc74618fa1f0716643f0979ac1f27a7b2d627c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352429
Auto-Submit: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797714}
parent d197e7fd
...@@ -283,6 +283,7 @@ source_set("eg2_tests") { ...@@ -283,6 +283,7 @@ source_set("eg2_tests") {
":constants", ":constants",
":content_suggestions_constant", ":content_suggestions_constant",
":eg_test_support+eg2", ":eg_test_support+eg2",
":feature_flags",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//components/strings", "//components/strings",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_app_interface.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_app_interface.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
#import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h" #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
...@@ -141,6 +142,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) { ...@@ -141,6 +142,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
// Tests that the additional items (when more is pressed) are kept when // Tests that the additional items (when more is pressed) are kept when
// switching tabs. // switching tabs.
- (void)testAdditionalItemsKept { - (void)testAdditionalItemsKept {
if (IsDiscoverFeedEnabled()) {
EARL_GREY_TEST_DISABLED(@"Legacy Feed Test.");
}
// Set server up. // Set server up.
self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse)); self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse));
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start.");
...@@ -175,6 +179,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) { ...@@ -175,6 +179,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
// Tests that when the page is reloaded using the tools menu, the suggestions // Tests that when the page is reloaded using the tools menu, the suggestions
// are updated. // are updated.
- (void)testReloadPage { - (void)testReloadPage {
if (IsDiscoverFeedEnabled()) {
EARL_GREY_TEST_DISABLED(@"Legacy Feed Test.");
}
// Add 2 suggestions, persisted accross page loads. // Add 2 suggestions, persisted accross page loads.
[ContentSuggestionsAppInterface addNumberOfSuggestions:2 [ContentSuggestionsAppInterface addNumberOfSuggestions:2
additionalSuggestionsURL:nil]; additionalSuggestionsURL:nil];
...@@ -200,6 +207,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) { ...@@ -200,6 +207,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
// disposition of the collection takes into account the previous scroll, even // disposition of the collection takes into account the previous scroll, even
// when more is tapped. // when more is tapped.
- (void)testOpenPageAndGoBackWithMoreContent { - (void)testOpenPageAndGoBackWithMoreContent {
if (IsDiscoverFeedEnabled()) {
EARL_GREY_TEST_DISABLED(@"Legacy Feed Test.");
}
// Set server up. // Set server up.
self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse)); self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse));
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start.");
...@@ -248,6 +258,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) { ...@@ -248,6 +258,9 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
// Tests that the "Learn More" cell is present only if there is a suggestion in // Tests that the "Learn More" cell is present only if there is a suggestion in
// the section. // the section.
- (void)testLearnMore { - (void)testLearnMore {
if (IsDiscoverFeedEnabled()) {
EARL_GREY_TEST_DISABLED(@"Legacy Feed Test.");
}
id<GREYAction> action = id<GREYAction> action =
grey_scrollInDirectionWithStartPoint(kGREYDirectionDown, 200, 0.5, 0.5); grey_scrollInDirectionWithStartPoint(kGREYDirectionDown, 200, 0.5, 0.5);
[[[EarlGrey [[[EarlGrey
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment