JSLoad

Doc : 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. G is a tag, for example, so it depends on source file A, but is not a source file itself.

        A                   A
        |                   |___
        |                   |   |
        B   C(loaded)       F   G(tag)
        |___|               |___|
        |                   |       
        D                   H(tag)   
                            |       
                            |              
                            I                       
      

Tests:

  1. These are example tests:
    • Passing tests will look like this.
    • Failing tests will look like this.
  1. Test
    getSrcToLoad(["X"])
    for all tags:
    • Test A.
    • Test B.
    • Test C.
    • Test D.
    • Test F.
    • Test G(tag).
    • Test H(tag).
    • Test I.
  2. Test actual load of H using a callback:
    • A is loaded.
    • F is loaded.
    • Scripts loaded with appended version parameter.
    • Callback is only called once for the set.
  3. 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.
  4. 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: