Commit 838863f5 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF][EG2] Migrate Fallback JS test

Bug: 1017175, 1016367
Change-Id: I0c12c811c347a5f7981ea2985e550aad72167860
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886860
Auto-Submit: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710344}
parent cd945638
...@@ -53,15 +53,11 @@ id<GREYMatcher> ProfileTableViewButtonMatcher() { ...@@ -53,15 +53,11 @@ id<GREYMatcher> ProfileTableViewButtonMatcher() {
return grey_buttonTitle(@"Underworld"); return grey_buttonTitle(@"Underworld");
} }
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
// Polls the JavaScript query |java_script_condition| until the returned // Polls the JavaScript query |java_script_condition| until the returned
// |boolValue| is YES with a kWaitForActionTimeout timeout. // |boolValue| is YES with a kWaitForActionTimeout timeout.
BOOL WaitForJavaScriptCondition(NSString* java_script_condition) { BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
auto verify_block = ^BOOL { auto verify_block = ^BOOL {
id boolValue = id boolValue = [ChromeEarlGrey executeJavaScript:java_script_condition];
chrome_test_util::ExecuteJavaScript(java_script_condition, nil);
return [boolValue isEqual:@YES]; return [boolValue isEqual:@YES];
}; };
// NSTimeInterval timeout = base::test::ios::kWaitForActionTimeout; // NSTimeInterval timeout = base::test::ios::kWaitForActionTimeout;
...@@ -71,7 +67,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) { ...@@ -71,7 +67,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
block:verify_block]; block:verify_block];
return [condition waitWithTimeout:kWaitForActionTimeout]; return [condition waitWithTimeout:kWaitForActionTimeout];
} }
#endif
// Undocks and split the keyboard by swiping it up. Does nothing if already // Undocks and split the keyboard by swiping it up. Does nothing if already
// undocked. Some devices, like iPhone or iPad Pro, do not allow undocking or // undocked. Some devices, like iPhone or iPad Pro, do not allow undocking or
...@@ -178,9 +173,6 @@ BOOL WaitForKeyboardToAppear() { ...@@ -178,9 +173,6 @@ BOOL WaitForKeyboardToAppear() {
[super tearDown]; [super tearDown];
} }
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
// Tests that the when tapping the outside the popover on iPad, suggestions // Tests that the when tapping the outside the popover on iPad, suggestions
// continue working. // continue working.
- (void)testIPadTappingOutsidePopOverResumesSuggestionsCorrectly { - (void)testIPadTappingOutsidePopOverResumesSuggestionsCorrectly {
...@@ -225,7 +217,6 @@ BOOL WaitForKeyboardToAppear() { ...@@ -225,7 +217,6 @@ BOOL WaitForKeyboardToAppear() {
kFormElementName, name]; kFormElementName, name];
XCTAssertTrue(WaitForJavaScriptCondition(javaScriptCondition)); XCTAssertTrue(WaitForJavaScriptCondition(javaScriptCondition));
} }
#endif // CHROME_EARL_GREY_1
// Tests that the manual fallback view concedes preference to the system picker // Tests that the manual fallback view concedes preference to the system picker
// for selection elements. // for selection elements.
......
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