Commit 6b4ea4f3 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Convert Badge Showcase tests

Adds a new "badge_public" source_set in //chrome/browser/infobar and
"badges_constants" source_set in //showcase to avoid any chrome/app
dependencies.

Bug: 987646
Change-Id: I9116a971d0f90ef22ca02f4972f97c644ba481fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911222Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715072}
parent bcf164ca
......@@ -34,16 +34,28 @@ source_set("infobars") {
]
}
source_set("badge") {
source_set("badge_public") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"infobar_badge_model.h",
"infobar_badge_model.mm",
]
deps = [
":public",
"//base",
"//ios/chrome/browser/ui/badges:public",
]
}
source_set("badge") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"infobar_badge_tab_helper.h",
"infobar_badge_tab_helper.mm",
"infobar_badge_tab_helper_delegate.h",
]
deps = [
":badge_public",
":infobars",
":public",
"//ios/chrome/browser/ui/badges:public",
......
......@@ -98,6 +98,7 @@ source_set("unit_tests") {
"//ios/chrome/browser/browser_state:test_support",
"//ios/chrome/browser/infobars",
"//ios/chrome/browser/infobars:badge",
"//ios/chrome/browser/infobars:badge_public",
"//ios/chrome/browser/ui/infobars:test_support",
"//ios/chrome/browser/web_state_list",
"//ios/chrome/browser/web_state_list:test_support",
......
......@@ -78,6 +78,7 @@ ios_eg2_test("ios_showcase_eg2tests_module") {
xctest_bundle_principal_class = "ChromeEGTestBundleMain"
deps = [
"//ios/showcase/badges:eg2_tests",
"//ios/showcase/content_suggestions:eg2_tests",
"//ios/showcase/infobars:eg2_tests",
]
......
......@@ -8,7 +8,8 @@ source_set("badges") {
"sc_badge_coordinator.mm",
]
deps = [
"//ios/chrome/browser/infobars:badge",
":badges_constants",
"//ios/chrome/browser/infobars:badge_public",
"//ios/chrome/browser/ui/badges",
"//ios/chrome/browser/ui/badges:badges_popup_menu",
"//ios/chrome/browser/ui/util",
......@@ -19,17 +20,49 @@ source_set("badges") {
configs += [ "//build/config/compiler:enable_arc" ]
}
source_set("badges_constants") {
sources = [
"sc_badge_constants.h",
"sc_badge_constants.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
}
source_set("eg2_tests") {
defines = [ "CHROME_EARL_GREY_2" ]
configs += [
"//build/config/compiler:enable_arc",
"//build/config/ios:xctest_config",
]
testonly = true
sources = [
"sc_badge_egtest.mm",
]
deps = [
":badges_constants",
"//ios/chrome/browser/infobars:badge_public",
"//ios/chrome/browser/ui/badges:public",
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/showcase/test:eg2_test",
"//ios/testing/earl_grey:eg_test_support+eg2",
"//ios/third_party/earl_grey2:test_lib",
]
libs = [ "UIKit.framework" ]
}
source_set("eg_tests") {
defines = [ "CHROME_EARL_GREY_1" ]
testonly = true
sources = [
"sc_badge_egtest.mm",
]
deps = [
":badges_constants",
"//ios/chrome/browser/infobars:badge",
"//ios/chrome/browser/ui/badges:public",
"//ios/chrome/test/earl_grey:test_support",
"//ios/showcase/badges",
"//ios/showcase/test",
"//ios/testing/earl_grey:earl_grey_support",
]
configs += [ "//build/config/compiler:enable_arc" ]
}
// 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.
#ifndef IOS_SHOWCASE_BADGES_SC_BADGE_CONSTANTS_H_
#define IOS_SHOWCASE_BADGES_SC_BADGE_CONSTANTS_H_
#import <UIKit/UIKit.h>
// A11y identifier for button that will replace the displayed badge with the
// overflow badge button.
extern NSString* const kSCShowOverflowDisplayedBadgeButton;
// A11y identifier for button that will show an accepted displayed button.
extern NSString* const kSCShowAcceptedDisplayedBadgeButton;
#endif // IOS_SHOWCASE_BADGES_SC_BADGE_CONSTANTS_H_
// 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.
#import "ios/showcase/badges/sc_badge_constants.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
NSString* const kSCShowOverflowDisplayedBadgeButton =
@"kSCShowOverflowDisplayedBadgeButtonAXID";
NSString* const kSCShowAcceptedDisplayedBadgeButton =
@"kSCShowAcceptedDisplayedBadgeButtonAXID";
......@@ -7,13 +7,6 @@
#import "ios/showcase/common/navigation_coordinator.h"
// A11y identifier for button that will replace the displayed badge with the
// overflow badge button.
extern NSString* const kSCShowOverflowDisplayedBadgeButton;
// A11y identifier for button that will show an accepted displayed button.
extern NSString* const kSCShowAcceptedDisplayedBadgeButton;
@interface SCBadgeCoordinator : NSObject <NavigationCoordinator>
@end
......
......@@ -15,17 +15,12 @@
#import "ios/chrome/browser/ui/util/named_guide.h"
#import "ios/chrome/browser/ui/util/named_guide_util.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h"
#import "ios/showcase/badges/sc_badge_constants.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
NSString* const kSCShowOverflowDisplayedBadgeButton =
@"kSCShowOverflowDisplayedBadgeButtonAXID";
NSString* const kSCShowAcceptedDisplayedBadgeButton =
@"kSCShowAcceptedDisplayedBadgeButtonAXID";
@interface BadgeContainerViewController : UIViewController
@property(nonatomic, strong) BadgeViewController* centeredChildViewController;
@property(nonatomic, weak) id<BadgeConsumer> consumer;
......
......@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <EarlGrey/EarlGrey.h>
#import "ios/chrome/browser/ui/badges/badge_constants.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/showcase/badges/sc_badge_coordinator.h"
#import "ios/showcase/badges/sc_badge_constants.h"
#import "ios/showcase/test/showcase_eg_utils.h"
#import "ios/showcase/test/showcase_test_case.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
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