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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html

Issue 1526183004: Prevent SharedArrayBuffer views from being used in bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some tests Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script>
5 <script> 5 <script>
6 6
7 test(() => { 7 test(() => {
8 var matrix = new DOMMatrixReadOnly(); 8 var matrix = new DOMMatrixReadOnly();
9 assert_identity_2d_matrix(matrix); 9 assert_identity_2d_matrix(matrix);
10 }, "DOMMatrixReadOnly constructor"); 10 }, "DOMMatrixReadOnly constructor");
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new Float32Array([1])); }, 170 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new Float32Array([1])); },
171 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements "); 171 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements ");
172 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new Float64Array([1])); }, 172 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new Float64Array([1])); },
173 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements "); 173 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements ");
174 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new Float32Array(65536)); }, 174 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new Float32Array(65536)); },
175 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements "); 175 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements ");
176 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new Float64Array(65536)); }, 176 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new Float64Array(65536)); },
177 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements "); 177 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements ");
178 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); 178 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size");
179 179
180 if (window.internals && internals.runtimeFlags.sharedArrayBufferEnabled && windo w.SharedArrayBuffer) {
181
182 test(() => {
183 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(ne w Float32Array(new SharedArrayBuffer(16))) },
184 "fromFloat32Array function should throw when passed a SharedArrayBuffer Fl oat32Array");
185 });
186
187 test(() => {
188 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(ne w Float64Array(new SharedArrayBuffer(16))) },
189 "fromFloat64Array function should throw when passed a SharedArrayBuffer Fl oat64Array");
190 });
191 }
192
180 test(() => { 193 test(() => {
181 var matrix = DOMMatrixReadOnly.fromMatrix(); 194 var matrix = DOMMatrixReadOnly.fromMatrix();
182 assert_identity_2d_matrix(matrix); 195 assert_identity_2d_matrix(matrix);
183 }, "DOMMatrixReadOnly.fromMatrix() with no parameter"); 196 }, "DOMMatrixReadOnly.fromMatrix() with no parameter");
184 197
185 test(() => { 198 test(() => {
186 var matrix = DOMMatrixReadOnly.fromMatrix(null); 199 var matrix = DOMMatrixReadOnly.fromMatrix(null);
187 assert_identity_2d_matrix(matrix); 200 assert_identity_2d_matrix(matrix);
188 }, "DOMMatrixReadOnly.fromMatrix() with null"); 201 }, "DOMMatrixReadOnly.fromMatrix() with null");
189 202
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 test(() => { 239 test(() => {
227 assert_throws(new TypeError(), () => { 240 assert_throws(new TypeError(), () => {
228 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); 241 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true});
229 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); 242 }, "The 'is2D' property is set to true but the input matrix is 3d matrix");
230 assert_throws(new TypeError(), () => { 243 assert_throws(new TypeError(), () => {
231 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); 244 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3});
232 }, "The 'a' property should equal the 'm11' property"); 245 }, "The 'a' property should equal the 'm11' property");
233 }, "DOMMatrixReadOnly.fromMatrix(): Exception test"); 246 }, "DOMMatrixReadOnly.fromMatrix(): Exception test");
234 247
235 </script> 248 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698