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

Unified Diff: extensions/renderer/bindings/argument_spec_unittest.cc

Issue 2947223003: [Extensions Bindings] Consider argument type more in signature parsing (Closed)
Patch Set: rebase Created 3 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 | « extensions/renderer/bindings/argument_spec.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/bindings/argument_spec_unittest.cc
diff --git a/extensions/renderer/bindings/argument_spec_unittest.cc b/extensions/renderer/bindings/argument_spec_unittest.cc
index 85a0a707577df617a3a62cdd2a9b3d0cd30936e2..a12b487510488e157140842c45e512b1a7aac6af 100644
--- a/extensions/renderer/bindings/argument_spec_unittest.cc
+++ b/extensions/renderer/bindings/argument_spec_unittest.cc
@@ -483,7 +483,8 @@ TEST_F(ArgumentSpecUnitTest, TypeChoicesTest) {
ArgumentSpec spec(*ValueFromString(kSimpleChoices));
ExpectSuccess(spec, "'alpha'", "'alpha'");
ExpectSuccess(spec, "42", "42");
- ExpectFailure(spec, "true", InvalidChoice());
+ const char kChoicesType[] = "[string|integer]";
+ ExpectFailure(spec, "true", InvalidType(kChoicesType, kTypeBoolean));
}
{
@@ -498,9 +499,11 @@ TEST_F(ArgumentSpecUnitTest, TypeChoicesTest) {
ExpectSuccess(spec, "['alpha']", "['alpha']");
ExpectSuccess(spec, "['alpha', 'beta']", "['alpha','beta']");
ExpectSuccess(spec, "({prop1: 'alpha'})", "{'prop1':'alpha'}");
+
+ const char kChoicesType[] = "[array|object]";
ExpectFailure(spec, "({prop1: 1})", InvalidChoice());
- ExpectFailure(spec, "'alpha'", InvalidChoice());
- ExpectFailure(spec, "42", InvalidChoice());
+ ExpectFailure(spec, "'alpha'", InvalidType(kChoicesType, kTypeString));
+ ExpectFailure(spec, "42", InvalidType(kChoicesType, kTypeInteger));
}
}
« no previous file with comments | « extensions/renderer/bindings/argument_spec.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698