| 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 | |
| 25 asyncTest("examine", 1, function() { | 14 asyncTest("examine", 1, function() { |
| 26 var card = document.createElement('ct-failure-card'); | 15 var card = document.createElement('ct-failure-card'); |
| 27 card.failures = []; | 16 card.failures = []; |
| 28 | 17 |
| 29 Platform.endOfMicrotask(function() { | 18 Platform.endOfMicrotask(function() { |
| 30 card.addEventListener('ct-examine-failures', function(event) { | 19 card.addEventListener('ct-examine-failures', function(event) { |
| 31 deepEqual(event.detail, []); | 20 deepEqual(event.detail, []); |
| 32 start(); | 21 start(); |
| 33 }); | 22 }); |
| 34 | 23 |
| 35 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap
')); | 24 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap
')); |
| 36 }); | 25 }); |
| 37 }); | 26 }); |
| 38 | 27 |
| 39 })() | 28 })() |
| 40 </script> | 29 </script> |
| OLD | NEW |