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 "content/public/test/render_view_test.h" | 5 #include "content/public/test/render_view_test.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/common/input_messages.h" | 8 #include "content/common/input_messages.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 RenderViewTest::RenderViewTest() | 72 RenderViewTest::RenderViewTest() |
73 : view_(NULL) { | 73 : view_(NULL) { |
74 } | 74 } |
75 | 75 |
76 RenderViewTest::~RenderViewTest() { | 76 RenderViewTest::~RenderViewTest() { |
77 } | 77 } |
78 | 78 |
79 void RenderViewTest::ProcessPendingMessages() { | 79 void RenderViewTest::ProcessPendingMessages() { |
80 msg_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 80 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
81 msg_loop_.Run(); | 81 msg_loop_.Run(); |
82 } | 82 } |
83 | 83 |
84 WebFrame* RenderViewTest::GetMainFrame() { | 84 WebFrame* RenderViewTest::GetMainFrame() { |
85 return view_->GetWebView()->mainFrame(); | 85 return view_->GetWebView()->mainFrame(); |
86 } | 86 } |
87 | 87 |
88 void RenderViewTest::ExecuteJavaScript(const char* js) { | 88 void RenderViewTest::ExecuteJavaScript(const char* js) { |
89 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js))); | 89 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js))); |
90 } | 90 } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 363 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
364 OnMessageReceived(navigate_message); | 364 OnMessageReceived(navigate_message); |
365 | 365 |
366 // The load actually happens asynchronously, so we pump messages to process | 366 // The load actually happens asynchronously, so we pump messages to process |
367 // the pending continuation. | 367 // the pending continuation. |
368 ProcessPendingMessages(); | 368 ProcessPendingMessages(); |
369 } | 369 } |
370 | 370 |
371 } // namespace content | 371 } // namespace content |
OLD | NEW |