blob: 29448aabc51e2b5fbe5325589d9c363ccb785a47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright 2020 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.
#include "weblayer/browser/safe_browsing/client_side_detection_service_factory.h"
#include "base/test/scoped_feature_list.h"
#include "weblayer/browser/browser_context_impl.h"
#include "weblayer/browser/profile_impl.h"
#include "weblayer/common/features.h"
#include "weblayer/test/weblayer_browser_test.h"
namespace weblayer {
class ClientSideDetectionServiceFactoryBrowserTest
: public WebLayerBrowserTest {
public:
ClientSideDetectionServiceFactoryBrowserTest() {
feature_list_.InitAndDisableFeature(
features::kWebLayerClientSidePhishingDetection);
}
private:
void SetUpOnMainThread() override {}
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(ClientSideDetectionServiceFactoryBrowserTest,
ClientDetectionServiceNullWhenDisabled) {
EXPECT_EQ(nullptr, ClientSideDetectionServiceFactory::GetForBrowserContext(
GetProfile()->GetBrowserContext()));
}
} // namespace weblayer
|