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

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

Issue 2589583003: Upstream Chrome on iOS source code [7/11]. (Closed)
Patch Set: Created 4 years 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
new file mode 100644
index 0000000000000000000000000000000000000000..e60370113ff5d53e39017f43b629aade49acc6d8
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/content_settings_collection_view_controller_unittest.mm
@@ -0,0 +1,46 @@
+// Copyright 2013 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/chrome/browser/ui/settings/content_settings_collection_view_controller.h"
+
+#include "ios/chrome/browser/browser_state/test_chrome_browser_state.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"
+
+namespace {
+
+class ContentSettingsCollectionViewControllerTest
+ : public CollectionViewControllerTest {
+ protected:
+ void SetUp() override {
+ CollectionViewControllerTest::SetUp();
+ TestChromeBrowserState::Builder test_cbs_builder;
+ chrome_browser_state_ = test_cbs_builder.Build();
+ }
+
+ CollectionViewController* NewController() override NS_RETURNS_RETAINED {
+ return [[ContentSettingsCollectionViewController alloc]
+ initWithBrowserState:chrome_browser_state_.get()];
+ }
+
+ private:
+ web::TestWebThreadBundle thread_bundle_;
+ std::unique_ptr<TestChromeBrowserState> chrome_browser_state_;
+};
+
+TEST_F(ContentSettingsCollectionViewControllerTest, TestModel) {
+ CreateController();
+ CheckController();
+ CheckTitleWithId(IDS_IOS_CONTENT_SETTINGS_TITLE);
+
+ int expectedNumberOfItems = 2;
+ ASSERT_EQ(1, NumberOfSections());
+ 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);
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698