1<!DOCTYPE html> 2<html> 3<!-- 4Copyright (c) 2012 The Chromium Authors. All rights reserved. 5Use of this source code is governed by a BSD-style license that can be 6found 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 16base.require('unittest'); 17base.require('test_utils'); 18base.require('overlay'); 19 20var sandbox = document.getElementById('sandbox'); 21var overlay; 22 23 24function testShowHideUnparented() { 25 overlay = new tracing.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 35function testShowHideParented() { 36 overlay = new tracing.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