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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.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 test(() => { 6 test(() => {
7 var matrix = new DOMMatrix(); 7 var matrix = new DOMMatrix();
8 assert_identity_2d_matrix(matrix); 8 assert_identity_2d_matrix(matrix);
9 }, "DOMMatrix() constructor"); 9 }, "DOMMatrix() constructor");
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A rray([1])); }, 113 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A rray([1])); },
114 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements "); 114 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements ");
115 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A rray([1])); }, 115 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A rray([1])); },
116 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements "); 116 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements ");
117 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A rray(65536)); }, 117 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A rray(65536)); },
118 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements "); 118 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements ");
119 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A rray(65536)); }, 119 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A rray(65536)); },
120 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements "); 120 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements ");
121 }, "DOMMatrix fromFloat*Array - invalid array size"); 121 }, "DOMMatrix fromFloat*Array - invalid array size");
122 122
123 if (window.SharedArrayBuffer) {
124 test(() => {
125 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float3 2Array(new SharedArrayBuffer(24))); },
126 "");
127 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float6 4Array(new SharedArrayBuffer(32))); },
128 "");
129 }, "DOMMatrix fromFloat*Array - can't use SharedArrayBuffer view");
130 }
131
123 test(() => { 132 test(() => {
124 assert_identity_2d_matrix(DOMMatrix.fromMatrix()); 133 assert_identity_2d_matrix(DOMMatrix.fromMatrix());
125 }, "DOMMatrix.fromMatrix() with no parameter"); 134 }, "DOMMatrix.fromMatrix() with no parameter");
126 135
127 test(() => { 136 test(() => {
128 assert_identity_2d_matrix(DOMMatrix.fromMatrix(null)); 137 assert_identity_2d_matrix(DOMMatrix.fromMatrix(null));
129 }, "DOMMatrix.fromMatrix() with null"); 138 }, "DOMMatrix.fromMatrix() with null");
130 139
131 test(() => { 140 test(() => {
132 assert_identity_2d_matrix(DOMMatrix.fromMatrix(undefined)); 141 assert_identity_2d_matrix(DOMMatrix.fromMatrix(undefined));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 "using relative units should throw a SyntaxError"); 238 "using relative units should throw a SyntaxError");
230 assert_throws(new TypeError(), () => { 239 assert_throws(new TypeError(), () => {
231 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); 240 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true});
232 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); 241 }, "The 'is2D' property is set to true but the input matrix is 3d matrix");
233 assert_throws(new TypeError(), () => { 242 assert_throws(new TypeError(), () => {
234 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m11: 3}); 243 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m11: 3});
235 }, "The 'a' property should equal the 'm11' property"); 244 }, "The 'a' property should equal the 'm11' property");
236 }, "DOMMatrix.fromMatrix(): Exception test"); 245 }, "DOMMatrix.fromMatrix(): Exception test");
237 246
238 </script> 247 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698