Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: Tools/GardeningServer/ui/test/ct-tree-select-tests.html

Issue 728023004: Remove GardeningServer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <link rel="import" href="../ct-tree-select.html">
8
9 <link rel="import" href="../../model/ct-tree-list.html">
10
11 <script>
12 (function () {
13
14 var assert = chai.assert;
15
16 describe('ct-tree-select', function() {
17 var select;
18
19 beforeEach(function(done) {
20 select = document.createElement('ct-tree-select');
21 setTimeout(done);
22 });
23
24 describe('tree select UI', function() {
25 beforeEach(function(done) {
26 var treeList = new CTTreeList();
27 treeList.trees = [new CTTree("tree1", "Tree 1"), new CTTree("tree2", "Tree 2")];
28
29 // This represents initialization that should be normally be done on this component.
30 select.treeList = treeList;
31 select.tree = treeList.defaultValue();
32
33 setTimeout(done);
34 });
35
36 it('should show two elements, first one selected', function() {
37 var options = select.shadowRoot.querySelectorAll('option');
38 assert.lengthOf(options, 2);
39 assert(options[0].selected);
40 assert(!options[1].selected);
41 assert.equal(select.treeList.trees[0].name, select.tree);
42 });
43
44 describe('expanded test', function() {
45 beforeEach(function(done) {
46 var selectElement = select.shadowRoot.querySelectorAll('select')[0];
47 selectElement.selectedIndex = 1;
48
49 var event = new CustomEvent('change');
50 selectElement.dispatchEvent(event);
51 setTimeout(done);
52 });
53
54 it('should have the second value as its "tree"', function() {
55 assert.equal(select.treeList.trees[1].name, select.tree);
56 });
57 });
58 });
59 });
60
61 })()
62 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-test-output-tests.html ('k') | Tools/GardeningServer/ui/test/ct-tree-status-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698