summaryrefslogtreecommitdiffstats
path: root/chrome/test/v8_unit_test.cc
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 14:25:39 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 14:25:39 +0000
commitaaadcd81066a3430b33702288cd56a39986b4326 (patch)
tree08f2f9e011880015dd47c669f4311f17faa55391 /chrome/test/v8_unit_test.cc
parent83e29c010812422515660e4a0b77f1738f238aec (diff)
downloadchromium_src-aaadcd81066a3430b33702288cd56a39986b4326.zip
chromium_src-aaadcd81066a3430b33702288cd56a39986b4326.tar.gz
chromium_src-aaadcd81066a3430b33702288cd56a39986b4326.tar.bz2
Add unit test that uses V8's JSON.parse() to read extension_api.json .
BUG=18717 TEST=ExtensionApiJsonValidityTest.WithV8 Review URL: http://codereview.chromium.org/661406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/v8_unit_test.cc')
-rw-r--r--chrome/test/v8_unit_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/test/v8_unit_test.cc b/chrome/test/v8_unit_test.cc
index 4b94ad9..0ac6c1f 100644
--- a/chrome/test/v8_unit_test.cc
+++ b/chrome/test/v8_unit_test.cc
@@ -14,6 +14,13 @@ void V8UnitTest::SetUp() {
context_ = v8::Context::New(NULL, global);
}
+void V8UnitTest::SetGlobalStringVar(const std::string& var_name,
+ const std::string& value) {
+ v8::Context::Scope context_scope(context_);
+ context_->Global()->Set(v8::String::New(var_name.c_str(), var_name.length()),
+ v8::String::New(value.c_str(), value.length()));
+}
+
void V8UnitTest::ExecuteScriptInContext(const base::StringPiece& script_source,
const base::StringPiece& script_name) {
v8::Context::Scope context_scope(context_);