JSLoad Test Page
Test dependency structures:
In the diagram below, children in the tree depend on their parents.
C is marked (loaded), meaning that it has already been loaded by an
outside library. The (tag) marker denotes a tag, meaning that that
label does not correspond with a source file. Rather, it's an
arbitrary label for marking a dependency on B and C.
A A
|___ |___
| | | |
B C(loaded) F G(tag)
|___| |___|
| |
D H(tag)
|
|
I
Tests:
-
Test
getSrcToLoad(["X"])
for all tags:
- Test A.
- Test B.
- Test C.
- Test D.
- Test F.
- Test G(tag).
- Test H(tag).
- Test I.
-
Test actual load of H using a callback:
- A is loaded.
- F is loaded.
- Scripts loaded with appended version parameter.
-
With H already loaded, make sure that loaded libs are kept track
of and not re-loaded:
-
Test D, using
getSrcToLoad()
. A should not be loaded.
-
Test actual load of D within ajax update.
-
Reload of D doesn't load anything, but callback is still fired.
-
Race condition and queue testing:
-
If I is loaded twice in a row, the first load will not have
completed before the second one is attempted.
-
However, the second attempt (modeled with a
getSrcToLoad()
) will not actually do the load.
-
When I attempts loading, F should not have finished loading, yet.
-
By the time I is loaded, F should have finished loading.
Ajax-updated div: