Commit e80b6244 authored by zhaoyangli's avatar zhaoyangli Committed by Commit Bot

[iOS] Disable eg2 tests failing on devices.

These tests are failing in downstream device builder running EG2 tests.
EG2 will run on devices in upstream main after EG1/EG2 swap. This will
prevent these builders being red after the swap.

Bug: 1046369
Change-Id: I198dce844e896e474c53a0e1e329af5768655119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135416
Commit-Queue: Zhaoyang Li <zhaoyangli@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756759}
parent ed4680be
......@@ -411,7 +411,13 @@ id<GREYMatcher> OpenInNewIncognitoTabButton() {
// Tests display and selection of 'Copy URL' in a context menu on a history
// entry.
- (void)testContextMenuCopy {
// TODO(crbug.com/1067812): Test won't pass on devices.
#if TARGET_IPHONE_SIMULATOR
#define MAYBE_testContextMenuCopy testContextMenuCopy
#else
#define MAYBE_testContextMenuCopy DISABLED_testContextMenuCopy
#endif
- (void)MAYBE_testContextMenuCopy {
ProceduralBlock clearPasteboard = ^{
[[UIPasteboard generalPasteboard] setURLs:nil];
};
......
......@@ -53,6 +53,12 @@ BOOL WaitForHistoryToDisappear() {
// Tests that the NTP is still displayed after loading an invalid URL.
- (void)testNTPStayForInvalidURL {
// TODO(crbug.com/1067813): Test won't pass on iPad device.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
[[EarlGrey selectElementWithMatcher:chrome_test_util::FakeOmnibox()]
performAction:grey_typeText(@"file://\n")];
......
......@@ -157,6 +157,12 @@ id<GREYMatcher> SearchCopiedTextButton() {
#define MAYBE_testXClientData testXClientData
#endif
- (void)MAYBE_testXClientData {
// TODO(crbug.com/1067815): Test doesn't pass on iPad device.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"testXClientData doesn't pass on iPad device.");
}
#endif
// Rewrite the google URL to localhost URL.
[OmniboxAppInterface rewriteGoogleURLToLocalhost];
......@@ -615,7 +621,13 @@ id<GREYMatcher> SearchCopiedTextButton() {
assertWithMatcher:grey_nil()];
}
- (void)testNoDefaultMatch {
// TODO(crbug.com/1067815): Test can't pass on devices.
#if TARGET_IPHONE_SIMULATOR
#define MAYBE_testNoDefaultMatch testNoDefaultMatch
#else
#define MAYBE_testNoDefaultMatch DISABLED_testNoDefaultMatch
#endif
- (void)MAYBE_testNoDefaultMatch {
NSString* copiedText = @"test no default match1";
// Put some text in pasteboard.
......
......@@ -108,6 +108,12 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
// Tests that tapping the switch to open tab button, switch to the open tab,
// doesn't close the tab.
- (void)testSwitchToOpenTab {
// TODO(crbug.com/1067817): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
// Open the first page.
GURL firstPageURL = self.testServer->GetURL(kPage1URL);
[ChromeEarlGrey loadURL:firstPageURL];
......@@ -140,6 +146,12 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
// Tests that the switch to open tab button isn't displayed for the current tab.
- (void)testNotSwitchButtonOnCurrentTab {
// TODO(crbug.com/1067817): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
GURL URL2 = self.testServer->GetURL(kPage2URL);
// Open the first page.
......@@ -257,6 +269,12 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
}
- (void)testDontCloseNTPWhenSwitchingWithForwardHistory {
// TODO(crbug.com/1067817): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
// Open the first page.
GURL URL1 = self.testServer->GetURL(kPage1URL);
[ChromeEarlGrey loadURL:URL1];
......@@ -289,6 +307,12 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
EARL_GREY_TEST_DISABLED(@"Test disabled on iPad.");
}
}
#endif
// TODO(crbug.com/1067817): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
GURL URL1 = self.testServer->GetURL(kPage1URL);
......@@ -325,6 +349,13 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
// Tests that having multiple suggestions with corresponding opened tabs display
// multiple buttons. TODO(crbug.com/1059464): Test is flaky.
- (void)DISABLED_testMultiplePageOpened {
// TODO(crbug.com/1067817): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
// Open the first page.
GURL URL1 = self.testServer->GetURL(kPage1URL);
[ChromeEarlGrey loadURL:URL1];
......
......@@ -1474,6 +1474,12 @@ void TapEdit() {
// Test that when user types text in search field, passwords and blocked
// items are filtered out and "save passwords" switch is removed.
- (void)testSearchPasswords {
// TODO(crbug.com/1067818): Test doesn't pass on iPad device.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
SaveExamplePasswordForms();
SaveExampleBlockedForms();
......
......@@ -292,6 +292,12 @@ using chrome_test_util::SystemSelectionCalloutCopyButton;
// Types JavaScript into Omnibox and verify that an alert is displayed.
- (void)testTypeJavaScriptIntoOmnibox {
// TODO(crbug.com/1067819): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
std::map<GURL, std::string> responses;
GURL URL = web::test::HttpServer::MakeUrl("http://foo");
responses[URL] = "bar";
......@@ -308,6 +314,12 @@ using chrome_test_util::SystemSelectionCalloutCopyButton;
// not displayed. WebUI pages have elevated privileges and should not allow
// script execution.
- (void)testTypeJavaScriptIntoOmniboxWithWebUIPage {
// TODO(crbug.com/1067819): Test won't pass on iPad devices.
#if !TARGET_IPHONE_SIMULATOR
if ([ChromeEarlGrey isIPadIdiom]) {
EARL_GREY_TEST_SKIPPED(@"This test doesn't pass on iPad device.");
}
#endif
[ChromeEarlGrey loadURL:GURL("chrome://version")];
[ChromeEarlGreyUI focusOmniboxAndType:@"javascript:alert('Hello');\n"];
......
......@@ -220,7 +220,9 @@ std::unique_ptr<net::test_server::HttpResponse> CountResponse(
}
- (void)triggerRestore {
#if defined(CHROME_EARL_GREY_1)
// TODO(crbug.com/1067821):|AppLaunchManager| relaunching with
// |ForceRelaunchByCleanShutdown| policy won't work in EG1 or on real device.
#if defined(CHROME_EARL_GREY_1) || !TARGET_IPHONE_SIMULATOR
[ChromeEarlGrey triggerRestoreViaTabGridRemoveAllUndo];
#elif defined(CHROME_EARL_GREY_2)
[ChromeEarlGrey saveSessionImmediately];
......
......@@ -250,12 +250,16 @@
// Tests gracefully kill through AppLaunchManager.
- (void)testAppLaunchManagerForceRelaunchByCleanShutdown {
// TODO(crbug.com/1067821): ForceRelaunchByCleanShutdown only compiles and works
// on simulator.
#if TARGET_IPHONE_SIMULATOR
[ChromeEarlGrey openNewTab];
[[AppLaunchManager sharedManager] ensureAppLaunchedWithFeaturesEnabled:{}
disabled:{}
relaunchPolicy:ForceRelaunchByCleanShutdown];
[[EarlGrey selectElementWithMatcher:grey_text(@"Restore")]
assertWithMatcher:grey_notVisible()];
#endif
}
// Tests hard kill(crash) through AppLaunchManager.
......
......@@ -23,9 +23,13 @@ typedef NS_ENUM(NSInteger, RelaunchPolicy) {
// Forces a relaunch. Kills the app directly. Keeps app state the same as
// before relaunch.
ForceRelaunchByKilling,
// TODO(crbug.com/1067821): This relaunch policy will cause failures in real
// devices.
#if TARGET_IPHONE_SIMULATOR
// Forces a relaunch. Backgrounds and then kills the app. Keeps app state same
// as before relaunch.
ForceRelaunchByCleanShutdown,
#endif
};
// Configuration for launching the app in EGTests.
......
......@@ -72,9 +72,16 @@ bool LaunchArgumentsAreEqual(NSArray<NSString*>* args1,
- (void)ensureAppLaunchedWithArgs:(NSArray<NSString*>*)arguments
relaunchPolicy:(RelaunchPolicy)relaunchPolicy {
#if defined(CHROME_EARL_GREY_2)
// TODO(crbug.com/1067821): ForceRelaunchByCleanShutdown doesn't compile on
// real devices.
#if TARGET_IPHONE_SIMULATOR
BOOL forceRestart = (relaunchPolicy == ForceRelaunchByKilling) ||
(relaunchPolicy == ForceRelaunchByCleanShutdown);
BOOL gracefullyKill = (relaunchPolicy == ForceRelaunchByCleanShutdown);
#else
BOOL forceRestart = (relaunchPolicy == ForceRelaunchByKilling);
BOOL gracefullyKill = NO;
#endif // TARGET_IPHONE_SIMULATOR
BOOL runResets = (relaunchPolicy == NoForceRelaunchAndResetState);
// If app has crashed, |self.runningApplication| will be at
......@@ -116,7 +123,7 @@ bool LaunchArgumentsAreEqual(NSArray<NSString*>* args1,
}
self.runningApplication = application;
self.currentLaunchArgs = arguments;
#endif
#endif // defined(CHROME_EARL_GREY_2)
}
- (void)ensureAppLaunchedWithConfiguration:
......
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