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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 955413002: Log in Binding code for invalid enum type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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: Source/bindings/tests/results/core/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface.cpp b/Source/bindings/tests/results/core/V8TestInterface.cpp
index 26d2ea31b127387aa168166356cc048ed909c438..e5609980a7ad58526f261868e8fe3dde3c5dced5 100644
--- a/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -34,6 +34,7 @@
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/UseCounter.h"
+#include "core/inspector/ConsoleMessage.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
@@ -281,8 +282,10 @@ static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
if (!cppValue.prepare())
return;
String string = cppValue;
- if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3"))
+ if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) {
+ currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'TestEnum'."));
return;
+ }
impl->setTestEnumAttribute(cppValue);
}
@@ -960,8 +963,10 @@ static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value>
if (!cppValue.prepare())
return;
String string = cppValue;
- if (!(string == "foo" || string == "bar"))
+ if (!(string == "foo" || string == "bar")) {
+ currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'PartialEnumType'."));
return;
+ }
TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue);
}
#endif // ENABLE(PARTIAL_CONDITION)

Powered by Google App Engine
This is Rietveld 408576698