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

Side by Side Diff: LayoutTests/fast/events/constructors/storage-event-constructor.html

Issue 85263002: Improve handling of dictionary conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have conversion methods take a context argument; elaborate error msgs further. Created 7 years 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 shouldBeEqualToString("new StorageEvent('eventType', { " + attr + ": {valueO f: function () { return 'abcde'; } } })." + attr, "[object Object]"); 49 shouldBeEqualToString("new StorageEvent('eventType', { " + attr + ": {valueO f: function () { return 'abcde'; } } })." + attr, "[object Object]");
50 }); 50 });
51 51
52 // storageArea is passed. 52 // storageArea is passed.
53 // Storage objects. 53 // Storage objects.
54 shouldBe("new StorageEvent('eventType', { storageArea: localStorage }).storageAr ea", "localStorage"); 54 shouldBe("new StorageEvent('eventType', { storageArea: localStorage }).storageAr ea", "localStorage");
55 shouldBe("new StorageEvent('eventType', { storageArea: sessionStorage }).storage Area", "sessionStorage"); 55 shouldBe("new StorageEvent('eventType', { storageArea: sessionStorage }).storage Area", "sessionStorage");
56 56
57 // Non-Storage objects. 57 // Non-Storage objects.
58 var test_object = {abc: 123}; 58 var test_object = {abc: 123};
59 shouldBe("new StorageEvent('eventType', { storageArea: test_object }).storageAre a", "null"); 59 shouldThrow("new StorageEvent('eventType', { storageArea: test_object }).storage Area");
60 shouldBe("new StorageEvent('eventType', { storageArea: window }).storageArea", " null"); 60 shouldThrow("new StorageEvent('eventType', { storageArea: window }).storageArea" );
61 shouldBe("new StorageEvent('eventType', { storageArea: document }).storageArea", "null"); 61 shouldThrow("new StorageEvent('eventType', { storageArea: document }).storageAre a");
62 shouldBe("new StorageEvent('eventType', { storageArea: undefined }).storageArea" , "null"); 62 shouldBe("new StorageEvent('eventType', { storageArea: undefined }).storageArea" , "null");
63 shouldBe("new StorageEvent('eventType', { storageArea: null }).storageArea", "nu ll"); 63 shouldBe("new StorageEvent('eventType', { storageArea: null }).storageArea", "nu ll");
64 shouldBe("new StorageEvent('eventType', { storageArea: false }).storageArea", "n ull"); 64 shouldThrow("new StorageEvent('eventType', { storageArea: false }).storageArea") ;
65 shouldBe("new StorageEvent('eventType', { storageArea: true }).storageArea", "nu ll"); 65 shouldThrow("new StorageEvent('eventType', { storageArea: true }).storageArea");
66 shouldBe("new StorageEvent('eventType', { storageArea: '' }).storageArea", "null "); 66 shouldThrow("new StorageEvent('eventType', { storageArea: '' }).storageArea");
67 shouldBe("new StorageEvent('eventType', { storageArea: 'chocolate' }).storageAre a", "null"); 67 shouldThrow("new StorageEvent('eventType', { storageArea: 'chocolate' }).storage Area");
68 shouldBe("new StorageEvent('eventType', { storageArea: 12345 }).storageArea", "n ull"); 68 shouldThrow("new StorageEvent('eventType', { storageArea: 12345 }).storageArea") ;
69 shouldBe("new StorageEvent('eventType', { storageArea: 18446744073709551615 }).s torageArea", "null"); 69 shouldThrow("new StorageEvent('eventType', { storageArea: 18446744073709551615 } ).storageArea");
70 shouldBe("new StorageEvent('eventType', { storageArea: NaN }).storageArea", "nul l"); 70 shouldThrow("new StorageEvent('eventType', { storageArea: NaN }).storageArea");
71 // Note that valueOf() is not called, when the left hand side is evaluated. 71 // Note that valueOf() is not called, when the left hand side is evaluated.
72 shouldBeFalse("new StorageEvent('eventType', { storageArea: {valueOf: function ( ) { return window; } } }).storageArea == window"); 72 shouldThrow("new StorageEvent('eventType', { storageArea: {valueOf: function () { return window; } } }).storageArea == window");
73 shouldBe("new StorageEvent('eventType', { get storageArea() { return 123; } }).s torageArea", "null"); 73 shouldBe("new StorageEvent('eventType', { get storageArea() { return localStorag e; } }).storageArea", "localStorage");
74 shouldThrow("new StorageEvent('eventType', { get storageArea() { return 123; } } ).storageArea");
74 shouldThrow("new StorageEvent('eventType', { get storageArea() { throw 'StorageE vent Error'; } })"); 75 shouldThrow("new StorageEvent('eventType', { get storageArea() { throw 'StorageE vent Error'; } })");
75 76
76 // All initializers are passed. 77 // All initializers are passed.
77 shouldBe("new StorageEvent('eventType', { bubbles: true, cancelable: false, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage }).bubbles", "true"); 78 shouldBe("new StorageEvent('eventType', { bubbles: true, cancelable: false, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage }).bubbles", "true");
78 shouldBe("new StorageEvent('eventType', { bubbles: false, cancelable: true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage }).cancelable", "true"); 79 shouldBe("new StorageEvent('eventType', { bubbles: false, cancelable: true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage }).cancelable", "true");
79 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).key", "abc"); 80 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).key", "abc");
80 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).oldValue", "def"); 81 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).oldValue", "def");
81 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).newValue", "ghi"); 82 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).newValue", "ghi");
82 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).url", "jkl"); 83 shouldBeEqualToString("new StorageEvent('eventType', { bubbles: true, cancelable : true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: l ocalStorage }).url", "jkl");
83 shouldBe("new StorageEvent('eventType', { bubbles: true, cancelable: true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage } ).storageArea", "localStorage"); 84 shouldBe("new StorageEvent('eventType', { bubbles: true, cancelable: true, key: 'abc', oldValue: 'def', newValue: 'ghi', url: 'jkl', storageArea: localStorage } ).storageArea", "localStorage");
84 </script> 85 </script>
85 </body> 86 </body>
86 </html> 87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698