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/render_view_fake_resources_test.h" | 5 #include "chrome/renderer/safe_browsing/render_view_fake_resources_test.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
30 #include "webkit/glue/webkit_glue.h" | 30 #include "webkit/glue/webkit_glue.h" |
31 | 31 |
32 namespace safe_browsing { | 32 namespace safe_browsing { |
33 | 33 |
34 const int32 RenderViewFakeResourcesTest::kViewId = 5; | 34 const int32 RenderViewFakeResourcesTest::kViewId = 5; |
35 | 35 |
36 RenderViewFakeResourcesTest::RenderViewFakeResourcesTest() {} | 36 RenderViewFakeResourcesTest::RenderViewFakeResourcesTest() {} |
37 RenderViewFakeResourcesTest::~RenderViewFakeResourcesTest() {} | 37 RenderViewFakeResourcesTest::~RenderViewFakeResourcesTest() {} |
38 | 38 |
39 void RenderViewFakeResourcesTest::OnMessageReceived( | 39 bool RenderViewFakeResourcesTest::OnMessageReceived( |
40 const IPC::Message& message) { | 40 const IPC::Message& message) { |
41 IPC_BEGIN_MESSAGE_MAP(RenderViewFakeResourcesTest, message) | 41 IPC_BEGIN_MESSAGE_MAP(RenderViewFakeResourcesTest, message) |
42 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 42 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
43 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnDidStopLoading) | 43 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnDidStopLoading) |
44 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource) | 44 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource) |
45 IPC_END_MESSAGE_MAP() | 45 IPC_END_MESSAGE_MAP() |
| 46 return true; |
46 } | 47 } |
47 | 48 |
48 bool RenderViewFakeResourcesTest::Visit(RenderView* render_view) { | 49 bool RenderViewFakeResourcesTest::Visit(RenderView* render_view) { |
49 view_ = render_view; | 50 view_ = render_view; |
50 return false; | 51 return false; |
51 } | 52 } |
52 | 53 |
53 void RenderViewFakeResourcesTest::SetUp() { | 54 void RenderViewFakeResourcesTest::SetUp() { |
54 // Set up the renderer. This code is largely adapted from | 55 // Set up the renderer. This code is largely adapted from |
55 // render_view_test.cc and renderer_main.cc. Note that we use a | 56 // render_view_test.cc and renderer_main.cc. Note that we use a |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 170 |
170 void RenderViewFakeResourcesTest::OnRenderViewReady() { | 171 void RenderViewFakeResourcesTest::OnRenderViewReady() { |
171 // Grab a pointer to the new view using RenderViewVisitor. | 172 // Grab a pointer to the new view using RenderViewVisitor. |
172 ASSERT_TRUE(!view_); | 173 ASSERT_TRUE(!view_); |
173 RenderView::ForEach(this); | 174 RenderView::ForEach(this); |
174 ASSERT_TRUE(view_); | 175 ASSERT_TRUE(view_); |
175 message_loop_.Quit(); | 176 message_loop_.Quit(); |
176 } | 177 } |
177 | 178 |
178 } // namespace safe_browsing | 179 } // namespace safe_browsing |
OLD | NEW |