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

Unified Diff: LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html

Issue 1190723002: Make AutocompleteErrorEventInit.reason be of type AutocompleteErrorReason (not DOMString) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | LayoutTests/fast/events/constructors/autocomplete-error-event-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html b/LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html
index bb8cb7f5c931beeac274f9cf916b0beffd9e350a..7b0006ffafa9435cc804a5856bbcd60f493a520e 100644
--- a/LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/autocomplete-error-event-constructor.html
@@ -26,24 +26,24 @@ if (!window.AutocompleteErrorEvent) {
shouldBe("new AutocompleteErrorEvent('eventType', { cancelable: true }).cancelable", "true");
// reason is passed.
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 'doremi' }).reason", "doremi");
+ shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 'cancel' }).reason", "cancel");
shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: '' }).reason", "");
+ shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 'disabled' }).reason", "disabled");
+ shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 'invalid' }).reason", "invalid");
shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: undefined }).reason", "");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: null }).reason", "null");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: false }).reason", "false");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: true }).reason", "true");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 12345 }).reason", "12345");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: 18446744073709551615 }).reason", "18446744073709552000");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: NaN }).reason", "NaN");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: [] }).reason", "");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: [1, 2, 3] }).reason", "1,2,3");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: {doremi: 12345} }).reason", "[object Object]");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { reason: {valueOf: function () { return 'doremi'; } } }).reason", "[object Object]");
+
+ // Invalid reason throws exception
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: 'doremi' })");
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: null })");
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: false })");
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: true })");
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: 12345 })");
+ shouldThrow("new AutocompleteErrorEvent('eventType', { reason: NaN })");
// All initializers are passed.
- shouldBe("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: 'doremi' }).bubbles", "true");
- shouldBe("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: 'doremi' }).cancelable", "true");
- shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: 'doremi' }).reason", "doremi");
+ shouldBe("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: '' }).bubbles", "true");
+ shouldBe("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: 'cancel' }).cancelable", "true");
+ shouldBeEqualToString("new AutocompleteErrorEvent('eventType', { bubbles: true, cancelable: true, reason: 'disabled' }).reason", "disabled");
}
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/constructors/autocomplete-error-event-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698