Commit bbfa4906 authored by zhaoyangli's avatar zhaoyangli Committed by Commit Bot

[iOS][EG2] Build multitasking host app and create EG2 suite.

Built a special EG2 host app target with the test application delegate.
Adapted chrome_test_case test filtering logic to EG2.
Created the EG2 suite.

Bug: 1093981
Change-Id: Ie210dd9ad55c1e3cda57ef25e43c4f0bd7d35277
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2243583Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Zhaoyang Li <zhaoyangli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778906}
parent 925acf7e
...@@ -312,6 +312,20 @@ source_set("main") { ...@@ -312,6 +312,20 @@ source_set("main") {
} }
} }
source_set("multitasking_test_app_delegate") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"multitasking_test_application_delegate.h",
"multitasking_test_application_delegate.mm",
]
deps = [
":app_internal",
"//base",
"//ios/chrome/app/application_delegate:application_delegate_internal",
"//ios/third_party/material_components_ios",
]
}
ios_app_bundle("chrome") { ios_app_bundle("chrome") {
output_name = chromium_short_name output_name = chromium_short_name
......
...@@ -121,16 +121,11 @@ chrome_ios_eg_test("ios_chrome_web_egtests") { ...@@ -121,16 +121,11 @@ chrome_ios_eg_test("ios_chrome_web_egtests") {
} }
chrome_ios_eg_test("ios_chrome_multitasking_egtests") { chrome_ios_eg_test("ios_chrome_multitasking_egtests") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"//ios/chrome/app/multitasking_test_application_delegate.h",
"//ios/chrome/app/multitasking_test_application_delegate.mm",
]
deps = [ deps = [
":test_support", ":test_support",
"//base", "//base",
"//ios/chrome/app:app_internal", "//ios/chrome/app:app_internal",
"//ios/chrome/app:multitasking_test_app_delegate",
"//ios/chrome/app/application_delegate:application_delegate_internal", "//ios/chrome/app/application_delegate:application_delegate_internal",
# Depends on all EarlGrey test suites to create multitasking tests suite. # Depends on all EarlGrey test suites to create multitasking tests suite.
......
...@@ -27,8 +27,17 @@ namespace { ...@@ -27,8 +27,17 @@ namespace {
// case. // case.
bool gExecutedSetUpForTestCase = false; bool gExecutedSetUpForTestCase = false;
#if defined(CHROME_EARL_GREY_1)
NSString* const kFlakyEarlGreyTestTargetSuffix = @"_flaky_egtests"; NSString* const kFlakyEarlGreyTestTargetSuffix = @"_flaky_egtests";
NSString* const kFlakyEarlGrey2TestTargetSuffix = @"_flaky_eg2tests_module"; NSString* const kMultitaskingEarlGreyTestTargetName =
@"ios_chrome_multitasking_egtests";
#elif defined(CHROME_EARL_GREY_2)
NSString* const kFlakyEarlGreyTestTargetSuffix = @"_flaky_eg2tests_module";
NSString* const kMultitaskingEarlGreyTestTargetName =
@"ios_chrome_multitasking_eg2tests_module";
#else
#error Must define either CHROME_EARL_GREY_1 or CHROME_EARL_GREY_2.
#endif
// Contains a list of test names that run in multitasking test suite. // Contains a list of test names that run in multitasking test suite.
NSArray* multitaskingTests = @[ NSArray* multitaskingTests = @[
...@@ -177,11 +186,10 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeTestCaseAppInterface) ...@@ -177,11 +186,10 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeTestCaseAppInterface)
// Return specific list of tests based on the target. // Return specific list of tests based on the target.
NSString* targetName = [NSBundle mainBundle].infoDictionary[@"CFBundleName"]; NSString* targetName = [NSBundle mainBundle].infoDictionary[@"CFBundleName"];
if ([targetName hasSuffix:kFlakyEarlGreyTestTargetSuffix] || if ([targetName hasSuffix:kFlakyEarlGreyTestTargetSuffix]) {
[targetName hasSuffix:kFlakyEarlGrey2TestTargetSuffix]) {
// Only run FLAKY_ tests for flaky test suites. // Only run FLAKY_ tests for flaky test suites.
return [self flakyTestNames]; return [self flakyTestNames];
} else if ([targetName isEqualToString:@"ios_chrome_multitasking_egtests"]) { } else if ([targetName isEqualToString:kMultitaskingEarlGreyTestTargetName]) {
// Only run white listed tests for the multitasking test suite. // Only run white listed tests for the multitasking test suite.
return [self multitaskingTestNames]; return [self multitaskingTestNames];
} else { } else {
......
...@@ -15,6 +15,7 @@ group("all_tests") { ...@@ -15,6 +15,7 @@ group("all_tests") {
":ios_chrome_eg2tests", ":ios_chrome_eg2tests",
":ios_chrome_flaky_eg2tests_module", ":ios_chrome_flaky_eg2tests_module",
":ios_chrome_integration_eg2tests_module", ":ios_chrome_integration_eg2tests_module",
":ios_chrome_multitasking_eg2tests_module",
":ios_chrome_settings_eg2tests_module", ":ios_chrome_settings_eg2tests_module",
":ios_chrome_signin_eg2tests_module", ":ios_chrome_signin_eg2tests_module",
":ios_chrome_smoke_eg2tests_module", ":ios_chrome_smoke_eg2tests_module",
...@@ -26,6 +27,11 @@ group("all_tests") { ...@@ -26,6 +27,11 @@ group("all_tests") {
chrome_ios_eg2_test_app_host("ios_chrome_eg2tests") { chrome_ios_eg2_test_app_host("ios_chrome_eg2tests") {
} }
chrome_ios_eg2_test_app_host("ios_chrome_multitasking_eg2tests") {
deps = [ "//ios/chrome/app:multitasking_test_app_delegate" ]
eg_main_application_delegate = "MultitaskingTestApplicationDelegate"
}
chrome_ios_eg2_test("ios_chrome_autofill_automation_eg2tests_module") { chrome_ios_eg2_test("ios_chrome_autofill_automation_eg2tests_module") {
xcode_test_application_name = "ios_chrome_eg2tests" xcode_test_application_name = "ios_chrome_eg2tests"
...@@ -87,6 +93,21 @@ chrome_ios_eg2_test("ios_chrome_integration_eg2tests_module") { ...@@ -87,6 +93,21 @@ chrome_ios_eg2_test("ios_chrome_integration_eg2tests_module") {
data_deps = [ ":ios_chrome_eg2tests" ] data_deps = [ ":ios_chrome_eg2tests" ]
} }
chrome_ios_eg2_test("ios_chrome_multitasking_eg2tests_module") {
xcode_test_application_name = "ios_chrome_multitasking_eg2tests"
deps = [
":ios_chrome_bookmarks_eg2tests_module_deps_group",
":ios_chrome_integration_eg2tests_module_deps_group",
":ios_chrome_settings_eg2tests_module_deps_group",
":ios_chrome_signin_eg2tests_module_deps_group",
":ios_chrome_smoke_eg2tests_module_deps_group",
":ios_chrome_ui_eg2tests_module_deps_group",
":ios_chrome_web_eg2tests_module_deps_group",
]
data_deps = [ ":ios_chrome_multitasking_eg2tests" ]
}
chrome_ios_eg2_test("ios_chrome_smoke_eg2tests_module") { chrome_ios_eg2_test("ios_chrome_smoke_eg2tests_module") {
xcode_test_application_name = "ios_chrome_eg2tests" xcode_test_application_name = "ios_chrome_eg2tests"
......
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