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") {
source_set("unit_tests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [ "safety_check_table_view_controller_unittest.mm" ]
sources = [ "safety_check_mediator_unittest.mm" ]
deps = [
":safety_check_ui",
":safety_check",
"//base/test:test_support",
"//components/strings",
"//ios/chrome/app/strings",
......
......@@ -88,7 +88,7 @@
- (void)start {
SafetyCheckTableViewController* viewController =
[[SafetyCheckTableViewController alloc]
initWithStyle:UITableViewStylePlain];
initWithStyle:UITableViewStyleGrouped];
self.viewController = viewController;
scoped_refptr<IOSChromePasswordCheckManager> passwordCheckManager =
......
......@@ -795,8 +795,6 @@ typedef NS_ENUM(NSInteger, CheckStartStates) {
self.safeBrowsingPreferenceManaged) {
self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateManaged;
}
// See if this was the last test.
[self resetsCheckStartItemIfNeeded];
[self reconfigureSafeBrowsingCheckItem];
}
......
......@@ -2,7 +2,7 @@
// 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/safety_check/safety_check_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.h"
#include <memory>
......@@ -25,23 +25,6 @@
namespace {
class SafetyCheckTableViewControllerTest
: 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));
}
// TODO(crbug.com/1078782): Add tests.
} // namespace
......@@ -305,7 +305,9 @@ test("ios_chrome_unittests") {
"//ios/chrome/browser/ui/settings/password: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/safety_check: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/side_swipe: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