blob: 6bfa13efa14fbacdef24e9197080ff03706ba725 [file] [log] [blame]
<!DOCTYPE html>
<html>
<!--
Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
<title>Overlay tests</title>
<script src="base.js"></script>
</head>
<body>
<script>
'use strict';
base.require('unittest');
base.require('test_utils');
base.require('overlay');
var sandbox = document.getElementById('sandbox');
var overlay;
function testShowHideUnparented() {
overlay = new tracing.Overlay();
overlay.innerHTML =
'<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
overlay.visible = true;
assertNotEquals(overlay.parentNode, null);
overlay.visible = false;
assertEquals(overlay.parentNode, null);
}
function testShowHideParented() {
overlay = new tracing.Overlay();
overlay.innerHTML =
'<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
document.body.appendChild(overlay);
overlay.visible = true;
assertNotEquals(overlay.parentNode, null);
overlay.visible = false;
assertEquals(overlay.parentNode, document.body);
}
</script>
</body>
</html>