OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string.h> // for memcpy() | 7 #include <string.h> // for memcpy() |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/common/main_function_params.h" | 16 #include "chrome/common/main_function_params.h" |
17 #include "chrome/common/render_messages.h" | 17 #include "chrome/common/render_messages.h" |
18 #include "chrome/common/sandbox_init_wrapper.h" | 18 #include "chrome/common/sandbox_init_wrapper.h" |
19 #include "chrome/renderer/mock_render_process.h" | 19 #include "chrome/renderer/mock_render_process.h" |
20 #include "chrome/renderer/render_thread.h" | 20 #include "chrome/renderer/render_thread.h" |
21 #include "chrome/renderer/render_view.h" | 21 #include "chrome/renderer/render_view.h" |
22 #include "chrome/renderer/render_view_visitor.h" | 22 #include "chrome/renderer/render_view_visitor.h" |
23 #include "chrome/renderer/renderer_main_platform_delegate.h" | 23 #include "chrome/renderer/renderer_main_platform_delegate.h" |
24 #include "chrome/renderer/safe_browsing/features.h" | 24 #include "chrome/renderer/safe_browsing/features.h" |
25 #include "googleurl/src/gurl.h" | 25 #include "googleurl/src/gurl.h" |
26 #include "ipc/ipc_channel.h" | 26 #include "ipc/ipc_channel.h" |
27 #include "net/http/http_response_headers.h" | |
28 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
30 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
31 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
32 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
33 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
34 | 33 |
35 using ::testing::ContainerEq; | 34 using ::testing::ContainerEq; |
36 | 35 |
37 namespace safe_browsing { | 36 namespace safe_browsing { |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 FeatureMap features; | 405 FeatureMap features; |
407 LoadURL("http://host.com/"); | 406 LoadURL("http://host.com/"); |
408 ASSERT_TRUE(ExtractFeatures(&features)); | 407 ASSERT_TRUE(ExtractFeatures(&features)); |
409 EXPECT_THAT(features.features(), ContainerEq(expected_features.features())); | 408 EXPECT_THAT(features.features(), ContainerEq(expected_features.features())); |
410 } | 409 } |
411 | 410 |
412 // TODO(bryner): Test extraction with multiple passes, including the case where | 411 // TODO(bryner): Test extraction with multiple passes, including the case where |
413 // the node we stopped on is removed from the document. | 412 // the node we stopped on is removed from the document. |
414 | 413 |
415 } // namespace safe_browsing | 414 } // namespace safe_browsing |
OLD | NEW |