| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- runTests([
- // Test 1
- function() {
- var count = 0;
- SVGInject.create('SVGInject1', {
- afterLoad: fail,
- onFail: function(img, status) {
- if (status === 'SVG_NOT_SUPPORTED') {
- ++count;
- if (count > 9) {
- fail();
- } else if (count == 9) {
- success();
- }
- } else {
- fail();
- }
- }
- });
- },
- // Test 2
- function() {
- var count = 0;
- SVGInject.create('SVGInject2', {
- afterLoad: fail,
- onFail: function(img, status) {
- if (status === 'SVG_NOT_SUPPORTED') {
- img.src = img.src.slice(0, -4) + ".png";
- ++count;
- if (count > 9) {
- fail();
- } else if (count == 9) {
- success();
- }
- } else {
- fail();
- }
- }
- });
- },
- // Test 3
- function() {
- var count = 0;
- SVGInject.create('SVGInject3', {
- afterLoad: fail,
- onFail: function(img, status) {
- if (status === 'SVG_NOT_SUPPORTED') {
- img.src = img.src.slice(0, -4) + ".png";
-
- ++count;
- if (count > 9) {
- fail();
- } else if (count == 9) {
- success();
- }
- } else {
- fail();
- }
- }
- });
- domReady(function() {
- SVGInject3(document.getElementById('test-3').getElementsByTagName('img'));
- });
- },
- // Test 4
- function() {
- var count = 0;
- SVGInject.create('SVGInject4', {
- beforeLoad: fail,
- afterLoad: fail,
- beforeInject: fail,
- afterInject: fail,
- onFail: function(img, status) {
- if (status === 'SVG_NOT_SUPPORTED') {
- if (++count == 6) {
- success();
- } else if (count > 6) {
- fail();
- }
- } else {
- fail();
- }
- }
- });
- }
- ]);
|