Home | History | Annotate | Download | only in ui
      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 
      7 base.requireStylesheet('ui.value_bar');
      8 base.require('base.unittest');
      9 base.require('base.bbox2');
     10 base.require('ui.dom_helpers');
     11 base.require('ui.text_end_value_bar');
     12 
     13 base.unittest.testSuite('ui.text_end_value_bar', function() {
     14 
     15   function synClick(element) {
     16     var event = new MouseEvent('click', {});
     17     element.dispatchEvent(event);
     18   }
     19 
     20   test('instantiate', function() {
     21     var container = ui.createDiv();
     22     container.style.position = 'relative';
     23     container.style.height = '200px';
     24 
     25     var valueBar = new ui.TextEndValueBar();
     26     valueBar.style['-webkit-flex-direction'] = 'column';
     27 
     28     this.addHTMLOutput(container);
     29     container.appendChild(valueBar);
     30 
     31     valueBar.lowestValueProperties = {
     32       style: {
     33         'fontSize': '24px',
     34       },
     35       textContent: 'Z'
     36     };
     37     valueBar.highestValueProperties = {
     38       style: {
     39         'fontSize': '24px',
     40       },
     41       textContent: 'Y'
     42     };
     43     assertEquals('ZY', valueBar.textContent);
     44   });
     45 });
     46