void test_chtml30_div_tag_with_css_026();
void test_chtml30_div_tag_with_css_027();
void test_chtml30_div_tag_with_css_028();
+void test_chtml30_div_tag_with_css_029();
+void test_chtml30_div_tag_with_css_030();
void test_chtml30_blockquote_tag_with_css_001();
void test_chtml30_blockquote_tag_with_css_002();
CU_add_test(chtml30_suite, "test div with css 026", test_chtml30_div_tag_with_css_026);
CU_add_test(chtml30_suite, "test div with css 027", test_chtml30_div_tag_with_css_027);
CU_add_test(chtml30_suite, "test div with css 028", test_chtml30_div_tag_with_css_028);
+ CU_add_test(chtml30_suite, "test div with css 029", test_chtml30_div_tag_with_css_029);
+ CU_add_test(chtml30_suite, "test div with css 030", test_chtml30_div_tag_with_css_030);
CU_add_test(chtml30_suite, "test blockquote with css 001", test_chtml30_blockquote_tag_with_css_001);
CU_add_test(chtml30_suite, "test blockquote with css 002", test_chtml30_blockquote_tag_with_css_002);
#undef TEST_STRING
#undef RESULT_STRING
}
+char *test_chxj_serf_get134(request_rec *r, apr_pool_t *ppool, const char *uri_path, int ss, apr_size_t *len)
+{
+ static char *css = "a:focus { display: none }\n"
+ "a:link { display: none }\n"
+ "a { display: none }\n"
+ "hr { display: none }\n"
+ "a:visited { display:none }\n"
+ "div { display:-wap-marquee;\n"
+ " -wap-marquee-style: alternate;-wap-marquee-dir:rtl;-wap-marquee-loop:infinite;background:#000;color:#fff; }\n";
+
+ *len = strlen(css);
+ call_check = 1;
+ return css;
+}
+void test_chtml30_div_tag_with_css_029()
+{
+#define TEST_STRING "<html><head><link rel=\"stylesheet\" href=\"http://localhost/a.css\" type=\"text/css\" />" \
+ "</head><body><div>あいう</div></body></html>"
+#define RESULT_STRING "<html><head></head><body><div><marquee behavior=\"alternate\" direction=\"left\" loop=\"16\">あいう</marquee></div></body></html>"
+ char *ret;
+ char *tmp;
+ device_table spec;
+ chxjconvrule_entry entry;
+ cookie_t cookie;
+ apr_size_t destlen;
+ APR_INIT;
+ chxj_serf_get = test_chxj_serf_get134;
+ call_check = 0;
+
+ COOKIE_INIT(cookie);
+
+ SPEC_INIT(spec);
+ destlen = sizeof(TEST_STRING)-1;
+ entry.action |= CONVRULE_CSS_ON_BIT;
+
+ tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+ ret = chxj_convert_chtml30(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+ ret = chxj_rencoding(&r, ret, &destlen);
+ fprintf(stderr, "actual:[%s]\n", ret);
+ fprintf(stderr, "expect:[%s]\n", RESULT_STRING);
+ CU_ASSERT(ret != NULL);
+ CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+ CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+ CU_ASSERT(call_check == 1);
+
+ APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_chtml30_div_tag_with_css_030()
+{
+#define TEST_STRING "<html><head>" \
+ "</head><body><div style=\"display:-wap-marquee;-wap-marquee-style:alternate;-wap-marquee-dir:rtl;-wap-marquee-loop:infinite;background-color:#fff;color:#f00;\">あいう</div></body></html>"
+#define RESULT_STRING "<html><head></head><body><div><font color=\"#ff0000\"><marquee behavior=\"alternate\" direction=\"left\" loop=\"16\">あいう</marquee></font></div></body></html>"
+ char *ret;
+ char *tmp;
+ device_table spec;
+ chxjconvrule_entry entry;
+ cookie_t cookie;
+ apr_size_t destlen;
+ APR_INIT;
+ chxj_serf_get = test_chxj_serf_get133;
+ call_check = 0;
+
+ COOKIE_INIT(cookie);
+
+ SPEC_INIT(spec);
+ destlen = sizeof(TEST_STRING)-1;
+ entry.action |= CONVRULE_CSS_ON_BIT;
+
+ tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+ ret = chxj_convert_chtml30(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+ ret = chxj_rencoding(&r, ret, &destlen);
+ fprintf(stderr, "actual:[%s]\n", ret);
+ fprintf(stderr, "expect:[%s]\n", RESULT_STRING);
+ CU_ASSERT(ret != NULL);
+ CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+ CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+ CU_ASSERT(call_check == 0);
+
+ APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}