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

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

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 years, 8 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.SharedArrayBuffer) {
181 test(() => {
182 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(ne w Float32Array(new SharedArrayBuffer(24))); },
183 "");
184 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(ne w Float64Array(new SharedArrayBuffer(32))); },
185 "");
186 }, "DOMMatrixReadOnly fromFloat*Array - can't use SharedArrayBuffer view");
187 }
188
180 test(() => { 189 test(() => {
181 var matrix = DOMMatrixReadOnly.fromMatrix(); 190 var matrix = DOMMatrixReadOnly.fromMatrix();
182 assert_identity_2d_matrix(matrix); 191 assert_identity_2d_matrix(matrix);
183 }, "DOMMatrixReadOnly.fromMatrix() with no parameter"); 192 }, "DOMMatrixReadOnly.fromMatrix() with no parameter");
184 193
185 test(() => { 194 test(() => {
186 var matrix = DOMMatrixReadOnly.fromMatrix(null); 195 var matrix = DOMMatrixReadOnly.fromMatrix(null);
187 assert_identity_2d_matrix(matrix); 196 assert_identity_2d_matrix(matrix);
188 }, "DOMMatrixReadOnly.fromMatrix() with null"); 197 }, "DOMMatrixReadOnly.fromMatrix() with null");
189 198
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 test(() => { 235 test(() => {
227 assert_throws(new TypeError(), () => { 236 assert_throws(new TypeError(), () => {
228 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); 237 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"); 238 }, "The 'is2D' property is set to true but the input matrix is 3d matrix");
230 assert_throws(new TypeError(), () => { 239 assert_throws(new TypeError(), () => {
231 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); 240 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3});
232 }, "The 'a' property should equal the 'm11' property"); 241 }, "The 'a' property should equal the 'm11' property");
233 }, "DOMMatrixReadOnly.fromMatrix(): Exception test"); 242 }, "DOMMatrixReadOnly.fromMatrix(): Exception test");
234 243
235 </script> 244 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698