Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #709 from pagespeed/xqyin-color-messages
Browse files Browse the repository at this point in the history
Color messages in the message_history page. Add system test for this change.
  • Loading branch information
xqyin committed May 28, 2014
2 parents c9a106b + b6098ce commit 96f185d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ngx_pagespeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@ ngx_int_t ps_simple_handler(ngx_http_request_t* r,
"Please check if it's enabled in pagespeed.conf.\n",
message_handler);
} else {
HtmlKeywords::WritePre(log, &writer, message_handler);
HtmlKeywords::WritePre(log, "", &writer, message_handler);
}
break;
}
Expand Down
12 changes: 12 additions & 0 deletions test/nginx_system_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2633,6 +2633,18 @@ OUTFILE=$OUTDIR/etags
$WGET -o $OUTFILE -O /dev/null --header "If-None-Match: $ETAG" $URL
check fgrep -q "awaiting response... 304" $OUTFILE

# Test if the warning messages are colored in message_history page.
# We color the messages in message_history page to make it clearer to read.
# Red for Error messages. Blue for Warning messages.
# Orange for Fatal messages. Black by default.
# Won't test Error messages and Fatal messages in this test.
# TODO(xqyin): test all the types of messages in future unit test.
start_test Messages are colored in message_history
INJECT=$($CURL --silent $HOSTNAME/?PageSpeed=Warning_trigger)
OUT=$($WGET -q -O - $HOSTNAME/pagespeed_admin/message_history | \
grep Warning_trigger)
check_from "$OUT" fgrep -q "color:blue;"

start_test PageSpeed resources should have a content length.
URL="$EXAMPLE_ROOT/styles/W.rewrite_css_images.css.pagespeed.cf.Hash.css"
OUT=$($WGET_DUMP --save-headers $URL)
Expand Down

0 comments on commit 96f185d

Please sign in to comment.