OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 "title": "Remove yurys and loislo from WTF watchlist", | 249 "title": "Remove yurys and loislo from WTF watchlist", |
250 "time": "2014-03-03T07:23:31Z", | 250 "time": "2014-03-03T07:23:31Z", |
251 "summary": "BUG=None", | 251 "summary": "BUG=None", |
252 "author": "yurys@chromium.org", | 252 "author": "yurys@chromium.org", |
253 "reviewer": "loislo@chromium.org", | 253 "reviewer": "loislo@chromium.org", |
254 "bugID": null, | 254 "bugID": null, |
255 "revertedRevision": undefined | 255 "revertedRevision": undefined |
256 } | 256 } |
257 ]; | 257 ]; |
258 | 258 |
| 259 test("queryParam", 2, function() { |
| 260 equal(trac._queryParam({}), ''); |
| 261 equal(trac._queryParam({ |
| 262 'foo bar': 'bar baz', |
| 263 '1 2': '3 4', |
| 264 }), 'foo+bar=bar+baz&1+2=3+4'); |
| 265 }); |
| 266 |
259 test("changesetURL", 1, function() { | 267 test("changesetURL", 1, function() { |
260 equals(trac.changesetURL(1234), "http://src.chromium.org/viewvc/blink?view=r
ev&revision=1234"); | 268 equals(trac.changesetURL(1234), "http://src.chromium.org/viewvc/blink?view=r
ev&revision=1234"); |
261 }); | 269 }); |
262 | 270 |
263 asyncTest("recentCommitData", 3, function() { | 271 asyncTest("recentCommitData", 3, function() { |
264 var simulator = new NetworkSimulator(); | 272 var simulator = new NetworkSimulator(); |
265 simulator.xml = function(url) | 273 simulator.xml = function(url) |
266 { | 274 { |
267 equals(url, 'http://blink.lc/blink/atom'); | 275 equals(url, 'http://blink.lc/blink/atom'); |
268 var parser = new DOMParser(); | 276 var parser = new DOMParser(); |
269 var responseDOM = parser.parseFromString(kExampleCommitDataXML, "applica
tion/xml"); | 277 var responseDOM = parser.parseFromString(kExampleCommitDataXML, "applica
tion/xml"); |
270 return Promise.resolve(responseDOM); | 278 return Promise.resolve(responseDOM); |
271 }; | 279 }; |
272 | 280 |
273 simulator.runTest(function() { | 281 simulator.runTest(function() { |
274 return trac.recentCommitData('trunk', 10).then(function(commitDataList)
{ | 282 return trac.recentCommitData('trunk', 10).then(function(commitDataList)
{ |
275 commitDataList.forEach(function(commitData) { | 283 commitDataList.forEach(function(commitData) { |
276 // Including the entire message makes the deepEqual below to unw
ieldy. | 284 // Including the entire message makes the deepEqual below to unw
ieldy. |
277 delete commitData.message; | 285 delete commitData.message; |
278 }); | 286 }); |
279 deepEqual(commitDataList, kExampleCommitDataList); | 287 deepEqual(commitDataList, kExampleCommitDataList); |
280 }); | 288 }); |
281 }).then(start); | 289 }).then(start); |
282 }); | 290 }); |
283 | 291 |
284 })(); | 292 })(); |
OLD | NEW |