| <!DOCTYPE html> |
| <!-- |
| Copyright 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/dashboard/elements/alerts-page.html"> |
| <link rel="import" href="/dashboard/static/testing_common.html"> |
| |
| <link rel="import" href="/tracing/core/test_utils.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| |
| var testOptions = { |
| tearDown: function() { |
| testing_common.clearXhrMock(); |
| } |
| }; |
| |
| test('instantiation', function() { |
| var mockResponse = { |
| 'anomaly_list': [ |
| { |
| 'key': '12345', |
| 'group': null, |
| 'start_revision': 55555, |
| 'end_revision': 55558, |
| 'date': '2016-02-27', |
| 'master': 'Chromium', |
| 'bot': 'win', |
| 'testsuite': 'sunspider', |
| 'test': 'Total', |
| 'bug_id': null, |
| 'dashboard_link': 'http://do/not/click/me', |
| 'median_after_anomaly': 40, |
| 'median_before_anomaly': 20, |
| 'percent_changed': '50%', |
| 'improvement': true, |
| 'bisect_status': null, |
| 'recovered': false, |
| }, |
| { |
| 'key': '54321', |
| 'group': null, |
| 'start_revision': 55555, |
| 'end_revision': 55558, |
| 'date': '2016-02-27', |
| 'master': 'Chromium', |
| 'bot': 'win', |
| 'testsuite': 'sunspider', |
| 'test': 'Total', |
| 'bug_id': null, |
| 'dashboard_link': 'http://do/not/click/me', |
| 'median_after_anomaly': 10, |
| 'median_before_anomaly': 20, |
| 'percent_changed': '100%', |
| 'improvement': false, |
| 'bisect_status': null, |
| 'recovered': false, |
| }, |
| ], |
| 'stoppage_alert_list': [ |
| { |
| 'key': '12345', |
| 'group': null, |
| 'start_revision': 55555, |
| 'end_revision': 55558, |
| 'date': '2016-02-27', |
| 'master': 'Chromium', |
| 'bot': 'win', |
| 'testsuite': 'sunspider', |
| 'test': 'Total', |
| 'bug_id': null, |
| 'dashboard_link': 'http://do/not/click/me', |
| 'mail_sent': false, |
| 'last_row_date': 'N/A', |
| 'recovered': false, |
| } |
| ], |
| 'sheriff_list': ['Chromium Perf Sheriff', 'V8 Sheriff', 'CrOS Sheriff'], |
| 'xsrf_token': '12345' |
| }; |
| testing_common.addXhrMock('*', JSON.stringify(mockResponse)); |
| var page = document.createElement('alerts-page'); |
| this.addHTMLOutput(page); |
| }, testOptions); |
| |
| }); |
| </script> |