Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: test/url.js

Issue 30025555: Issue 6820 - Move tests to mocha (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created March 7, 2019, 1:14 p.m.
Right Patch Set: Rebased Created April 10, 2019, 6:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/synchronizer.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 function hostnameToURL(hostname) 310 function hostnameToURL(hostname)
311 { 311 {
312 return new URL("http://" + hostname); 312 return new URL("http://" + hostname);
313 } 313 }
314 314
315 function testThirdParty(requestHostname, documentHostname, expected, 315 function testThirdParty(requestHostname, documentHostname, expected,
316 message) 316 message)
317 { 317 {
318 assert.equal( 318 assert.equal(
319 isThirdParty( 319 isThirdParty(
320 hostnameToURL(requestHostname), 320 hostnameToURL(requestHostname).hostname,
321 321
322 // Chrome's URL object normalizes IP addresses. So some test 322 // Chrome's URL object normalizes IP addresses. So some test
323 // will fail if we don't normalize the document host as well. 323 // will fail if we don't normalize the document host as well.
324 hostnameToURL(documentHostname).hostname 324 hostnameToURL(documentHostname).hostname
325 ), 325 ),
326 expected, 326 expected,
327 message 327 message
328 ); 328 );
329 } 329 }
330 330
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 "us-east-1.amazonaws.com" 475 "us-east-1.amazonaws.com"
476 ); 476 );
477 assert.equal(getBaseDomain("example.amazonaws.com"), "amazonaws.com"); 477 assert.equal(getBaseDomain("example.amazonaws.com"), "amazonaws.com");
478 assert.equal(getBaseDomain("amazonaws.com"), "amazonaws.com"); 478 assert.equal(getBaseDomain("amazonaws.com"), "amazonaws.com");
479 479
480 // Edge case. 480 // Edge case.
481 assert.equal(getBaseDomain(""), ""); 481 assert.equal(getBaseDomain(""), "");
482 }); 482 });
483 }); 483 });
484 484
LEFTRIGHT

Powered by Google App Engine
This is Rietveld