OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "components/safe_browsing/renderer/threat_dom_details.h" | 5 #include "components/safe_browsing/renderer/threat_dom_details.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/test/scoped_feature_list.h" | 11 #include "base/test/scoped_feature_list.h" |
12 #include "chrome/test/base/chrome_render_view_test.h" | 12 #include "chrome/test/base/chrome_render_view_test.h" |
13 #include "components/safe_browsing/common/safebrowsing_messages.h" | 13 #include "components/safe_browsing/common/safebrowsing_messages.h" |
14 #include "components/variations/variations_associated_data.h" | 14 #include "components/variations/variations_associated_data.h" |
15 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.h" |
16 #include "net/base/escape.h" | 16 #include "net/base/escape.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
19 #include "ui/native_theme/native_theme_switches.h" | 19 #include "ui/native_theme/native_theme_features.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 std::unique_ptr<base::test::ScopedFeatureList> SetupTagAndAttributeFeature() { | 23 std::unique_ptr<base::test::ScopedFeatureList> SetupTagAndAttributeFeature() { |
24 std::map<std::string, std::string> feature_params; | 24 std::map<std::string, std::string> feature_params; |
25 feature_params[std::string(safe_browsing::kTagAndAttributeParamName)] = | 25 feature_params[std::string(safe_browsing::kTagAndAttributeParamName)] = |
26 "div,foo,div,baz,div,attr2,div,attr3,div,longattr4,div,attr5,div,attr6"; | 26 "div,foo,div,baz,div,attr2,div,attr3,div,longattr4,div,attr5,div,attr6"; |
27 variations::AssociateVariationParams( | 27 variations::AssociateVariationParams( |
28 safe_browsing::kThreatDomDetailsTagAndAttributeFeature.name, "Group", | 28 safe_browsing::kThreatDomDetailsTagAndAttributeFeature.name, "Group", |
29 feature_params); | 29 feature_params); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 std::make_pair("longattr4", "4"), | 271 std::make_pair("longattr4", "4"), |
272 std::make_pair("attr5", "lo..."))); | 272 std::make_pair("attr5", "lo..."))); |
273 | 273 |
274 param = params[1]; | 274 param = params[1]; |
275 EXPECT_EQ(url, param.url); | 275 EXPECT_EQ(url, param.url); |
276 EXPECT_EQ(0, param.node_id); | 276 EXPECT_EQ(0, param.node_id); |
277 EXPECT_EQ(0, param.parent_node_id); | 277 EXPECT_EQ(0, param.parent_node_id); |
278 EXPECT_TRUE(param.child_node_ids.empty()); | 278 EXPECT_TRUE(param.child_node_ids.empty()); |
279 } | 279 } |
280 } | 280 } |
OLD | NEW |