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

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

Issue 1227413007: Move ReplaceStringPlaceholders to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@join
Patch Set: Created 5 years, 5 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 <cctype> 7 #include <cctype>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 " return null;" 333 " return null;"
334 " var bounds = GetCoordinates(elem);" 334 " var bounds = GetCoordinates(elem);"
335 " bounds[2] = Math.round(elem.offsetWidth);" 335 " bounds[2] = Math.round(elem.offsetWidth);"
336 " bounds[3] = Math.round(elem.offsetHeight);" 336 " bounds[3] = Math.round(elem.offsetHeight);"
337 " return bounds;" 337 " return bounds;"
338 "})();"; 338 "})();";
339 gfx::Rect RenderViewTest::GetElementBounds(const std::string& element_id) { 339 gfx::Rect RenderViewTest::GetElementBounds(const std::string& element_id) {
340 std::vector<std::string> params; 340 std::vector<std::string> params;
341 params.push_back(element_id); 341 params.push_back(element_id);
342 std::string script = 342 std::string script =
343 ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL); 343 base::ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL);
344 344
345 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 345 v8::Isolate* isolate = v8::Isolate::GetCurrent();
346 v8::HandleScope handle_scope(isolate); 346 v8::HandleScope handle_scope(isolate);
347 v8::Local<v8::Value> value = GetMainFrame()->executeScriptAndReturnValue( 347 v8::Local<v8::Value> value = GetMainFrame()->executeScriptAndReturnValue(
348 WebScriptSource(WebString::fromUTF8(script))); 348 WebScriptSource(WebString::fromUTF8(script)));
349 if (value.IsEmpty() || !value->IsArray()) 349 if (value.IsEmpty() || !value->IsArray())
350 return gfx::Rect(); 350 return gfx::Rect();
351 351
352 v8::Local<v8::Array> array = value.As<v8::Array>(); 352 v8::Local<v8::Array> array = value.As<v8::Array>();
353 if (array->Length() != 4) 353 if (array->Length() != 4)
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 TestRenderFrame* frame = 577 TestRenderFrame* frame =
578 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 578 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
579 frame->Navigate(common_params, StartNavigationParams(), request_params); 579 frame->Navigate(common_params, StartNavigationParams(), request_params);
580 580
581 // The load actually happens asynchronously, so we pump messages to process 581 // The load actually happens asynchronously, so we pump messages to process
582 // the pending continuation. 582 // the pending continuation.
583 FrameLoadWaiter(frame).Wait(); 583 FrameLoadWaiter(frame).Wait();
584 } 584 }
585 585
586 } // namespace content 586 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | extensions/browser/api/app_window/app_window_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698