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

Unified Diff: Source/bindings/v8/IDBBindingUtilitiesTest.cpp

Issue 310423002: Remove the remaining ScriptState::current etc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/bindings/v8/V8Callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/IDBBindingUtilitiesTest.cpp
diff --git a/Source/bindings/v8/IDBBindingUtilitiesTest.cpp b/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
index e9f48d5fae5f77f1fb283bc1714a5f2f87b9ed57..8b79e97650f0df8b3e3c17743bc10c9595bc1b53 100644
--- a/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
+++ b/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
@@ -93,6 +93,9 @@ public:
: m_scope(v8::Isolate::GetCurrent())
{
}
+
+ ScriptState* scriptState() const { return m_scope.scriptState(); }
+
private:
V8TestingScope m_scope;
};
@@ -103,7 +106,7 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
v8::Local<v8::Object> object = v8::Object::New(isolate);
object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"));
- ScriptValue scriptValue(ScriptState::current(isolate), object);
+ ScriptValue scriptValue(scriptState(), object);
checkKeyPathStringValue(isolate, scriptValue, "foo", "zoo");
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -115,7 +118,7 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
v8::Local<v8::Object> object = v8::Object::New(isolate);
object->Set(v8AtomicString(isolate, "foo"), v8::Number::New(isolate, 456));
- ScriptValue scriptValue(ScriptState::current(isolate), object);
+ ScriptValue scriptValue(scriptState(), object);
checkKeyPathNumberValue(isolate, scriptValue, "foo", 456);
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -129,7 +132,7 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty)
subProperty->Set(v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"));
object->Set(v8AtomicString(isolate, "foo"), subProperty);
- ScriptValue scriptValue(ScriptState::current(isolate), object);
+ ScriptValue scriptValue(scriptState(), object);
checkKeyPathStringValue(isolate, scriptValue, "foo.bar", "zee");
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -141,36 +144,34 @@ class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest {
TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
- ScriptState* scriptState = ScriptState::current(isolate);
v8::Local<v8::Object> object = v8::Object::New(isolate);
object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"));
- ScriptValue foozoo(scriptState, object);
- checkInjection(scriptState, IDBKey::createString("myNewKey"), foozoo, "bar");
- checkInjection(scriptState, IDBKey::createNumber(1234), foozoo, "bar");
+ ScriptValue foozoo(scriptState(), object);
+ checkInjection(scriptState(), IDBKey::createString("myNewKey"), foozoo, "bar");
+ checkInjection(scriptState(), IDBKey::createNumber(1234), foozoo, "bar");
- checkInjectionFails(scriptState, IDBKey::createString("key"), foozoo, "foo.bar");
+ checkInjectionFails(scriptState(), IDBKey::createString("key"), foozoo, "foo.bar");
}
TEST_F(InjectIDBKeyTest, SubProperty)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
- ScriptState* scriptState = ScriptState::current(isolate);
v8::Local<v8::Object> object = v8::Object::New(isolate);
v8::Local<v8::Object> subProperty = v8::Object::New(isolate);
subProperty->Set(v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"));
object->Set(v8AtomicString(isolate, "foo"), subProperty);
- ScriptValue scriptObject(scriptState, object);
- checkInjection(scriptState, IDBKey::createString("myNewKey"), scriptObject, "foo.baz");
- checkInjection(scriptState, IDBKey::createNumber(789), scriptObject, "foo.baz");
- checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "foo.baz");
- checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "bar");
- checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.baz");
- checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar");
+ ScriptValue scriptObject(scriptState(), object);
+ checkInjection(scriptState(), IDBKey::createString("myNewKey"), scriptObject, "foo.baz");
+ checkInjection(scriptState(), IDBKey::createNumber(789), scriptObject, "foo.baz");
+ checkInjection(scriptState(), IDBKey::createDate(4567), scriptObject, "foo.baz");
+ checkInjection(scriptState(), IDBKey::createDate(4567), scriptObject, "bar");
+ checkInjection(scriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.baz");
+ checkInjection(scriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar");
- checkInjectionFails(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.bar.baz");
- checkInjection(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo");
+ checkInjectionFails(scriptState(), IDBKey::createString("zoo"), scriptObject, "foo.bar.baz");
+ checkInjection(scriptState(), IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo");
}
} // namespace
« no previous file with comments | « no previous file | Source/bindings/v8/V8Callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698