| OLD | NEW | 
|   1 <!DOCTYPE html> |   1 <!DOCTYPE html> | 
|   2 <!-- |   2 <!-- | 
|   3 Copyright 2015 The Chromium Authors. All rights reserved. |   3 Copyright 2015 The Chromium Authors. All rights reserved. | 
|   4 Use of this source code is governed by a BSD-style license that can be |   4 Use of this source code is governed by a BSD-style license that can be | 
|   5 found in the LICENSE file. |   5 found in the LICENSE file. | 
|   6 --> |   6 --> | 
|   7  |   7  | 
|   8 <link rel="import" href="/tracing/ui/brushing_state_controller.html"> |   8 <link rel="import" href="/tracing/ui/brushing_state_controller.html"> | 
|   9 <link rel="import" href="/tracing/ui/view_specific_brushing_state.html"> |   9 <link rel="import" href="/tracing/ui/view_specific_brushing_state.html"> | 
|  10  |  10  | 
|  11 <script> |  11 <script> | 
|  12 'use strict'; |  12 'use strict'; | 
|  13  |  13  | 
|  14 tr.b.unittest.testSuite(function() { |  14 tr.b.unittest.testSuite(function() { | 
|  15   var BrushingStateController = tr.c.BrushingStateController; |  15   var BrushingStateController = tr.c.BrushingStateController; | 
|  16  |  16  | 
|  17   function setStateElement(containerEl, viewId) { |  17   function setStateElement(containerEl, viewId) { | 
|  18     var stateElement = document.createElement( |  18     var stateElement = document.createElement( | 
|  19         'tr-ui-b-view-specific-brushing-state'); |  19         'tr-ui-b-view-specific-brushing-state'); | 
|  20     stateElement.viewId = viewId; |  20     stateElement.viewId = viewId; | 
|  21     containerEl.appendChild(stateElement); |  21     Polymer.dom(containerEl).appendChild(stateElement); | 
|  22     return stateElement; |  22     return stateElement; | 
|  23   } |  23   } | 
|  24  |  24  | 
|  25   function addChildDiv(element) { |  25   function addChildDiv(element) { | 
|  26     var child = element.ownerDocument.createElement('div'); |  26     var child = element.ownerDocument.createElement('div'); | 
|  27     element.appendChild(child); |  27     Polymer.dom(element).appendChild(child); | 
|  28     return child; |  28     return child; | 
|  29   } |  29   } | 
|  30  |  30  | 
|  31   function addShadowChildDiv(element) { |  31   function addShadowChildDiv(element) { | 
|  32     var shadowRoot = element.createShadowRoot(); |  32     var shadowRoot = element.createShadowRoot(); | 
|  33     return addChildDiv(shadowRoot); |  33     return addChildDiv(shadowRoot); | 
|  34   } |  34   } | 
|  35  |  35  | 
|  36   test('instantiate_withoutBrushingStateController', function() { |  36   test('instantiate_withoutBrushingStateController', function() { | 
|  37     var containerEl = document.createElement('div'); |  37     var containerEl = document.createElement('div'); | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
|  58     assert.deepEqual(stateElement2.get(), {pi: 3.14159}); |  58     assert.deepEqual(stateElement2.get(), {pi: 3.14159}); | 
|  59  |  59  | 
|  60     var stateElement3 = setStateElement(containerEl, 'test-view'); |  60     var stateElement3 = setStateElement(containerEl, 'test-view'); | 
|  61     assert.deepEqual(stateElement3.get(), {e: 2.71828}); |  61     assert.deepEqual(stateElement3.get(), {e: 2.71828}); | 
|  62  |  62  | 
|  63     var stateElement4 = setStateElement(containerEl, 'test-view-2'); |  63     var stateElement4 = setStateElement(containerEl, 'test-view-2'); | 
|  64     assert.deepEqual(stateElement4.get(), {pi: 3.14159}); |  64     assert.deepEqual(stateElement4.get(), {pi: 3.14159}); | 
|  65   }); |  65   }); | 
|  66 }); |  66 }); | 
|  67 </script> |  67 </script> | 
| OLD | NEW |