OpenLayers OpenLayers

Changeset 5457

Show
Ignore:
Timestamp:
12/17/07 06:03:59 (1 year ago)
Author:
crschmidt
Message:

Come closer to passing tests in opera by destroying all map objects we create.
If we do not do this, then every time we instantiate a new map using the same
div, the clientHeight as reported by the browser grows, and eventually we're
doing tests with a totally different sized window than we intended to.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/Layer/test_MapServer.html

    r4761 r5457  
    22<head> 
    33    <script type="text/javascript">var oldAlert = window.alert, gMess; window.alert = function(message) {gMess = message; return true;};</script> 
    4     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>Z 
     4    <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script> 
    55    <script type="text/javascript">window.alert = oldAlert;</script> 
    66     
     
    6969             "div first child is correct image object" ); 
    7070        t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." ); 
     71        map.destroy(); 
    7172    } 
    7273     
     
    7980        t.eq( layer.grid.length, 7, "Grid rows is correct." ); 
    8081        t.eq( layer.grid[0].length, 6, "Grid cols is correct." ); 
     82        map.destroy(); 
    8183         
    8284    } 
     
    108110 
    109111        layer.grid = null; 
     112        map.destroy(); 
    110113    } 
    111114 
     
    150153 
    151154        t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() makes clean copy of hashtable"); 
     155        map.destroy(); 
    152156    } 
    153157 
     
    174178         
    175179        t.eq(str, sStr , "getFullRequestString() works"); 
     180        map.destroy(); 
    176181 
    177182    } 
     
    198203        tile.draw(); 
    199204        t.eq(parseFloat(tile.imgDiv.style.opacity), 0.6, "Tile opacity is set correctly"); 
     205        map.destroy(); 
    200206 
    201207    }     
     
    220226            t.eq( tile.bounds.bottom.toFixed(6), '11.178402', "bottom side matches" );  
    221227            t.eq( tile.bounds.top.toFixed(6), '21.943046', "top side matches" ); 
     228            map.destroy(); 
    222229        } else { 
    223230            t.plan(1); 
     
    232239        var tile = layer.grid[0][0]; 
    233240        t.ok( tile.bounds.equals(new OpenLayers.Bounds(-33.75, 33.75, -22.5, 45)), "okay"); 
     241        map.destroy(); 
    234242    } 
    235243     
     
    245253        t.eq( layer.tileSize.w, 750, "Image width is correct" ); 
    246254        t.eq( layer.tileSize.h, 825, "Image height is correct" ); 
     255        map.destroy(); 
    247256    } 
    248257 
     
    267276         
    268277        t.ok( layer.grid == null, "grid set to null"); 
     278        map.destroy(); 
    269279    } 
    270280    
     
    313323 
    314324        layer.tile = null; 
     325        map.destroy(); 
    315326    } 
    316327 
     
    354365 
    355366        t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() makes clean copy of hashtable"); 
     367        map.destroy(); 
    356368    } 
    357369 
     
    378390         
    379391        t.eq(str, sStr , "getFullRequestString() works"); 
     392        map.destroy(); 
    380393 
    381394    } 
     
    398411        t.eq(tLayer.opacity, "0.6", "setOpacity works properly"); 
    399412        t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly"); 
     413        map.destroy(); 
    400414 
    401415    }     
     
    430444         
    431445        t.ok( layer.tile == null, "tile set to null"); 
     446        map.destroy(); 
    432447    } 
    433448