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

Unified Diff: components/subresource_filter/core/browser/ruleset_service_unittest.cc

Issue 2793993002: [subresource_filter] Replace KMP by std::search. (Closed)
Patch Set: Fix DCHECK. Created 3 years, 8 months 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: components/subresource_filter/core/browser/ruleset_service_unittest.cc
diff --git a/components/subresource_filter/core/browser/ruleset_service_unittest.cc b/components/subresource_filter/core/browser/ruleset_service_unittest.cc
index dccef00822dacd4d45b4f3f2a7e8f85f8e415f15..fa7d2fb159db217353eb5f3141048b096b90b58c 100644
--- a/components/subresource_filter/core/browser/ruleset_service_unittest.cc
+++ b/components/subresource_filter/core/browser/ruleset_service_unittest.cc
@@ -27,6 +27,7 @@
#include "build/build_config.h"
#include "components/prefs/testing_pref_service.h"
#include "components/subresource_filter/core/browser/ruleset_service_delegate.h"
+#include "components/subresource_filter/core/common/proto/rules.pb.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -659,13 +660,13 @@ TEST_F(SubresourceFilteringRulesetServiceTest,
base::HistogramTester histogram_tester;
mock_delegate()->SimulateStartupCompleted();
- // URL patterns longer than 255 characters are not supported.
- const std::string kTooLongSuffix(1000, 'a');
+ // The default field values are considered unsupported.
+ proto::UrlRule unfilled_rule;
+
TestRulesetPair ruleset_with_unsupported_rule;
ASSERT_NO_FATAL_FAILURE(
- test_ruleset_creator()
- ->CreateUnindexedRulesetToDisallowURLsWithPathSuffix(
- kTooLongSuffix, &ruleset_with_unsupported_rule.unindexed));
+ test_ruleset_creator()->CreateUnindexedRulesetWithRules(
+ {unfilled_rule}, &ruleset_with_unsupported_rule.unindexed));
IndexAndStoreAndPublishUpdatedRuleset(ruleset_with_unsupported_rule,
kTestContentVersion1);
RunUntilIdle();
« no previous file with comments | « components/subresource_filter/core/browser/BUILD.gn ('k') | components/subresource_filter/core/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698