| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="ct-failure-card.html"> | 7 <link rel="import" href="ct-failure-card.html"> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 (function () { | 10 (function () { |
| 11 | 11 |
| 12 module("ct-failure-card"); | 12 module("ct-failure-card"); |
| 13 | 13 |
| 14 test("testNames", 1, function() { |
| 15 var card = document.createElement('ct-failure-card'); |
| 16 // FIXME: Use a proper model class instead of a dumb object. |
| 17 var failures = [ |
| 18 {testName: 'foo'}, |
| 19 {testName: 'bar'}, |
| 20 {testName: 'baz'}, |
| 21 ]; |
| 22 deepEqual(card.testNames(failures), ['bar', 'baz', 'foo']); |
| 23 }); |
| 24 |
| 14 asyncTest("examine", 1, function() { | 25 asyncTest("examine", 1, function() { |
| 15 var card = document.createElement('ct-failure-card'); | 26 var card = document.createElement('ct-failure-card'); |
| 16 card.failures = []; | 27 card.failures = []; |
| 17 | 28 |
| 18 Platform.endOfMicrotask(function() { | 29 Platform.endOfMicrotask(function() { |
| 19 card.addEventListener('ct-examine-failures', function(event) { | 30 card.addEventListener('ct-examine-failures', function(event) { |
| 20 deepEqual(event.detail, []); | 31 deepEqual(event.detail, []); |
| 21 start(); | 32 start(); |
| 22 }); | 33 }); |
| 23 | 34 |
| 24 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap
')); | 35 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap
')); |
| 25 }); | 36 }); |
| 26 }); | 37 }); |
| 27 | 38 |
| 28 })() | 39 })() |
| 29 </script> | 40 </script> |
| OLD | NEW |