Commit 93fe9294 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes URLOpenerTest.VerifyLaunchOptionsWithNoSourceApplication.

https://chromium-review.googlesource.com/c/chromium/src/+/2266476
modified this test to pass applicationActive:NO instead of YES. This
invoked a different codepath in url_opener.mm that happens to always
call |connectionInformation.startupParameters|. The test was only
registering an expectation for this call when DCHECKs were enabled,
causing a failure in Release builds.

BUG=1102032

Change-Id: I30ea62892300cf9fa1cac453149acfa08ca1c159
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315254Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791204}
parent 69d8045b
......@@ -263,15 +263,7 @@ TEST_F(URLOpenerTest, VerifyLaunchOptionsNil) {
// Tests that -handleApplication set startup parameters as expected with no
// source application.
// TODO(crbug.com/1102032): Fails on device.
#if TARGET_IPHONE_SIMULATOR
#define MAYBE_VerifyLaunchOptionsWithNoSourceApplication \
VerifyLaunchOptionsWithNoSourceApplication
#else
#define MAYBE_VerifyLaunchOptionsWithNoSourceApplication \
DISABLED_VerifyLaunchOptionsWithNoSourceApplication
#endif
TEST_F(URLOpenerTest, MAYBE_VerifyLaunchOptionsWithNoSourceApplication) {
TEST_F(URLOpenerTest, VerifyLaunchOptionsWithNoSourceApplication) {
// Setup.
NSURL* url = [NSURL URLWithString:@"chromium://www.google.com"];
NSDictionary* launchOptions = @{
......@@ -297,10 +289,7 @@ TEST_F(URLOpenerTest, MAYBE_VerifyLaunchOptionsWithNoSourceApplication) {
EXPECT_EQ(p.callerApp, CALLER_APP_NOT_AVAILABLE);
return YES;
}]];
#if DCHECK_IS_ON()
// This function is called in a DCHECK.
[[[connectionInformationMock expect] andReturn:params] startupParameters];
#endif
id appStateMock = [OCMockObject mockForClass:[AppState class]];
[[appStateMock expect] launchFromURLHandled:NO];
......
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