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

Unified Diff: content/public/test/render_view_test.cc

Issue 447503002: Add content browser test for <optgroup> with 'display: none' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/render_view_test.cc
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index f4e44ca6d064f6bf390dd3281731a373ab83c4ba..3a8a9cb613b586290e9ac895434bdb2e0f786982 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -114,6 +114,21 @@ bool RenderViewTest::ExecuteJavaScriptAndReturnIntValue(
return true;
}
+bool RenderViewTest::ExecuteJavaScriptAndReturnStringValue(
+ const base::string16& script,
+ std::string& value)
+{
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> result =
+ GetMainFrame()->executeScriptAndReturnValue(WebScriptSource(script));
+ if (result.IsEmpty() || !result->IsString())
+ return false;
+
+ std::string resultStr(*v8::String::Utf8Value(result));
+ value.swap(resultStr);
+ return true;
+}
+
void RenderViewTest::LoadHTML(const char* html) {
std::string url_str = "data:text/html;charset=utf-8,";
url_str.append(html);

Powered by Google App Engine
This is Rietveld 408576698