Commit c40f3141 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Renamed a local class Function in a test to not collide with WTF.

There is a Function<> template in WTF/Functional.h which is shadowed
or collides with any local definitions of Function. This is not always
a problem, but it caused problems in Jumbo builds so let us rename
it to something harmless.

Change-Id: Ib594b2673a1dce6b4647445d3377b1e1099849da
Reviewed-on: https://chromium-review.googlesource.com/563667
Commit-Queue: bratell at Opera <bratell@opera.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485273}
parent 90162167
...@@ -19,16 +19,16 @@ namespace blink { ...@@ -19,16 +19,16 @@ namespace blink {
namespace { namespace {
class Function : public ScriptFunction { class TestHelperFunction : public ScriptFunction {
public: public:
static v8::Local<v8::Function> CreateFunction(ScriptState* script_state, static v8::Local<v8::Function> CreateFunction(ScriptState* script_state,
String* value) { String* value) {
Function* self = new Function(script_state, value); TestHelperFunction* self = new TestHelperFunction(script_state, value);
return self->BindToV8Function(); return self->BindToV8Function();
} }
private: private:
Function(ScriptState* script_state, String* value) TestHelperFunction(ScriptState* script_state, String* value)
: ScriptFunction(script_state), value_(value) {} : ScriptFunction(script_state), value_(value) {}
ScriptValue Call(ScriptValue value) override { ScriptValue Call(ScriptValue value) override {
...@@ -80,8 +80,9 @@ TEST_F(ScriptPromiseResolverTest, resolve) { ...@@ -80,8 +80,9 @@ TEST_F(ScriptPromiseResolverTest, resolve) {
ASSERT_FALSE(promise.IsEmpty()); ASSERT_FALSE(promise.IsEmpty());
{ {
ScriptState::Scope scope(GetScriptState()); ScriptState::Scope scope(GetScriptState());
promise.Then(Function::CreateFunction(GetScriptState(), &on_fulfilled), promise.Then(
Function::CreateFunction(GetScriptState(), &on_rejected)); TestHelperFunction::CreateFunction(GetScriptState(), &on_fulfilled),
TestHelperFunction::CreateFunction(GetScriptState(), &on_rejected));
} }
EXPECT_EQ(String(), on_fulfilled); EXPECT_EQ(String(), on_fulfilled);
...@@ -128,8 +129,9 @@ TEST_F(ScriptPromiseResolverTest, reject) { ...@@ -128,8 +129,9 @@ TEST_F(ScriptPromiseResolverTest, reject) {
ASSERT_FALSE(promise.IsEmpty()); ASSERT_FALSE(promise.IsEmpty());
{ {
ScriptState::Scope scope(GetScriptState()); ScriptState::Scope scope(GetScriptState());
promise.Then(Function::CreateFunction(GetScriptState(), &on_fulfilled), promise.Then(
Function::CreateFunction(GetScriptState(), &on_rejected)); TestHelperFunction::CreateFunction(GetScriptState(), &on_fulfilled),
TestHelperFunction::CreateFunction(GetScriptState(), &on_rejected));
} }
EXPECT_EQ(String(), on_fulfilled); EXPECT_EQ(String(), on_fulfilled);
...@@ -176,8 +178,9 @@ TEST_F(ScriptPromiseResolverTest, stop) { ...@@ -176,8 +178,9 @@ TEST_F(ScriptPromiseResolverTest, stop) {
ASSERT_FALSE(promise.IsEmpty()); ASSERT_FALSE(promise.IsEmpty());
{ {
ScriptState::Scope scope(GetScriptState()); ScriptState::Scope scope(GetScriptState());
promise.Then(Function::CreateFunction(GetScriptState(), &on_fulfilled), promise.Then(
Function::CreateFunction(GetScriptState(), &on_rejected)); TestHelperFunction::CreateFunction(GetScriptState(), &on_fulfilled),
TestHelperFunction::CreateFunction(GetScriptState(), &on_rejected));
} }
GetExecutionContext()->NotifyContextDestroyed(); GetExecutionContext()->NotifyContextDestroyed();
...@@ -316,8 +319,9 @@ TEST_F(ScriptPromiseResolverTest, resolveVoid) { ...@@ -316,8 +319,9 @@ TEST_F(ScriptPromiseResolverTest, resolveVoid) {
ASSERT_FALSE(promise.IsEmpty()); ASSERT_FALSE(promise.IsEmpty());
{ {
ScriptState::Scope scope(GetScriptState()); ScriptState::Scope scope(GetScriptState());
promise.Then(Function::CreateFunction(GetScriptState(), &on_fulfilled), promise.Then(
Function::CreateFunction(GetScriptState(), &on_rejected)); TestHelperFunction::CreateFunction(GetScriptState(), &on_fulfilled),
TestHelperFunction::CreateFunction(GetScriptState(), &on_rejected));
} }
resolver->Resolve(); resolver->Resolve();
...@@ -340,8 +344,9 @@ TEST_F(ScriptPromiseResolverTest, rejectVoid) { ...@@ -340,8 +344,9 @@ TEST_F(ScriptPromiseResolverTest, rejectVoid) {
ASSERT_FALSE(promise.IsEmpty()); ASSERT_FALSE(promise.IsEmpty());
{ {
ScriptState::Scope scope(GetScriptState()); ScriptState::Scope scope(GetScriptState());
promise.Then(Function::CreateFunction(GetScriptState(), &on_fulfilled), promise.Then(
Function::CreateFunction(GetScriptState(), &on_rejected)); TestHelperFunction::CreateFunction(GetScriptState(), &on_fulfilled),
TestHelperFunction::CreateFunction(GetScriptState(), &on_rejected));
} }
resolver->Reject(); resolver->Reject();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment