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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html

Issue 2255413004: IndexedDB: Avoid side effects by evaluating key paths w/ HasOwnProperty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | third_party/WebKit/LayoutTests/storage/indexeddb/key_conversion_exceptions.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html b/third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html
index 252179157e8463e8b0624ff037a50a8a266a02cb..8d43077da00469594867ad421872e99e06129115 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html
@@ -284,43 +284,41 @@ indexeddb_test(
// Value should be cloned before key path is evaluated,
// and non-enumerable getter will be ignored. The clone
- // will have no such property, so key path evaluation
- // will hit prototype property and rethrow.
+ // will have no own property, so key path evaluation will
+ // fail and DataError should be thrown.
var s1 = db.createObjectStore('s1',
{keyPath: 'throws'});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
+ assert_throws('DataError', with_proto_getter(function() {
s1.put({});
- }), 'Key path resolving to throwing getter rethrows');
+ }), 'Key path resolving to no own property throws DataError');
// Value should be cloned before key path is evaluated,
// and non-enumerable getter will be ignored. The clone
- // will have no such property, so key path evaluation
- // will hit prototype property and rethrow.
+ // will have no own property, so key path evaluation will
+ // fail and DataError should be thrown.
var s2 = db.createObjectStore('s2',
{keyPath: 'throws.x'});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
+ assert_throws('DataError', with_proto_getter(function() {
s2.put({});
- }), 'Key path resolving past throwing getter rethrows');
+ }), 'Key path resolving past no own property throws DataError');
// Value should be cloned before key path is evaluated,
// and non-enumerable getter will be ignored. The clone
- // will have no such property, so key path evaluation
- // will hit prototype property and rethrow.
+ // will have no own property, so key path evaluation will
+ // fail and injection can succeed.
var s3 = db.createObjectStore('s3',
{keyPath: 'throws', autoIncrement: true});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
- s3.put({});
- }), 'Key injectability test at throwing getter rethrows');
+ assert_equals(s3.put({}).readyState, 'pending',
+ 'put should not throw due to inherited property');
// Value should be cloned before key path is evaluated,
// and non-enumerable getter will be ignored. The clone
- // will have no such property, so key path evaluation
- // will hit prototype property and rethrow.
+ // will have no own property, so key path evaluation will
+ // fail and injection can succeed.
var s4 = db.createObjectStore('s4',
{keyPath: 'throws.x', autoIncrement: true});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
- s4.put({});
- }), 'Key injectability test past throwing getter rethrows');
+ assert_equals(s4.put({}).readyState, 'pending',
+ 'put should not throw due to inherited property');
},
function(t, db) {
t.done();
@@ -347,37 +345,39 @@ indexeddb_test(
};
}
- // Value should be cloned before key path is evaluated,
- // and enumerable getter will rethrow.
+ // Value should be cloned before key path is evaluated.
+ // The clone will have no own property, so key path
+ // evaluation will fail and DataError should be thrown.
var s1 = db.createObjectStore('s1',
{keyPath: 'throws'});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
+ assert_throws('DataError', with_proto_getter(function() {
s1.put({});
- }), 'Key path resolving to throwing getter rethrows');
+ }), 'Key path resolving to no own property throws DataError');
- // Value should be cloned before key path is evaluated,
- // and enumerable getter will rethrow.
+ // Value should be cloned before key path is evaluated.
+ // The clone will have no own property, so key path
+ // evaluation will fail and DataError should be thrown.
var s2 = db.createObjectStore('s2',
{keyPath: 'throws.x'});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
+ assert_throws('DataError', with_proto_getter(function() {
s2.put({});
}), 'Key path resolving past throwing getter rethrows');
- // Value should be cloned before key path is evaluated,
- // and enumerable getter will rethrow.
+ // Value should be cloned before key path is evaluated.
+ // The clone will have no own property, so key path
+ // evaluation will fail and injection can succeed.
var s3 = db.createObjectStore('s3',
{keyPath: 'throws', autoIncrement: true});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
- s3.put({});
- }), 'Key injectability test at throwing getter rethrows');
+ assert_equals(s3.put({}).readyState, 'pending',
+ 'put should not throw due to inherited property');
- // Value should be cloned before key path is evaluated,
- // and enumerable getter will rethrow.
+ // Value should be cloned before key path is evaluated.
+ // The clone will have no own property, so key path
+ // evaluation will fail and injection can succeed.
var s4 = db.createObjectStore('s4',
{keyPath: 'throws.x', autoIncrement: true});
- assert_throws({name: 'getter'}, with_proto_getter(function() {
- s4.put({});
- }), 'Key injectability test past throwing getter rethrows');
+ assert_equals(s4.put({}).readyState, 'pending',
+ 'put should not throw due to inherited property');
},
function(t, db) {
t.done();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/indexeddb/key_conversion_exceptions.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698