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 <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/location.h" | |
10 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | |
12 #include "components/scheduler/renderer/renderer_scheduler.h" | 10 #include "components/scheduler/renderer/renderer_scheduler.h" |
13 #include "content/common/dom_storage/dom_storage_types.h" | 11 #include "content/common/dom_storage/dom_storage_types.h" |
14 #include "content/common/frame_messages.h" | 12 #include "content/common/frame_messages.h" |
15 #include "content/common/input_messages.h" | 13 #include "content/common/input_messages.h" |
16 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
17 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
18 #include "content/public/browser/native_web_keyboard_event.h" | 16 #include "content/public/browser/native_web_keyboard_event.h" |
19 #include "content/public/common/content_client.h" | 17 #include "content/public/common/content_client.h" |
20 #include "content/public/common/renderer_preferences.h" | 18 #include "content/public/common/renderer_preferences.h" |
21 #include "content/public/renderer/content_renderer_client.h" | 19 #include "content/public/renderer/content_renderer_client.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 126 } |
129 | 127 |
130 RenderViewTest::RenderViewTest() | 128 RenderViewTest::RenderViewTest() |
131 : view_(NULL) { | 129 : view_(NULL) { |
132 } | 130 } |
133 | 131 |
134 RenderViewTest::~RenderViewTest() { | 132 RenderViewTest::~RenderViewTest() { |
135 } | 133 } |
136 | 134 |
137 void RenderViewTest::ProcessPendingMessages() { | 135 void RenderViewTest::ProcessPendingMessages() { |
138 msg_loop_.task_runner()->PostTask(FROM_HERE, | 136 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
139 base::MessageLoop::QuitClosure()); | |
140 msg_loop_.Run(); | 137 msg_loop_.Run(); |
141 } | 138 } |
142 | 139 |
143 WebLocalFrame* RenderViewTest::GetMainFrame() { | 140 WebLocalFrame* RenderViewTest::GetMainFrame() { |
144 return view_->GetWebView()->mainFrame()->toWebLocalFrame(); | 141 return view_->GetWebView()->mainFrame()->toWebLocalFrame(); |
145 } | 142 } |
146 | 143 |
147 void RenderViewTest::ExecuteJavaScript(const char* js) { | 144 void RenderViewTest::ExecuteJavaScript(const char* js) { |
148 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js))); | 145 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js))); |
149 } | 146 } |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 547 |
551 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 548 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
552 request_params); | 549 request_params); |
553 | 550 |
554 // The load actually happens asynchronously, so we pump messages to process | 551 // The load actually happens asynchronously, so we pump messages to process |
555 // the pending continuation. | 552 // the pending continuation. |
556 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 553 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
557 } | 554 } |
558 | 555 |
559 } // namespace content | 556 } // namespace content |
OLD | NEW |