1<!DOCTYPE html>
2<!--
3Copyright (c) 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7<link rel="import" href="/tracing/ui/base/info_bar_group.html">
8
9<script>
10'use strict';
11
12tr.b.unittest.testSuite(function() {
13  test('group-instantiate', function() {
14    var infoBarGroup = document.createElement('tr-ui-b-info-bar-group');
15    infoBarGroup.addMessage(
16        'Message 1',
17        [{buttonText: 'ok', onClick: function() {}}]);
18    infoBarGroup.addMessage(
19        'Message 2',
20        [{buttonText: 'button 2', onClick: function() {}}]);
21    this.addHTMLOutput(infoBarGroup);
22  });
23
24  test('group-populate-then-clear', function() {
25    var infoBarGroup = document.createElement('tr-ui-b-info-bar-group');
26    infoBarGroup.addMessage(
27        'Message 1',
28        [{buttonText: 'ok', onClick: function() {}}]);
29    infoBarGroup.addMessage(
30        'Message 2',
31        [{buttonText: 'button 2', onClick: function() {}}]);
32    infoBarGroup.clearMessages();
33    assert.equal(infoBarGroup.children.length, 0);
34  });
35
36  test('group-populate-clear-repopulate', function() {
37    var infoBarGroup = document.createElement('tr-ui-b-info-bar-group');
38    infoBarGroup.addMessage(
39        'Message 1',
40        [{buttonText: 'ok', onClick: function() {}}]);
41    infoBarGroup.addMessage(
42        'Message 2',
43        [{buttonText: 'button 2', onClick: function() {}}]);
44    infoBarGroup.clearMessages();
45    infoBarGroup.addMessage(
46        'Message 1',
47        [{buttonText: 'ok', onClick: function() {}}]);
48    this.addHTMLOutput(infoBarGroup);
49  });
50});
51</script>
52