OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h" | 5 #include "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/test/test_utils.h" | 22 #include "content/public/test/test_utils.h" |
23 #include "net/base/escape.h" | 23 #include "net/base/escape.h" |
24 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 24 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
26 #include "third_party/WebKit/public/platform/URLConversion.h" | 26 #include "third_party/WebKit/public/platform/URLConversion.h" |
27 #include "third_party/WebKit/public/platform/WebString.h" | 27 #include "third_party/WebKit/public/platform/WebString.h" |
28 #include "third_party/WebKit/public/web/WebFrame.h" | 28 #include "third_party/WebKit/public/web/WebFrame.h" |
29 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 29 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
30 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 30 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
31 #include "third_party/WebKit/public/web/WebScriptSource.h" | 31 #include "third_party/WebKit/public/web/WebScriptSource.h" |
32 #include "ui/native_theme/native_theme_switches.h" | 32 #include "ui/native_theme/native_theme_features.h" |
33 | 33 |
34 using ::testing::DoAll; | 34 using ::testing::DoAll; |
35 using ::testing::Invoke; | 35 using ::testing::Invoke; |
36 using ::testing::Return; | 36 using ::testing::Return; |
37 using blink::WebRuntimeFeatures; | 37 using blink::WebRuntimeFeatures; |
38 | 38 |
39 namespace safe_browsing { | 39 namespace safe_browsing { |
40 | 40 |
41 // TestPhishingDOMFeatureExtractor has nearly identical behavior as | 41 // TestPhishingDOMFeatureExtractor has nearly identical behavior as |
42 // PhishingDOMFeatureExtractor, except the IsExternalDomain() and | 42 // PhishingDOMFeatureExtractor, except the IsExternalDomain() and |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 "<html><head></head><body>" | 569 "<html><head></head><body>" |
570 "<iframe src=\"" + | 570 "<iframe src=\"" + |
571 net::EscapeForHTML(iframe1_url.spec()) + | 571 net::EscapeForHTML(iframe1_url.spec()) + |
572 "\" id=\"frame1\"></iframe>" | 572 "\" id=\"frame1\"></iframe>" |
573 "<form></form></body></html>"); | 573 "<form></form></body></html>"); |
574 ExtractFeatures("host.com", html, &features); | 574 ExtractFeatures("host.com", html, &features); |
575 ExpectFeatureMapsAreEqual(features, expected_features); | 575 ExpectFeatureMapsAreEqual(features, expected_features); |
576 } | 576 } |
577 | 577 |
578 } // namespace safe_browsing | 578 } // namespace safe_browsing |
OLD | NEW |