Commit 99296852 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

Run unified consent tests on the bot ios-simulator-full-configs.

This CL runs the ios_chrome_unified_consent_egtests set of tests on
the iOS CQ and main waterfall. These tests were already run on the
downstream bots, but it makes more sense to run them on the Chromium
waterfall as it depend only on public code.

Bug: 960260
Change-Id: Ia396cef6109437e3f20176e7ba739d2581deaea8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1599011
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarYuly Novikov <ynovikov@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659015}
parent 9630e67a
......@@ -41,6 +41,10 @@
"app": "ios_showcase_egtests",
"xctest": true,
"xcode parallelization": true
},
{
"app": "ios_chrome_unified_consent_egtests",
"xctest": true
}
]
}
......
......@@ -117,6 +117,7 @@ source_set("unified_consent_eg_tests") {
"//base",
"//base/test:test_support",
"//components/prefs",
"//components/unified_consent",
"//ios/chrome/app:app_internal",
"//ios/chrome/app/strings:ios_chromium_strings_grit",
"//ios/chrome/app/strings:ios_strings_grit",
......
......@@ -6,6 +6,7 @@
#import <XCTest/XCTest.h>
#include "components/prefs/pref_service.h"
#include "components/unified_consent/feature.h"
#import "ios/chrome/app/main_controller.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/tabs/tab_model.h"
......@@ -63,6 +64,13 @@ TabModel* GetNormalTabModel() {
@implementation GoogleServicesSettingsTestCase
- (void)setUp {
[super setUp];
CHECK(unified_consent::IsUnifiedConsentFeatureEnabled())
<< "This test suite must be run with Unified Consent feature enabled.";
}
// Opens the Google services settings view, and closes it.
- (void)testOpenGoogleServicesSettings {
[self openGoogleServicesSettings];
......
......@@ -76,3 +76,16 @@ source_set("unity_eg_tests") {
]
libs = [ "XCTest.framework" ]
}
source_set("unified_consent_enabled_hooks") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"unified_consent_enabled_egtests_hook.mm",
]
deps = [
"//components/unified_consent",
"//components/unified_consent:test_support",
"//ios/chrome/app:tests_hook",
]
}
......@@ -47,17 +47,13 @@ void WaitForMatcher(id<GREYMatcher> matcher) {
// Returns a matcher for |userEmail| in IdentityChooserViewController.
id<GREYMatcher> identityChooserButtonMatcherWithEmail(NSString* userEmail) {
if (base::FeatureList::IsEnabled(unified_consent::kUnifiedConsent)) {
return grey_allOf(grey_accessibilityID(userEmail),
grey_kindOfClass([IdentityChooserCell class]),
grey_sufficientlyVisible(), nil);
}
return chrome_test_util::ButtonWithAccessibilityLabel(userEmail);
return grey_allOf(grey_accessibilityID(userEmail),
grey_kindOfClass([IdentityChooserCell class]),
grey_sufficientlyVisible(), nil);
}
// Returns a matcher for "ADD ACCOUNT" in IdentityChooserViewController.
id<GREYMatcher> addIdentityButtonInIdentityChooser() {
DCHECK(base::FeatureList::IsEnabled(unified_consent::kUnifiedConsent));
return chrome_test_util::ButtonWithAccessibilityLabel(
l10n_util::GetNSStringWithFixup(
IDS_IOS_ACCOUNT_UNIFIED_CONSENT_ADD_ACCOUNT));
......@@ -70,6 +66,13 @@ id<GREYMatcher> addIdentityButtonInIdentityChooser() {
@implementation SigninInteractionControllerTestCase
- (void)setUp {
[super setUp];
CHECK(unified_consent::IsUnifiedConsentFeatureEnabled())
<< "This test suite must be run with Unified Consent feature enabled.";
}
// Tests that opening the sign-in screen from the Settings and signing in works
// correctly when there is already an identity on the device.
- (void)testSignInOneUser {
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/unified_consent/scoped_unified_consent.h"
#include "ios/chrome/app/tests_hook.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
unified_consent::ScopedUnifiedConsent* gScopedUnifiedConsent = nullptr;
}
namespace tests_hook {
bool DisableAppGroupAccess() {
return true;
}
bool DisableContentSuggestions() {
return true;
}
bool DisableContextualSearch() {
return true;
}
bool DisableFirstRun() {
return true;
}
bool DisableGeolocation() {
return true;
}
bool DisableSigninRecallPromo() {
return true;
}
bool DisableUpdateService() {
return true;
}
void SetUpTestsIfPresent() {
// Enables unified consent feature.
CHECK(!gScopedUnifiedConsent);
gScopedUnifiedConsent = new unified_consent::ScopedUnifiedConsent(
unified_consent::UnifiedConsentFeatureState::kEnabled);
}
void RunTestsIfPresent() {
// No-op for Earl Grey.
}
} // namespace tests_hook
......@@ -213,6 +213,8 @@ chrome_ios_eg_test("ios_chrome_unified_consent_egtests") {
"//ios/chrome/browser/ui/settings/google_services:unified_consent_eg_tests",
"//ios/chrome/browser/ui/signin_interaction:unity_eg_tests",
]
hooks_target =
"//ios/chrome/browser/ui/signin_interaction:unified_consent_enabled_hooks"
}
source_set("test_support") {
......
......@@ -1308,6 +1308,11 @@
"label": "//ios/showcase:ios_showcase_egtests",
"type": "raw",
},
"ios_chrome_unified_consent_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_unified_consent_egtests",
"type": "raw",
},
"ios_web_inttests": {
"args": [],
"label": "//ios/web:ios_web_inttests",
......
......@@ -105,6 +105,7 @@ SKIP_GN_ISOLATE_MAP_TARGETS = {
'ios_chrome_smoke_egtests',
'ios_chrome_translate_egtests',
'ios_chrome_ui_egtests',
'ios_chrome_unified_consent_egtests',
'ios_chrome_unittests',
'ios_chrome_web_egtests',
'ios_components_unittests',
......
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