Commit b9984927 authored by harrisonsean's avatar harrisonsean Committed by Commit Bot

[iOS][Safety Check] Enable tests and use group style

Enable safety check and settings utils unittests.

Switch safety check to grouped style.

Switch to mediator unittests instead of view controller.

Remove unneeded call to resetCheckStartItemIfNeeded.

Bug: 1078782
Change-Id: I16a1c188182747634f8af108bcb72f01bbc20985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435646
Commit-Queue: Sean Harrison <harrisonsean@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811313}
parent 8d0d4a3a
...@@ -80,9 +80,9 @@ source_set("safety_check") { ...@@ -80,9 +80,9 @@ source_set("safety_check") {
source_set("unit_tests") { source_set("unit_tests") {
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
testonly = true testonly = true
sources = [ "safety_check_table_view_controller_unittest.mm" ] sources = [ "safety_check_mediator_unittest.mm" ]
deps = [ deps = [
":safety_check_ui", ":safety_check",
"//base/test:test_support", "//base/test:test_support",
"//components/strings", "//components/strings",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
- (void)start { - (void)start {
SafetyCheckTableViewController* viewController = SafetyCheckTableViewController* viewController =
[[SafetyCheckTableViewController alloc] [[SafetyCheckTableViewController alloc]
initWithStyle:UITableViewStylePlain]; initWithStyle:UITableViewStyleGrouped];
self.viewController = viewController; self.viewController = viewController;
scoped_refptr<IOSChromePasswordCheckManager> passwordCheckManager = scoped_refptr<IOSChromePasswordCheckManager> passwordCheckManager =
......
...@@ -795,8 +795,6 @@ typedef NS_ENUM(NSInteger, CheckStartStates) { ...@@ -795,8 +795,6 @@ typedef NS_ENUM(NSInteger, CheckStartStates) {
self.safeBrowsingPreferenceManaged) { self.safeBrowsingPreferenceManaged) {
self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateManaged; self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateManaged;
} }
// See if this was the last test.
[self resetsCheckStartItemIfNeeded];
[self reconfigureSafeBrowsingCheckItem]; [self reconfigureSafeBrowsingCheckItem];
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_table_view_controller.h" #import "ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.h"
#include <memory> #include <memory>
...@@ -25,23 +25,6 @@ ...@@ -25,23 +25,6 @@
namespace { namespace {
class SafetyCheckTableViewControllerTest // TODO(crbug.com/1078782): Add tests.
: public ChromeTableViewControllerTest {
protected:
ChromeTableViewController* InstantiateController() override {
return [[SafetyCheckTableViewController alloc]
initWithStyle:UITableViewStylePlain];
}
};
// Tests PrivacyTableViewController is set up with all appropriate items
// and sections.
TEST_F(SafetyCheckTableViewControllerTest, TestModel) {
CreateController();
CheckController();
EXPECT_EQ(1, NumberOfSections());
EXPECT_EQ(3, NumberOfItemsInSection(0));
}
} // namespace } // namespace
...@@ -305,7 +305,9 @@ test("ios_chrome_unittests") { ...@@ -305,7 +305,9 @@ test("ios_chrome_unittests") {
"//ios/chrome/browser/ui/settings/password:unit_tests", "//ios/chrome/browser/ui/settings/password:unit_tests",
"//ios/chrome/browser/ui/settings/password/password_details:unit_tests", "//ios/chrome/browser/ui/settings/password/password_details:unit_tests",
"//ios/chrome/browser/ui/settings/privacy:unit_tests", "//ios/chrome/browser/ui/settings/privacy:unit_tests",
"//ios/chrome/browser/ui/settings/safety_check:unit_tests",
"//ios/chrome/browser/ui/settings/sync:unit_tests", "//ios/chrome/browser/ui/settings/sync:unit_tests",
"//ios/chrome/browser/ui/settings/utils:unit_tests",
"//ios/chrome/browser/ui/sharing:unit_tests", "//ios/chrome/browser/ui/sharing:unit_tests",
"//ios/chrome/browser/ui/side_swipe:unit_tests", "//ios/chrome/browser/ui/side_swipe:unit_tests",
"//ios/chrome/browser/ui/tab_grid:unit_tests", "//ios/chrome/browser/ui/tab_grid:unit_tests",
......
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