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

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

TBR=eugenebut@chromium.org

Bug: 1016368,   1016367
Change-Id: Id1596414616fc839472a85c1a7db1b66a717acd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886899
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Auto-Submit: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710346}
parent 1e7c2506
......@@ -46,12 +46,7 @@ const char kFormElementPassword[] = "password";
const char kExampleUsername[] = "concrete username";
const char kFormHTMLFile[] = "/username_password_field_form.html";
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
const char kIFrameHTMLFile[] = "/iframe_form.html";
#endif // CHROME_EARL_GREY_1
// Returns a matcher for the example username in the list.
id<GREYMatcher> UsernameButtonMatcher() {
......@@ -64,14 +59,11 @@ id<GREYMatcher> NotSecureWebsiteAlert() {
IDS_IOS_MANUAL_FALLBACK_NOT_SECURE_TITLE);
}
// 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
// |boolValue| is YES with a kWaitForActionTimeout timeout.
BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
auto verify_block = ^BOOL {
id value = chrome_test_util::ExecuteJavaScript(java_script_condition, nil);
id value = [ChromeEarlGrey executeJavaScript:java_script_condition];
return [value isEqual:@YES];
};
NSTimeInterval timeout = base::test::ios::kWaitForActionTimeout;
......@@ -81,7 +73,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
[GREYCondition conditionWithName:condition_name block:verify_block];
return [condition waitWithTimeout:timeout];
}
#endif // CHROME_EARL_GREY_1
} // namespace
......@@ -498,9 +489,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
assertWithMatcher:grey_sufficientlyVisible()];
}
// TODO(crbug.com/1016367): Remove the guard of this test when ExecuteJavaScript
// util is updated for EG2.
#if defined(CHROME_EARL_GREY_1)
// Tests that content is injected in iframe messaging.
- (void)testPasswordControllerSupportsIFrameMessaging {
const GURL URL = self.testServer->GetURL(kIFrameHTMLFile);
......@@ -536,7 +524,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
kFormElementUsername, kExampleUsername];
XCTAssertTrue(WaitForJavaScriptCondition(javaScriptCondition));
}
#endif // CHROME_EARL_GREY_1
// Tests that an alert is shown when trying to fill a password in an unsecure
// field.
......
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