• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5'use strict';
6
7base.require('ui.overlay');
8
9base.unittest.testSuite('ui.overlay', function() {
10  test('showHideUnparented', function() {
11    var overlay = new ui.Overlay();
12    overlay.innerHTML =
13        '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
14    overlay.visible = true;
15    assertNotEquals(overlay.parentNode, null);
16
17    overlay.visible = false;
18    assertEquals(overlay.parentNode, null);
19  });
20
21  test('showHideParented', function() {
22    var overlay = new ui.Overlay();
23    overlay.innerHTML =
24        '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>';
25
26    document.body.appendChild(overlay);
27    overlay.visible = true;
28    assertNotEquals(overlay.parentNode, null);
29
30    overlay.visible = false;
31    assertEquals(overlay.parentNode, document.body);
32    document.body.removeChild(overlay);
33  });
34});
35