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

Unified Diff: LayoutTests/imported/web-platform-tests/IndexedDB/key_invalid.htm

Issue 727883002: update-w3c-deps import using blink 7f8c8ee3e30dc15b7b821c627fc7ac32331d2253: (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 1 month 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: LayoutTests/imported/web-platform-tests/IndexedDB/key_invalid.htm
diff --git a/LayoutTests/imported/web-platform-tests/IndexedDB/key_invalid.htm b/LayoutTests/imported/web-platform-tests/IndexedDB/key_invalid.htm
deleted file mode 100644
index 2bfd7f6eadfbc768e46b96bc55a4476ff8ddf883..0000000000000000000000000000000000000000
--- a/LayoutTests/imported/web-platform-tests/IndexedDB/key_invalid.htm
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE html>
-<!-- Submitted from TestTWF Paris -->
-<meta charset=utf-8">
-<title>Invalid key</title>
-<link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#key-construct">
-<link rel=assert title="A value is said to be a valid key if it is one of the following types: Array JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float [WEBIDL]. However Arrays are only valid keys if every item in the array is defined and is a valid key (i.e. sparse arrays can not be valid keys) and if the Array doesn't directly or indirectly contain itself. Any non-numeric properties are ignored, and thus does not affect whether the Array is a valid key. Additionally, if the value is of type float, it is only a valid key if it is not NaN, and if the value is of type Date it is only a valid key if its [[PrimitiveValue]] internal property, as defined by [ECMA-262], is not NaN. Conforming user agents must support all valid keys as keys.">
-<!-- original author -->
-<link rel=author href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
-<!-- some additions by Baptiste Fontaine (batifon@yahoo.fr) -->
-<script src=../../../resources/testharness.js></script>
-<script src=../../../resources/testharnessreport.js></script>
-<script src=support.js></script>
-
-<script>
- var db = createdb_for_multiple_tests(),
- // cache for ObjectStores
- objStore = null,
- objStore2 = null;
-
- function invalid_key(desc, key) {
- var t = async_test(document.title + " - " + desc);
-
- // set the current test, and run it
- db.setTest(t).onupgradeneeded = function(e) {
- objStore = objStore || e.target.result.createObjectStore("store");
- assert_throws('DataError', function() {
- objStore.add("value", key);
- });
-
- objStore2 = objStore2 || e.target.result.createObjectStore("store2", { keyPath: ["x", "keypath"] });
- assert_throws('DataError', function() {
- objStore2.add({ x: "value", keypath: key });
- });
-
- this.done();
- };
- }
-
- var fake_array = {
- length : 0,
- constructor : Array
- };
-
- var ArrayClone = function(){};
- ArrayClone.prototype = Array;
- var ArrayClone_instance = new ArrayClone();
-
- // booleans
- invalid_key( 'true' , true );
- invalid_key( 'false' , false );
-
- // null/NaN/undefined
- invalid_key( 'null' , null );
- invalid_key( 'NaN' , NaN );
- invalid_key( 'undefined' , undefined );
- invalid_key( 'undefined2');
-
- // functions
- invalid_key( 'function() {}', function(){} );
-
- // objects
- invalid_key( '{}' , {} );
- invalid_key( '{ obj: 1 }' , { obj: 1 });
- invalid_key( 'Math' , Math );
- invalid_key( 'window' , window );
- invalid_key( '{length:0,constructor:Array}' , fake_array );
- invalid_key( 'Array clone’s instance' , ArrayClone_instance );
- invalid_key( 'Array (object)' , Array );
- invalid_key( 'String (object)' , String );
- invalid_key( 'new String()' , new String() );
- invalid_key( 'new Number()' , new Number() );
- invalid_key( 'new Boolean()' , new Boolean() );
-
- // arrays
- invalid_key( '[{}]' , [{}] );
- invalid_key( '[[], [], [], [[ Date ]]]' , [ [], [], [], [[ Date ]] ] );
- invalid_key( '[undefined]' , [undefined] );
- invalid_key( '[,1]' , [,1] );
-
- invalid_key( 'document.getElements'
- +'ByTagName("script")' , document.getElementsByTagName("script") );
-
- // dates
- invalid_key( 'new Date(NaN)' , new Date(NaN) );
- invalid_key( 'new Date(Infinity)' , new Date(Infinity) );
-
- // regexes
- invalid_key( '/foo/' , /foo/ );
- invalid_key( 'new RegExp()' , new RegExp() );
-
- var sparse = [];
- sparse[10] = "hei";
- invalid_key('sparse array', sparse);
-
- var sparse2 = [];
- sparse2[0] = 1;
- sparse2[""] = 2;
- sparse2[2] = 3;
- invalid_key('sparse array 2', sparse2);
-
- invalid_key('[[1], [3], [7], [[ sparse array ]]]', [ [1], [3], [7], [[ sparse2 ]] ]);
-
- // sparse3
- invalid_key( '[1,2,3,,]', [1,2,3,,] );
-
- var recursive = [];
- recursive.push(recursive);
- invalid_key('array directly contains self', recursive);
-
- var recursive2 = [];
- recursive2.push([recursive2]);
- invalid_key('array indirectly contains self', recursive2);
-
- var recursive3 = [recursive];
- invalid_key('array member contains self', recursive3);
-
-</script>
-
-<div id=log></div>

Powered by Google App Engine
This is Rietveld 408576698