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

Unified Diff: ppapi/tests/test_case.html

Issue 8920005: Add TestingInstance::EvalScript method which posts a message that the test page can eval(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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: ppapi/tests/test_case.html
===================================================================
--- ppapi/tests/test_case.html (revision 114869)
+++ ppapi/tests/test_case.html (working copy)
@@ -78,6 +78,7 @@
// - DidExecuteTests
// - LogHTML
// - SetCookie
+// - ExecuteScript
// The second item is the verbatim message_contents.
function ParseTestingMessage(message_data) {
if (typeof(message_data)!='string')
@@ -107,6 +108,13 @@
window.document.cookie = key_value_string + "; path=/";
}
+function ExecuteScript(script) {
+ try {
+ eval(script);
+ } catch(ex) {
+ }
+}
+
function IsTestingMessage(message_data) {
return (ParseTestingMessage(message_data) != undefined);
}
@@ -124,6 +132,8 @@
LogHTML(contents);
else if (type === "SetCookie")
SetCookie(contents);
+ else if (type === "ExecuteScript")
+ ExecuteScript(contents);
}
}

Powered by Google App Engine
This is Rietveld 408576698