test_host.js
Go to the documentation of this file.
1 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et: */
3 /* ***** BEGIN LICENSE BLOCK *****
4  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is httpd.js code.
17  *
18  * The Initial Developer of the Original Code is
19  * Jeff Walden <jwalden+code@mit.edu>.
20  * Portions created by the Initial Developer are Copyright (C) 2008
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38 
44 const PORT = 4444;
45 const FAKE_PORT_ONE = 8888;
46 const FAKE_PORT_TWO = 8889;
47 
48 var srv, id;
49 
50 function run_test()
51 {
52  dumpn("*** run_test");
53 
54  srv = createServer();
55 
56  srv.registerPathHandler("/http/1.0-request", http10Request);
57  srv.registerPathHandler("/http/1.1-good-host", http11goodHost);
58  srv.registerPathHandler("/http/1.1-good-host-wacky-port",
60  srv.registerPathHandler("/http/1.1-ip-host", http11ipHost);
61 
62  srv.start(FAKE_PORT_ONE);
63 
64  id = srv.identity;
65 
66  // The default location is http://localhost:PORT, where PORT is whatever you
67  // provided when you started the server. http://127.0.0.1:PORT is also part
68  // of the default set of locations.
69  do_check_eq(id.primaryScheme, "http");
70  do_check_eq(id.primaryHost, "localhost");
71  do_check_eq(id.primaryPort, FAKE_PORT_ONE);
72  do_check_true(id.has("http", "localhost", FAKE_PORT_ONE));
73  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
74 
75  // This should be a nop.
76  id.add("http", "localhost", FAKE_PORT_ONE);
77  do_check_eq(id.primaryScheme, "http");
78  do_check_eq(id.primaryHost, "localhost");
79  do_check_eq(id.primaryPort, FAKE_PORT_ONE);
80  do_check_true(id.has("http", "localhost", FAKE_PORT_ONE));
81  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
82 
83  // Change the primary location and make sure all the getters work correctly.
84  id.setPrimary("http", "127.0.0.1", FAKE_PORT_ONE);
85  do_check_eq(id.primaryScheme, "http");
86  do_check_eq(id.primaryHost, "127.0.0.1");
87  do_check_eq(id.primaryPort, FAKE_PORT_ONE);
88  do_check_true(id.has("http", "localhost", FAKE_PORT_ONE));
89  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
90 
91  // Okay, now remove the primary location -- we fall back to the original
92  // location.
93  id.remove("http", "127.0.0.1", FAKE_PORT_ONE);
94  do_check_eq(id.primaryScheme, "http");
95  do_check_eq(id.primaryHost, "localhost");
96  do_check_eq(id.primaryPort, FAKE_PORT_ONE);
97  do_check_true(id.has("http", "localhost", FAKE_PORT_ONE));
98  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
99 
100  // You can't remove every location -- try this and the original default
101  // location will be silently readded.
102  id.remove("http", "localhost", FAKE_PORT_ONE);
103  do_check_eq(id.primaryScheme, "http");
104  do_check_eq(id.primaryHost, "localhost");
105  do_check_eq(id.primaryPort, FAKE_PORT_ONE);
106  do_check_true(id.has("http", "localhost", FAKE_PORT_ONE));
107  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
108 
109  // Okay, now that we've exercised that behavior, shut down the server and
110  // restart it on the correct port, to exercise port-changing behaviors at
111  // server start and stop.
112  do_test_pending();
113  srv.stop(function()
114  {
115  try
116  {
117  do_test_pending();
118  run_test_2();
119  }
120  finally
121  {
122  do_test_finished();
123  }
124  });
125 }
126 
127 function run_test_2()
128 {
129  dumpn("*** run_test_2");
130 
131  do_test_finished();
132 
133  // Our primary location is gone because it was dependent on the port on which
134  // the server was running.
136  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
137  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
138 
139  srv.start(FAKE_PORT_TWO);
140 
141  // We should have picked up http://localhost:8889 as our primary location now
142  // that we've restarted.
143  do_check_eq(id.primaryScheme, "http");
144  do_check_eq(id.primaryHost, "localhost", FAKE_PORT_TWO);
145  do_check_eq(id.primaryPort, FAKE_PORT_TWO);
146  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
147  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
148  do_check_true(id.has("http", "localhost", FAKE_PORT_TWO));
149  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
150 
151  // Now we're going to see what happens when we shut down with a primary
152  // location that wasn't a default. That location should persist, and the
153  // default we remove should still not be present.
154  id.setPrimary("http", "example.com", FAKE_PORT_TWO);
155  do_check_true(id.has("http", "example.com", FAKE_PORT_TWO));
156  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
157  do_check_true(id.has("http", "localhost", FAKE_PORT_TWO));
158  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
159  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
160 
161  id.remove("http", "localhost", FAKE_PORT_TWO);
162  do_check_true(id.has("http", "example.com", FAKE_PORT_TWO));
163  do_check_false(id.has("http", "localhost", FAKE_PORT_TWO));
164  do_check_true(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
165  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
166  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
167 
168  id.remove("http", "127.0.0.1", FAKE_PORT_TWO);
169  do_check_true(id.has("http", "example.com", FAKE_PORT_TWO));
170  do_check_false(id.has("http", "localhost", FAKE_PORT_TWO));
171  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
172  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
173  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
174 
175  do_test_pending();
176  srv.stop(function()
177  {
178  try
179  {
180  do_test_pending();
181  run_test_3();
182  }
183  finally
184  {
185  do_test_finished();
186  }
187  });
188 }
189 
190 function run_test_3()
191 {
192  dumpn("*** run_test_3");
193 
194  do_test_finished();
195 
196  // Only the default added location disappears; any others stay around,
197  // possibly as the primary location. We may have removed the default primary
198  // location, but the one we set manually should persist here.
199  do_check_eq(id.primaryScheme, "http");
200  do_check_eq(id.primaryHost, "example.com");
201  do_check_eq(id.primaryPort, FAKE_PORT_TWO);
202  do_check_true(id.has("http", "example.com", FAKE_PORT_TWO));
203  do_check_false(id.has("http", "localhost", FAKE_PORT_TWO));
204  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
205  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
206  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
207 
208  srv.start(PORT);
209 
210  // Starting always adds HTTP entries for 127.0.0.1:port and localhost:port.
211  do_check_true(id.has("http", "example.com", FAKE_PORT_TWO));
212  do_check_false(id.has("http", "localhost", FAKE_PORT_TWO));
213  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
214  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
215  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
216  do_check_true(id.has("http", "localhost", PORT));
217  do_check_true(id.has("http", "127.0.0.1", PORT));
218 
219  // Remove the primary location we'd left set from last time.
220  id.remove("http", "example.com", FAKE_PORT_TWO);
221 
222  // Default-port behavior testing requires the server responds to requests
223  // claiming to be on one such port.
224  id.add("http", "localhost", 80);
225 
226  // Make sure we don't have anything lying around from running on either the
227  // first or the second port -- all we should have is our generated default,
228  // plus the additional port to test "portless" hostport variants.
229  do_check_true(id.has("http", "localhost", 80));
230  do_check_eq(id.primaryScheme, "http");
231  do_check_eq(id.primaryHost, "localhost");
232  do_check_eq(id.primaryPort, PORT);
233  do_check_true(id.has("http", "localhost", PORT));
234  do_check_true(id.has("http", "127.0.0.1", PORT));
235  do_check_false(id.has("http", "localhost", FAKE_PORT_ONE));
236  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_ONE));
237  do_check_false(id.has("http", "example.com", FAKE_PORT_TWO));
238  do_check_false(id.has("http", "localhost", FAKE_PORT_TWO));
239  do_check_false(id.has("http", "127.0.0.1", FAKE_PORT_TWO));
240 
241  // Okay, finally done with identity testing. Our primary location is the one
242  // we want it to be, so we're off!
244 }
245 
246 
247 /*********************
248  * UTILITY FUNCTIONS *
249  *********************/
250 
259 {
260  var threw = false;
261  try
262  {
263  id.primaryScheme;
264  }
265  catch (e)
266  {
267  threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
268  }
269  do_check_true(threw);
270 
271  threw = false;
272  try
273  {
274  id.primaryHost;
275  }
276  catch (e)
277  {
278  threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
279  }
280  do_check_true(threw);
281 
282  threw = false;
283  try
284  {
285  id.primaryPort;
286  }
287  catch (e)
288  {
289  threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
290  }
291  do_check_true(threw);
292 }
293 
297 function check400(data)
298 {
299  var iter = LineIterator(data);
300 
301  // Status-Line
302  var firstLine = iter.next();
303  do_check_eq(firstLine.substring(0, HTTP_400_LEADER_LENGTH), HTTP_400_LEADER);
304 }
305 
306 
307 /***************
308  * BEGIN TESTS *
309  ***************/
310 
311 const HTTP_400_LEADER = "HTTP/1.1 400 ";
313 
314 var test, data;
315 var tests = [];
316 
317 // HTTP/1.0 request, to ensure we see our default scheme/host/port
318 
319 function http10Request(request, response)
320 {
321  writeDetails(request, response);
322  response.setStatusLine("1.0", 200, "TEST PASSED");
323 }
324 data = "GET /http/1.0-request HTTP/1.0\r\n" +
325  "\r\n";
326 function check10(data)
327 {
328  var iter = LineIterator(data);
329 
330  // Status-Line
331  do_check_eq(iter.next(), "HTTP/1.0 200 TEST PASSED");
332 
333  skipHeaders(iter);
334 
335  // Okay, next line must be the data we expected to be written
336  var body =
337  [
338  "Method: GET",
339  "Path: /http/1.0-request",
340  "Query: ",
341  "Version: 1.0",
342  "Scheme: http",
343  "Host: localhost",
344  "Port: 4444",
345  ];
346 
347  expectLines(iter, body);
348 }
349 test = new RawTest("localhost", PORT, data, check10),
350 tests.push(test);
351 
352 
353 // HTTP/1.1 request, no Host header, expect a 400 response
354 
355 data = "GET /http/1.1-request HTTP/1.1\r\n" +
356  "\r\n";
357 test = new RawTest("localhost", PORT, data, check400),
358 tests.push(test);
359 
360 
361 // HTTP/1.1 request, wrong host, expect a 400 response
362 
363 data = "GET /http/1.1-request HTTP/1.1\r\n" +
364  "Host: not-localhost\r\n" +
365  "\r\n";
366 test = new RawTest("localhost", PORT, data, check400),
367 tests.push(test);
368 
369 
370 // HTTP/1.1 request, wrong host/right port, expect a 400 response
371 
372 data = "GET /http/1.1-request HTTP/1.1\r\n" +
373  "Host: not-localhost:4444\r\n" +
374  "\r\n";
375 test = new RawTest("localhost", PORT, data, check400),
376 tests.push(test);
377 
378 
379 // HTTP/1.1 request, Host header has host but no port, expect a 400 response
380 
381 data = "GET /http/1.1-request HTTP/1.1\r\n" +
382  "Host: 127.0.0.1\r\n" +
383  "\r\n";
384 test = new RawTest("localhost", PORT, data, check400),
385 tests.push(test);
386 
387 
388 // HTTP/1.1 request, Request-URI has wrong port, expect a 400 response
389 
390 data = "GET http://127.0.0.1/http/1.1-request HTTP/1.1\r\n" +
391  "Host: 127.0.0.1\r\n" +
392  "\r\n";
393 test = new RawTest("localhost", PORT, data, check400),
394 tests.push(test);
395 
396 
397 // HTTP/1.1 request, Request-URI has wrong port, expect a 400 response
398 
399 data = "GET http://localhost:31337/http/1.1-request HTTP/1.1\r\n" +
400  "Host: localhost:31337\r\n" +
401  "\r\n";
402 test = new RawTest("localhost", PORT, data, check400),
403 tests.push(test);
404 
405 
406 // HTTP/1.1 request, Request-URI has wrong scheme, expect a 400 response
407 
408 data = "GET https://localhost:4444/http/1.1-request HTTP/1.1\r\n" +
409  "Host: localhost:4444\r\n" +
410  "\r\n";
411 test = new RawTest("localhost", PORT, data, check400),
412 tests.push(test);
413 
414 
415 // HTTP/1.1 request, correct Host header, expect handler's response
416 
417 function http11goodHost(request, response)
418 {
419  writeDetails(request, response);
420  response.setStatusLine("1.1", 200, "TEST PASSED");
421 }
422 data = "GET /http/1.1-good-host HTTP/1.1\r\n" +
423  "Host: localhost:4444\r\n" +
424  "\r\n";
426 {
427  var iter = LineIterator(data);
428 
429  // Status-Line
430  do_check_eq(iter.next(), "HTTP/1.1 200 TEST PASSED");
431 
432  skipHeaders(iter);
433 
434  // Okay, next line must be the data we expected to be written
435  var body =
436  [
437  "Method: GET",
438  "Path: /http/1.1-good-host",
439  "Query: ",
440  "Version: 1.1",
441  "Scheme: http",
442  "Host: localhost",
443  "Port: 4444",
444  ];
445 
446  expectLines(iter, body);
447 }
448 test = new RawTest("localhost", PORT, data, check11goodHost),
449 tests.push(test);
450 
451 
452 // HTTP/1.1 request, Host header is secondary identity
453 
454 function http11ipHost(request, response)
455 {
456  writeDetails(request, response);
457  response.setStatusLine("1.1", 200, "TEST PASSED");
458 }
459 data = "GET /http/1.1-ip-host HTTP/1.1\r\n" +
460  "Host: 127.0.0.1:4444\r\n" +
461  "\r\n";
463 {
464  var iter = LineIterator(data);
465 
466  // Status-Line
467  do_check_eq(iter.next(), "HTTP/1.1 200 TEST PASSED");
468 
469  skipHeaders(iter);
470 
471  // Okay, next line must be the data we expected to be written
472  var body =
473  [
474  "Method: GET",
475  "Path: /http/1.1-ip-host",
476  "Query: ",
477  "Version: 1.1",
478  "Scheme: http",
479  "Host: 127.0.0.1",
480  "Port: 4444",
481  ];
482 
483  expectLines(iter, body);
484 }
485 test = new RawTest("localhost", PORT, data, check11ipHost),
486 tests.push(test);
487 
488 
489 // HTTP/1.1 request, absolute path, accurate Host header
490 
491 // reusing previous request handler so not defining a new one
492 
493 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
494  "Host: localhost:4444\r\n" +
495  "\r\n";
496 test = new RawTest("localhost", PORT, data, check11goodHost),
497 tests.push(test);
498 
499 
500 // HTTP/1.1 request, absolute path, inaccurate Host header
501 
502 // reusing previous request handler so not defining a new one
503 
504 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
505  "Host: localhost:1234\r\n" +
506  "\r\n";
507 test = new RawTest("localhost", PORT, data, check11goodHost),
508 tests.push(test);
509 
510 
511 // HTTP/1.1 request, absolute path, different inaccurate Host header
512 
513 // reusing previous request handler so not defining a new one
514 
515 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
516  "Host: not-localhost:4444\r\n" +
517  "\r\n";
518 test = new RawTest("localhost", PORT, data, check11goodHost),
519 tests.push(test);
520 
521 
522 // HTTP/1.1 request, absolute path, yet another inaccurate Host header
523 
524 // reusing previous request handler so not defining a new one
525 
526 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
527  "Host: yippity-skippity\r\n" +
528  "\r\n";
530 {
532 
533  // dynamism setup
534  srv.identity.setPrimary("http", "127.0.0.1", 4444);
535 }
536 test = new RawTest("localhost", PORT, data, checkInaccurate),
537 tests.push(test);
538 
539 
540 // HTTP/1.0 request, absolute path, different inaccurate Host header
541 
542 // reusing previous request handler so not defining a new one
543 
544 data = "GET /http/1.0-request HTTP/1.0\r\n" +
545  "Host: not-localhost:4444\r\n" +
546  "\r\n";
547 function check10ip(data)
548 {
549  var iter = LineIterator(data);
550 
551  // Status-Line
552  do_check_eq(iter.next(), "HTTP/1.0 200 TEST PASSED");
553 
554  skipHeaders(iter);
555 
556  // Okay, next line must be the data we expected to be written
557  var body =
558  [
559  "Method: GET",
560  "Path: /http/1.0-request",
561  "Query: ",
562  "Version: 1.0",
563  "Scheme: http",
564  "Host: 127.0.0.1",
565  "Port: 4444",
566  ];
567 
568  expectLines(iter, body);
569 }
570 test = new RawTest("localhost", PORT, data, check10ip),
571 tests.push(test);
572 
573 
574 // HTTP/1.1 request, Host header with implied port
575 
576 function http11goodHostWackyPort(request, response)
577 {
578  writeDetails(request, response);
579  response.setStatusLine("1.1", 200, "TEST PASSED");
580 }
581 data = "GET /http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
582  "Host: localhost\r\n" +
583  "\r\n";
585 {
586  var iter = LineIterator(data);
587 
588  // Status-Line
589  do_check_eq(iter.next(), "HTTP/1.1 200 TEST PASSED");
590 
591  skipHeaders(iter);
592 
593  // Okay, next line must be the data we expected to be written
594  var body =
595  [
596  "Method: GET",
597  "Path: /http/1.1-good-host-wacky-port",
598  "Query: ",
599  "Version: 1.1",
600  "Scheme: http",
601  "Host: localhost",
602  "Port: 80",
603  ];
604 
605  expectLines(iter, body);
606 }
607 test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
608 tests.push(test);
609 
610 
611 // HTTP/1.1 request, Host header with wacky implied port
612 
613 data = "GET /http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
614  "Host: localhost:\r\n" +
615  "\r\n";
616 test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
617 tests.push(test);
618 
619 
620 // HTTP/1.1 request, absolute URI with implied port
621 
622 data = "GET http://localhost/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
623  "Host: localhost\r\n" +
624  "\r\n";
625 test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
626 tests.push(test);
627 
628 
629 // HTTP/1.1 request, absolute URI with wacky implied port
630 
631 data = "GET http://localhost:/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
632  "Host: localhost\r\n" +
633  "\r\n";
634 test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
635 tests.push(test);
636 
637 
638 // HTTP/1.1 request, absolute URI with explicit implied port, ignored Host
639 
640 data = "GET http://localhost:80/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
641  "Host: who-cares\r\n" +
642  "\r\n";
643 test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
644 tests.push(test);
645 
646 
647 // HTTP/1.1 request, a malformed Request-URI
648 
649 data = "GET is-this-the-real-life-is-this-just-fantasy HTTP/1.1\r\n" +
650  "Host: localhost:4444\r\n" +
651  "\r\n";
652 test = new RawTest("localhost", PORT, data, check400),
653 tests.push(test);
654 
655 
656 // HTTP/1.1 request, a malformed Host header
657 
658 data = "GET /http/1.1-request HTTP/1.1\r\n" +
659  "Host: la la la\r\n" +
660  "\r\n";
661 test = new RawTest("localhost", PORT, data, check400),
662 tests.push(test);
663 
664 
665 // HTTP/1.1 request, a malformed Host header but absolute URI, 5.2 sez fine
666 
667 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
668  "Host: la la la\r\n" +
669  "\r\n";
670 test = new RawTest("localhost", PORT, data, check11goodHost),
671 tests.push(test);
672 
673 
674 // HTTP/1.0 request, absolute URI, but those aren't valid in HTTP/1.0
675 
676 data = "GET http://localhost:4444/http/1.1-request HTTP/1.0\r\n" +
677  "Host: localhost:4444\r\n" +
678  "\r\n";
679 test = new RawTest("localhost", PORT, data, check400),
680 tests.push(test);
681 
682 
683 // HTTP/1.1 request, absolute URI with unrecognized host
684 
685 data = "GET http://not-localhost:4444/http/1.1-request HTTP/1.1\r\n" +
686  "Host: not-localhost:4444\r\n" +
687  "\r\n";
688 test = new RawTest("localhost", PORT, data, check400),
689 tests.push(test);
690 
691 
692 // HTTP/1.1 request, absolute URI with unrecognized host (but not in Host)
693 
694 data = "GET http://not-localhost:4444/http/1.1-request HTTP/1.1\r\n" +
695  "Host: localhost:4444\r\n" +
696  "\r\n";
697 test = new RawTest("localhost", PORT, data, check400),
698 tests.push(test);
var data
Definition: test_host.js:314
do_check_eq(typeof PlacesUtils,"object")
const HTTP_400_LEADER_LENGTH
Definition: test_host.js:312
function checkInaccurate(data)
Definition: test_host.js:529
function run_test()
Definition: test_host.js:50
function check400(data)
Definition: test_host.js:297
const FAKE_PORT_ONE
Definition: test_host.js:45
function checkPrimariesThrow(id)
Definition: test_host.js:258
function run_test_3()
Definition: test_host.js:190
var id
Definition: test_host.js:48
function skipHeaders(iter)
Definition: head_utils.js:191
function http11goodHost(request, response)
Definition: test_host.js:417
function check11ipHost(data)
Definition: test_host.js:462
function dumpn(str)
Definition: httpd.js:172
function http11ipHost(request, response)
Definition: test_host.js:454
function expectLines(iter, expectedLines)
Definition: head_utils.js:142
const PORT
Definition: test_host.js:44
function runRawTests(testArray, done)
Definition: head_utils.js:501
function createServer()
Definition: head_utils.js:53
function check11goodHostWackyPort(data)
Definition: test_host.js:584
function http10Request(request, response)
Definition: test_host.js:319
function writeDetails(request, response)
Definition: head_utils.js:172
function RawTest(host, port, data, responseCheck)
Definition: head_utils.js:476
function http11goodHostWackyPort(request, response)
Definition: test_host.js:576
function check10ip(data)
Definition: test_host.js:547
function testComplete(srv)
Definition: head_utils.js:292
const Cr
function check10(data)
Definition: test_host.js:326
function run_test_2()
Definition: test_host.js:127
var srv
Definition: test_host.js:48
function check11goodHost(data)
Definition: test_host.js:425
var test
Definition: test_host.js:314
var tests
Definition: test_host.js:315
const HTTP_400_LEADER
Definition: test_host.js:311
const FAKE_PORT_TWO
Definition: test_host.js:46
function LineIterator(data)
Definition: head_utils.js:115