1.修改js注入页面显示无效字符问题
This commit is contained in:
@@ -120,13 +120,11 @@ TEST(PatternInsert, CSS)
|
||||
char *input=NULL, *output=NULL;
|
||||
size_t output_sz=0, input_sz = 0;
|
||||
|
||||
input = rt_read_file(filename, &input_sz);
|
||||
input = execute_read_file(filename, &input_sz);
|
||||
EXPECT_TRUE(input_sz>0);
|
||||
|
||||
output_sz = insert_string(input, input_sz, NULL, custom, "css", &output);
|
||||
|
||||
//printf("output = %s\n", output);
|
||||
|
||||
EXPECT_TRUE(output_sz>0);
|
||||
EXPECT_TRUE(NULL!=strstr(output, custom));
|
||||
free(output);
|
||||
@@ -141,19 +139,14 @@ TEST(PatternInsert, after_body)
|
||||
char *input=NULL, *output=NULL;
|
||||
size_t output_sz=0, input_sz = 0;
|
||||
|
||||
input = rt_read_file(filename, &input_sz);
|
||||
input = execute_read_file(filename, &input_sz);
|
||||
EXPECT_TRUE(input_sz>0);
|
||||
|
||||
output_sz = insert_string(input, input_sz, "after-page-load", custom, "js", &output);
|
||||
|
||||
//printf("%s\n", output);
|
||||
|
||||
EXPECT_TRUE(output_sz>0);
|
||||
EXPECT_TRUE(NULL!=strstr(output, custom));
|
||||
|
||||
free(input);
|
||||
free(output);
|
||||
output = NULL;
|
||||
}
|
||||
|
||||
TEST(PatternInsert, before_body)
|
||||
@@ -164,18 +157,14 @@ TEST(PatternInsert, before_body)
|
||||
char *input=NULL, *output=NULL;
|
||||
size_t output_sz=0, input_sz = 0;
|
||||
|
||||
input = rt_read_file(filename, &input_sz);
|
||||
input = execute_read_file(filename, &input_sz);
|
||||
EXPECT_TRUE(input_sz>0);
|
||||
|
||||
output_sz = insert_string(input, input_sz, "before-page-load", custom, "js", &output);
|
||||
//printf("%s\n", output);
|
||||
|
||||
EXPECT_TRUE(output_sz>0);
|
||||
EXPECT_TRUE(NULL!=strstr(output, custom));
|
||||
|
||||
free(input);
|
||||
free(output);
|
||||
output = NULL;
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
|
||||
Reference in New Issue
Block a user