Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm

Issue 2870783002: Adds Compose Email Settings UI for deprecating Native App Launcher (Closed)
Patch Set: replied to comments from rohitrao Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm
diff --git a/ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm
index 1d07ba6928ef51a03d9ddafca280c8e32db9a49f..b665cb270e0de289769cbebac13b6f436920a7dc 100644
--- a/ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm
@@ -5,9 +5,13 @@
#import "ios/chrome/browser/ui/settings/content_settings_collection_view_controller.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
+#include "ios/chrome/browser/experimental_flags.h"
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ios/web/public/test/test_web_thread_bundle.h"
+#include "testing/gtest_mac.h"
+#include "ui/base/l10n/l10n_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@@ -39,12 +43,25 @@ TEST_F(ContentSettingsCollectionViewControllerTest, TestModel) {
CheckController();
CheckTitleWithId(IDS_IOS_CONTENT_SETTINGS_TITLE);
- int expectedNumberOfItems = 2;
ASSERT_EQ(1, NumberOfSections());
+ // Compose Email section is shown only if experiment is turned on and
+ // there are enough number of available mailto: URL handlers.
+ int number_of_handlers =
+ [[[[MailtoURLRewriter alloc] initWithStandardHandlers] defaultHandlers]
+ count];
+ bool show_compose_email_section =
+ experimental_flags::IsNativeAppLauncherEnabled() &&
+ number_of_handlers > 1;
+ int expectedNumberOfItems = show_compose_email_section ? 3 : 2;
EXPECT_EQ(expectedNumberOfItems, NumberOfItemsInSection(0));
CheckDetailItemTextWithIds(IDS_IOS_BLOCK_POPUPS, IDS_IOS_SETTING_ON, 0, 0);
CheckDetailItemTextWithIds(IDS_IOS_TRANSLATE_SETTING, IDS_IOS_SETTING_ON, 0,
1);
+ if (show_compose_email_section) {
+ CollectionViewDetailItem* item = GetCollectionViewItem(0, 2);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_IOS_COMPOSE_EMAIL_SETTING),
+ item.text);
+ }
}
} // namespace
« no previous file with comments | « ios/chrome/browser/ui/settings/content_settings_collection_view_controller.mm ('k') | ios/chrome/browser/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698