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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 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: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
index a2dacf1f7b93f3f7df577c1b52b88a46ff8a44b5..25d91f5ad41cf50e17b2bf64751151a433efbed3 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
@@ -105,7 +105,7 @@ public:
{
}
- ScriptState* scriptState() const { return m_scope.scriptState(); }
+ ScriptState* getScriptState() const { return m_scope.getScriptState(); }
private:
V8TestingScope m_scope;
@@ -113,13 +113,13 @@ private:
TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
// object = { foo: "zoo" }
v8::Local<v8::Object> object = v8::Object::New(isolate);
- ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"))));
+ ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"))));
- ScriptValue scriptValue(scriptState(), object);
+ ScriptValue scriptValue(getScriptState(), object);
checkKeyPathStringValue(isolate, scriptValue, "foo", "zoo");
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -127,13 +127,13 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
// object = { foo: 456 }
v8::Local<v8::Object> object = v8::Object::New(isolate);
- ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8::Number::New(isolate, 456))));
+ ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8::Number::New(isolate, 456))));
- ScriptValue scriptValue(scriptState(), object);
+ ScriptValue scriptValue(getScriptState(), object);
checkKeyPathNumberValue(isolate, scriptValue, "foo", 456);
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -141,15 +141,15 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
// object = { foo: { bar: "zee" } }
v8::Local<v8::Object> object = v8::Object::New(isolate);
v8::Local<v8::Object> subProperty = v8::Object::New(isolate);
- ASSERT_TRUE(v8CallBoolean(subProperty->Set(scriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"))));
- ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), subProperty)));
+ ASSERT_TRUE(v8CallBoolean(subProperty->Set(getScriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"))));
+ ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), subProperty)));
- ScriptValue scriptValue(scriptState(), object);
+ ScriptValue scriptValue(getScriptState(), object);
checkKeyPathStringValue(isolate, scriptValue, "foo.bar", "zee");
checkKeyPathNullValue(isolate, scriptValue, "bar");
@@ -160,54 +160,54 @@ class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest {
TEST_F(InjectIDBKeyTest, ImplicitValues)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
{
v8::Local<v8::String> string = v8String(isolate, "string");
- ScriptValue value = ScriptValue(scriptState(), string);
- checkInjectionIgnored(scriptState(), IDBKey::createNumber(123), value, "length");
+ ScriptValue value = ScriptValue(getScriptState(), string);
+ checkInjectionIgnored(getScriptState(), IDBKey::createNumber(123), value, "length");
}
{
v8::Local<v8::Array> array = v8::Array::New(isolate);
- ScriptValue value = ScriptValue(scriptState(), array);
- checkInjectionIgnored(scriptState(), IDBKey::createNumber(456), value, "length");
+ ScriptValue value = ScriptValue(getScriptState(), array);
+ checkInjectionIgnored(getScriptState(), IDBKey::createNumber(456), value, "length");
}
}
TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
// object = { foo: "zoo" }
v8::Local<v8::Object> object = v8::Object::New(isolate);
- ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"))));
+ ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"))));
- ScriptValue scriptObject(scriptState(), object);
- checkInjection(scriptState(), IDBKey::createString("myNewKey"), scriptObject, "bar");
- checkInjection(scriptState(), IDBKey::createNumber(1234), scriptObject, "bar");
+ ScriptValue scriptObject(getScriptState(), object);
+ checkInjection(getScriptState(), IDBKey::createString("myNewKey"), scriptObject, "bar");
+ checkInjection(getScriptState(), IDBKey::createNumber(1234), scriptObject, "bar");
- checkInjectionDisallowed(scriptState(), scriptObject, "foo.bar");
+ checkInjectionDisallowed(getScriptState(), scriptObject, "foo.bar");
}
TEST_F(InjectIDBKeyTest, SubProperty)
{
- v8::Isolate* isolate = scriptState()->isolate();
+ v8::Isolate* isolate = getScriptState()->isolate();
// object = { foo: { bar: "zee" } }
v8::Local<v8::Object> object = v8::Object::New(isolate);
v8::Local<v8::Object> subProperty = v8::Object::New(isolate);
- ASSERT_TRUE(v8CallBoolean(subProperty->Set(scriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"))));
- ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), 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");
-
- checkInjectionDisallowed(scriptState(), scriptObject, "foo.bar.baz");
- checkInjection(scriptState(), IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo");
+ ASSERT_TRUE(v8CallBoolean(subProperty->Set(getScriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee"))));
+ ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), subProperty)));
+
+ ScriptValue scriptObject(getScriptState(), object);
+ checkInjection(getScriptState(), IDBKey::createString("myNewKey"), scriptObject, "foo.baz");
+ checkInjection(getScriptState(), IDBKey::createNumber(789), scriptObject, "foo.baz");
+ checkInjection(getScriptState(), IDBKey::createDate(4567), scriptObject, "foo.baz");
+ checkInjection(getScriptState(), IDBKey::createDate(4567), scriptObject, "bar");
+ checkInjection(getScriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.baz");
+ checkInjection(getScriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar");
+
+ checkInjectionDisallowed(getScriptState(), scriptObject, "foo.bar.baz");
+ checkInjection(getScriptState(), IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo");
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698