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

Side by Side Diff: third_party/WebKit/LayoutTests/animations/function-easing-use-counters-linear.html

Issue 1851003002: Throw TypeError if easing string is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix "liner"->"linear" typo in ui/file_manager js file Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other1.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> 4 <script>
5 'use strict'; 5 'use strict';
6 // From UseCounter.h 6 // From UseCounter.h
7 var WebAnimationsEasingAsFunctionLinear = 1295; 7 var WebAnimationsEasingAsFunctionLinear = 1295;
8 var WebAnimationsEasingAsFunctionOther = 1296; 8 var WebAnimationsEasingAsFunctionOther = 1296;
9 9
10 test(() => { 10 test(() => {
11 document.documentElement.animate([], { }); 11 document.documentElement.animate([], { });
12 document.documentElement.animate([], { easing: 'linear' }); 12 document.documentElement.animate([], { easing: 'linear' });
13 document.documentElement.animate([], { easing: 'step-start' }); 13 document.documentElement.animate([], { easing: 'step-start' });
14 document.documentElement.animate([], { easing: 'invalid' });
15 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLin ear)); 14 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLin ear));
16 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth er)); 15 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth er));
17 }, 'Non-function values for easing are not use-counted.'); 16 }, 'Non-function values for easing are not use-counted.');
18 17
19 test(() => { 18 test(() => {
19 assert_throws(
20 {name: 'TypeError'},
21 function() { document.documentElement.animate([], { easing: 'invalid' }) } );
22 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLin ear));
23 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth er));
24 }, 'Invalid non-function values for easing are not use-counted.');
25
26 test(() => {
20 // This linear function value is the one expected from uses of the unpatched 27 // This linear function value is the one expected from uses of the unpatched
21 // Web Animations polyfill (i.e. old versions lacking 28 // Web Animations polyfill (i.e. old versions lacking
22 // https://github.com/web-animations/web-animations-next/pull/423). 29 // https://github.com/web-animations/web-animations-next/pull/423).
23 document.documentElement.animate([], { easing: 'function (a){return a}' }); 30 document.documentElement.animate([], { easing: 'function (a){return a}' });
24 assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLine ar)); 31 assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLine ar));
25 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth er)); 32 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth er));
26 }, 'A specific linear function for easing is counted in WebAnimationsEasingAsFun ctionLinear.'); 33 }, 'A specific linear function for easing is counted in WebAnimationsEasingAsFun ctionLinear.');
27 </script> 34 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/function-easing-use-counters-other1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698