| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <map> | 5 #include <map> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // early, as it is called before BrowserMain, which expects no FieldTrialList | 206 // early, as it is called before BrowserMain, which expects no FieldTrialList |
| 207 // singleton to exist. There are no other hooks we could use either. | 207 // singleton to exist. There are no other hooks we could use either. |
| 208 // | 208 // |
| 209 // As a workaround, enable the feature here, then enable the feature once | 209 // As a workaround, enable the feature here, then enable the feature once |
| 210 // again + set up the field trials later. | 210 // again + set up the field trials later. |
| 211 void SetUpCommandLine(base::CommandLine* command_line) override { | 211 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 212 command_line->AppendSwitchASCII( | 212 command_line->AppendSwitchASCII( |
| 213 switches::kEnableFeatures, | 213 switches::kEnableFeatures, |
| 214 base::JoinString( | 214 base::JoinString( |
| 215 {kSafeBrowsingSubresourceFilter.name, "SafeBrowsingV4OnlyEnabled", | 215 {kSafeBrowsingSubresourceFilter.name, "SafeBrowsingV4OnlyEnabled", |
| 216 kSubresourceFilterSafeBrowsingActivationThrottle.name, | |
| 217 kSafeBrowsingSubresourceFilterExperimentalUI.name}, | 216 kSafeBrowsingSubresourceFilterExperimentalUI.name}, |
| 218 ",")); | 217 ",")); |
| 219 } | 218 } |
| 220 | 219 |
| 221 void SetUp() override { | 220 void SetUp() override { |
| 222 sb_factory_ = | 221 sb_factory_ = |
| 223 base::MakeUnique<safe_browsing::TestSafeBrowsingServiceFactory>( | 222 base::MakeUnique<safe_browsing::TestSafeBrowsingServiceFactory>( |
| 224 safe_browsing::V4FeatureList::V4UsageStatus::V4_ONLY); | 223 safe_browsing::V4FeatureList::V4UsageStatus::V4_ONLY); |
| 225 sb_factory_->SetTestUIManager(new FakeSafeBrowsingUIManager()); | 224 sb_factory_->SetTestUIManager(new FakeSafeBrowsingUIManager()); |
| 226 safe_browsing::SafeBrowsingService::RegisterFactory(sb_factory_.get()); | 225 safe_browsing::SafeBrowsingService::RegisterFactory(sb_factory_.get()); |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 std::string(kSubresourceFilterOnlySuffix)), | 1324 std::string(kSubresourceFilterOnlySuffix)), |
| 1326 ::testing::IsEmpty()); | 1325 ::testing::IsEmpty()); |
| 1327 | 1326 |
| 1328 EXPECT_THAT(tester.GetAllSamples(std::string(kNavigationChainSize) + | 1327 EXPECT_THAT(tester.GetAllSamples(std::string(kNavigationChainSize) + |
| 1329 std::string(kSubresourceFilterOnlySuffix)), | 1328 std::string(kSubresourceFilterOnlySuffix)), |
| 1330 ::testing::IsEmpty()); | 1329 ::testing::IsEmpty()); |
| 1331 } | 1330 } |
| 1332 #endif | 1331 #endif |
| 1333 | 1332 |
| 1334 } // namespace subresource_filter | 1333 } // namespace subresource_filter |
| OLD | NEW |