Test(ImageOverlay+TileLayer): crossOrigin option add 5th test case (#6027)

when passing `crossOrigin: ''` (empty string) option, the `crossorigin` attribute should also be set an empty string value (valid keyword, with same effect as `"anonymous"` value). Need to add this test, because in JavaScript the empty string is a falsy value that could have been caught as `false` and led to no `crossorigin` attribute set.
This commit is contained in:
ghybs 2018-01-25 16:46:34 +04:00 committed by Andrew
parent ad8fc9c36b
commit 510c3e7ba7
2 changed files with 2 additions and 0 deletions

View File

@ -168,6 +168,7 @@ describe('ImageOverlay', function () {
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
testCrossOriginValue(undefined, null); // Falsy value (other than empty string '') => no attribute set. testCrossOriginValue(undefined, null); // Falsy value (other than empty string '') => no attribute set.
testCrossOriginValue(true, ''); testCrossOriginValue(true, '');
testCrossOriginValue('', '');
testCrossOriginValue('anonymous', 'anonymous'); testCrossOriginValue('anonymous', 'anonymous');
testCrossOriginValue('use-credentials', 'use-credentials'); testCrossOriginValue('use-credentials', 'use-credentials');

View File

@ -440,6 +440,7 @@ describe('TileLayer', function () {
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
testCrossOriginValue(undefined, null); // Falsy value (other than empty string '') => no attribute set. testCrossOriginValue(undefined, null); // Falsy value (other than empty string '') => no attribute set.
testCrossOriginValue(true, ''); testCrossOriginValue(true, '');
testCrossOriginValue('', '');
testCrossOriginValue('anonymous', 'anonymous'); testCrossOriginValue('anonymous', 'anonymous');
testCrossOriginValue('use-credentials', 'use-credentials'); testCrossOriginValue('use-credentials', 'use-credentials');