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:
parent
ad8fc9c36b
commit
510c3e7ba7
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user