Commit c042bed8 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Fix testSucessfullDownload for iOS 12.

Updated the code to wait until Open in.. button shows up.

Bug: 852532
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I6f40e5fa401d8dc600cef4b43ab12b471ac1ae75
Reviewed-on: https://chromium-review.googlesource.com/1101305
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567350}
parent b7a93769
......@@ -9,6 +9,7 @@
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/testing/wait_util.h"
#include "ios/web/public/features.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
......@@ -78,8 +79,17 @@ std::unique_ptr<net::test_server::HttpResponse> GetResponse(
[[EarlGrey selectElementWithMatcher:DownloadButton()]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:OpenInButton()]
assertWithMatcher:grey_notNil()];
// Wait until Open in... button is shown.
ConditionBlock openInShown = ^{
NSError* error = nil;
[[EarlGrey selectElementWithMatcher:OpenInButton()]
assertWithMatcher:grey_notNil()
error:&error];
return (error == nil);
};
GREYAssert(testing::WaitUntilConditionOrTimeout(
testing::kWaitForDownloadTimeout, openInShown),
@"Open in... button did not show up");
}
// Tests cancelling download UI.
......
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