Commit 54f2cc5f authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] expose enableMockAuthentication for EG2 tests.

In EG2 a test that calls disableMockAuthentication must
re-eable on tearDown, or the app_interface can crash from
mismatch enable/disable.

Change-Id: I06c0a2feebb43cf1bcaa9b639a7a29deafa03094
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1953731Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: David Jean <djean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723300}
parent 8e884981
......@@ -37,6 +37,9 @@ class EmbeddedTestServer;
// end of the test. This shall only be called once per test.
- (void)disableMockAuthentication;
// Turns mock authentication back on.
- (void)enableMockAuthentication;
// Stops the HTTP server. It will be re-started at the end of the test. This
// should only be called when the HTTP server is running. This shall only be
// called once per test.
......
......@@ -307,6 +307,13 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeTestCaseAppInterface)
_isMockAuthenticationDisabled = YES;
}
- (void)enableMockAuthentication {
// Enforce that enableMockAuthentication can only be called once.
DCHECK(_isMockAuthenticationDisabled);
[[self class] enableMockAuthentication];
_isMockAuthenticationDisabled = NO;
}
- (void)stopHTTPServer {
// Enforce that the HTTP server can only be stopped once per test. It should
// not be stopped if it is not running.
......
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