OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Copyright 2017 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. |
| 6 --> |
| 7 |
| 8 <link rel="import" href="/dashboard/elements/bug-details.html"> |
| 9 <link rel="import" href="/dashboard/static/testing_common.html"> |
| 10 |
| 11 <link rel="import" href="/tracing/core/test_utils.html"> |
| 12 |
| 13 <script> |
| 14 'use strict'; |
| 15 |
| 16 |
| 17 tr.b.unittest.testSuite(function() { |
| 18 var testOptions = { |
| 19 setUp: function() { |
| 20 }, |
| 21 tearDown: function() { |
| 22 testing_common.clearXhrMock(); |
| 23 } |
| 24 }; |
| 25 |
| 26 test('instantiation', function() { |
| 27 var mockResponse = { |
| 28 'review_urls': [ |
| 29 'http://codereview.google.com/12345', |
| 30 'http://review.chromium.org/23435' |
| 31 ], |
| 32 'bisects': [ |
| 33 { |
| 34 'status': 'failed', |
| 35 'metric': 'Total', |
| 36 'buildbucket_link': '/foo/bar', |
| 37 'bot': 'android-nexus5-perf-bisect' |
| 38 }, |
| 39 { |
| 40 'status': 'started', |
| 41 'metric': 'Total', |
| 42 'buildbucket_link': '/foo/bar', |
| 43 'bot': 'windows-perf-bisect' |
| 44 }, |
| 45 ], |
| 46 'owner': 'foo@bar.com', |
| 47 'published': '2017-02-17T23:08:44', |
| 48 'state': 'open', |
| 49 'status': 'Untriaged', |
| 50 'summary': 'A regression in Sunspider occurred!' |
| 51 }; |
| 52 testing_common.addXhrMock( |
| 53 '/bug_details?bug_id=12345', |
| 54 JSON.stringify(mockResponse)); |
| 55 var e = document.createElement('bug-details'); |
| 56 e.bugId = 12345; |
| 57 this.addHTMLOutput(e); |
| 58 }, testOptions); |
| 59 }); |
| 60 </script> |
OLD | NEW |