Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: dashboard/dashboard/elements/bug-details-test.html

Issue 2706813003: Add new endpoint to get bug details as JSON. (Closed)
Patch Set: addressed review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 test('error', function() {
61 var mockResponse = {
62 'error': 'failed to load!'
63 };
64 testing_common.addXhrMock(
65 '/bug_details?bug_id=12345',
66 JSON.stringify(mockResponse));
67 var e = document.createElement('bug-details');
68 e.bugId = 12345;
69 this.addHTMLOutput(e);
70 }, testOptions);
71 });
72 </script>
OLDNEW
« no previous file with comments | « dashboard/dashboard/elements/bug-details.html ('k') | dashboard/dashboard/services/issue_tracker_service.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698