7 define_mime_type_table("test_mime_table",
11 teardown: function () {
12 delete conkeror.test_mime_table;
14 test_mime_type_parse_1: function () {
15 assert_equals(mime_type_parse("image"), "image");
17 test_mime_type_parse_2: function () {
18 assert_equals(mime_type_parse("*"), "*");
20 test_mime_type_parse_3: function () {
21 assert_objects_equal(mime_type_parse("image/jpeg"), ["image", "jpeg"]);
23 test_mime_type_parse_4: function () {
24 assert_objects_equal(mime_type_parse("image/*"), ["image", "*"]);
26 test_mime_table_1: function () {
27 assert(test_mime_table instanceof mime_type_table);
29 test_mime_table_2: function () {
31 assert(test_mime_table instanceof mime_type_table);
33 test_mime_table_3: function () {
34 test_mime_table.set("image/jpeg", "foo");
35 assert_equals(test_mime_table.get("image/jpeg"), "foo");
37 test_mime_table_4: function () {
38 test_mime_table.set("image/*", "foo");
39 assert_equals(test_mime_table.get("image/jpeg"), "foo");
41 test_mime_table_5: function () {
42 test_mime_table.set("*", "foo");
43 assert_equals(test_mime_table.get("image/jpeg"), "foo");
45 test_mime_table_6: function () {
46 test_mime_table.set("*", "foo");
47 test_mime_table.set("image/*", "bar");
48 assert_equals(test_mime_table.get("image/jpeg"), "bar");
50 test_mime_table_7: function () {
51 test_mime_table.set("image/*", "foo");
52 test_mime_table.set("image", null);
53 assert_not(test_mime_table.get("image/jpeg"));
55 test_mime_table_8: function () {
56 assert_not(test_mime_table.get("image/jpeg"));