Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: content/public/test/render_view_test.cc

Issue 2648433008: Use explicit WebString conversions in LayoutTest related files (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void RenderViewTest::ExecuteJavaScriptForTests(const char* js) { 170 void RenderViewTest::ExecuteJavaScriptForTests(const char* js) {
171 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js))); 171 GetMainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(js)));
172 } 172 }
173 173
174 bool RenderViewTest::ExecuteJavaScriptAndReturnIntValue( 174 bool RenderViewTest::ExecuteJavaScriptAndReturnIntValue(
175 const base::string16& script, 175 const base::string16& script,
176 int* int_result) { 176 int* int_result) {
177 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); 177 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
178 v8::Local<v8::Value> result = 178 v8::Local<v8::Value> result = GetMainFrame()->executeScriptAndReturnValue(
179 GetMainFrame()->executeScriptAndReturnValue(WebScriptSource(script)); 179 WebScriptSource(blink::WebString::fromUTF16(script)));
180 if (result.IsEmpty() || !result->IsInt32()) 180 if (result.IsEmpty() || !result->IsInt32())
181 return false; 181 return false;
182 182
183 if (int_result) 183 if (int_result)
184 *int_result = result->Int32Value(); 184 *int_result = result->Int32Value();
185 185
186 return true; 186 return true;
187 } 187 }
188 188
189 void RenderViewTest::LoadHTML(const char* html) { 189 void RenderViewTest::LoadHTML(const char* html) {
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 673 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
674 frame->Navigate(common_params, StartNavigationParams(), request_params); 674 frame->Navigate(common_params, StartNavigationParams(), request_params);
675 675
676 // The load actually happens asynchronously, so we pump messages to process 676 // The load actually happens asynchronously, so we pump messages to process
677 // the pending continuation. 677 // the pending continuation.
678 FrameLoadWaiter(frame).Wait(); 678 FrameLoadWaiter(frame).Wait();
679 view_->GetWebView()->updateAllLifecyclePhases(); 679 view_->GetWebView()->updateAllLifecyclePhases();
680 } 680 }
681 681
682 } // namespace content 682 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/web_view_test_client.cc ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698