OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/ui/settings/content_settings_collection_view_control ler.h" | 5 #import "ios/chrome/browser/ui/settings/content_settings_collection_view_control ler.h" |
6 | 6 |
7 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 7 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
8 #include "ios/chrome/browser/experimental_flags.h" | 8 #include "ios/chrome/browser/experimental_flags.h" |
9 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item .h" | 9 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item .h" |
10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h " | 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h " |
(...skipping 26 matching lines...) Expand all Loading... | |
37 web::TestWebThreadBundle thread_bundle_; | 37 web::TestWebThreadBundle thread_bundle_; |
38 std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; | 38 std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; |
39 }; | 39 }; |
40 | 40 |
41 TEST_F(ContentSettingsCollectionViewControllerTest, TestModel) { | 41 TEST_F(ContentSettingsCollectionViewControllerTest, TestModel) { |
42 CreateController(); | 42 CreateController(); |
43 CheckController(); | 43 CheckController(); |
44 CheckTitleWithId(IDS_IOS_CONTENT_SETTINGS_TITLE); | 44 CheckTitleWithId(IDS_IOS_CONTENT_SETTINGS_TITLE); |
45 | 45 |
46 ASSERT_EQ(1, NumberOfSections()); | 46 ASSERT_EQ(1, NumberOfSections()); |
47 // Compose Email section is shown only if experiment is turned on and | 47 // Compose Email section is shown only if experiment is turned on. |
48 // there are enough number of available mailto: URL handlers. | |
49 int number_of_handlers = | |
50 [[[[MailtoURLRewriter alloc] initWithStandardHandlers] defaultHandlers] | |
51 count]; | |
52 bool show_compose_email_section = | 48 bool show_compose_email_section = |
53 experimental_flags::IsNativeAppLauncherEnabled() && | 49 !experimental_flags::IsNativeAppLauncherEnabled(); |
pkl (ping after 24h if needed)
2017/05/19 18:22:03
Note that there was a bug which was masked by the
| |
54 number_of_handlers > 1; | |
55 int expectedNumberOfItems = show_compose_email_section ? 3 : 2; | 50 int expectedNumberOfItems = show_compose_email_section ? 3 : 2; |
56 EXPECT_EQ(expectedNumberOfItems, NumberOfItemsInSection(0)); | 51 EXPECT_EQ(expectedNumberOfItems, NumberOfItemsInSection(0)); |
57 CheckDetailItemTextWithIds(IDS_IOS_BLOCK_POPUPS, IDS_IOS_SETTING_ON, 0, 0); | 52 CheckDetailItemTextWithIds(IDS_IOS_BLOCK_POPUPS, IDS_IOS_SETTING_ON, 0, 0); |
58 CheckDetailItemTextWithIds(IDS_IOS_TRANSLATE_SETTING, IDS_IOS_SETTING_ON, 0, | 53 CheckDetailItemTextWithIds(IDS_IOS_TRANSLATE_SETTING, IDS_IOS_SETTING_ON, 0, |
59 1); | 54 1); |
60 if (show_compose_email_section) { | 55 if (show_compose_email_section) { |
61 CollectionViewDetailItem* item = GetCollectionViewItem(0, 2); | 56 CollectionViewDetailItem* item = GetCollectionViewItem(0, 2); |
62 EXPECT_NSEQ(l10n_util::GetNSString(IDS_IOS_COMPOSE_EMAIL_SETTING), | 57 EXPECT_NSEQ(l10n_util::GetNSString(IDS_IOS_COMPOSE_EMAIL_SETTING), |
63 item.text); | 58 item.text); |
64 } | 59 } |
65 } | 60 } |
66 | 61 |
67 } // namespace | 62 } // namespace |
OLD | NEW |