Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / netwerk / test / unit / test_channel_long_domain.js
blob86dbbed3e33f16efb023321857bc156d2403d17f
1 // Tests that domains longer than 253 characters fail to load when pref is true
3 add_task(async function test_long_domain_fails() {
4 let domain = "http://" + "a".repeat(254);
6 let req = await new Promise(resolve => {
7 let chan = NetUtil.newChannel({
8 uri: domain,
9 loadUsingSystemPrincipal: true,
10 });
11 chan.asyncOpen(new ChannelListener(resolve, null, CL_EXPECT_FAILURE));
12 });
13 Assert.equal(req.status, Cr.NS_ERROR_UNKNOWN_HOST, "Request should fail");
14 });