Home | History | Annotate | Download | only in src
      1 <!DOCTYPE html>
      2 <html>
      3 <!--
      4 Copyright (c) 2012 The Chromium Authors. All rights reserved.
      5 Use of this source code is governed by a BSD-style license that can be
      6 found in the LICENSE file.
      7 -->
      8 <head>
      9 <title>Overlay tests</title>
     10 <script src="base.js"></script>
     11 </head>
     12 <body>
     13 <script>
     14 'use strict';
     15 
     16 base.require('unittest');
     17 base.require('test_utils');
     18 base.require('overlay');
     19 
     20 var sandbox = document.getElementById('sandbox');
     21 var overlay;
     22 
     23 
     24 function testShowHideUnparented() {
     25   overlay = new tracing.ui.Overlay();
     26   overlay.innerHTML =
     27       '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
     28   overlay.visible = true;
     29   assertNotEquals(overlay.parentNode, null);
     30 
     31   overlay.visible = false;
     32   assertEquals(overlay.parentNode, null);
     33 }
     34 
     35 function testShowHideParented() {
     36   overlay = new tracing.ui.Overlay();
     37   overlay.innerHTML =
     38       '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
     39   document.body.appendChild(overlay);
     40   overlay.visible = true;
     41   assertNotEquals(overlay.parentNode, null);
     42 
     43   overlay.visible = false;
     44   assertEquals(overlay.parentNode, document.body);
     45 }
     46 
     47 </script>
     48 
     49 </body>
     50 </html>
     51 
     52