mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Specify a background color for tests so that they're easier to read when transparent rendering is enabled.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1428 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -84,7 +84,8 @@ void RunGetSourceTest(CefRefPtr<CefBrowser> browser) {
|
|||||||
std::string source = StringReplace(string, "<", "<");
|
std::string source = StringReplace(string, "<", "<");
|
||||||
source = StringReplace(source, ">", ">");
|
source = StringReplace(source, ">", ">");
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "<html><body>Source:<pre>" << source << "</pre></body></html>";
|
ss << "<html><body bgcolor=\"white\">Source:<pre>" << source <<
|
||||||
|
"</pre></body></html>";
|
||||||
browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/getsource");
|
browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/getsource");
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -103,7 +104,8 @@ void RunGetTextTest(CefRefPtr<CefBrowser> browser) {
|
|||||||
std::string text = StringReplace(string, "<", "<");
|
std::string text = StringReplace(string, "<", "<");
|
||||||
text = StringReplace(text, ">", ">");
|
text = StringReplace(text, ">", ">");
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "<html><body>Text:<pre>" << text << "</pre></body></html>";
|
ss << "<html><body bgcolor=\"white\">Text:<pre>" << text <<
|
||||||
|
"</pre></body></html>";
|
||||||
browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/gettext");
|
browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/gettext");
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -150,7 +152,8 @@ void RunPluginInfoTest(CefRefPtr<CefBrowser> browser) {
|
|||||||
public:
|
public:
|
||||||
explicit Visitor(CefRefPtr<CefBrowser> browser)
|
explicit Visitor(CefRefPtr<CefBrowser> browser)
|
||||||
: browser_(browser) {
|
: browser_(browser) {
|
||||||
html_ = "<html><head><title>Plugin Info Test</title></head><body>"
|
html_ = "<html><head><title>Plugin Info Test</title></head>"
|
||||||
|
"<body bgcolor=\"white\">"
|
||||||
"\n<b>Installed plugins:</b>";
|
"\n<b>Installed plugins:</b>";
|
||||||
}
|
}
|
||||||
~Visitor() {
|
~Visitor() {
|
||||||
|
@ -438,7 +438,8 @@ void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
|
|||||||
|
|
||||||
// Display a load error message.
|
// Display a load error message.
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "<html><body><h2>Failed to load URL " << std::string(failedUrl) <<
|
ss << "<html><body bgcolor=\"white\">"
|
||||||
|
"<h2>Failed to load URL " << std::string(failedUrl) <<
|
||||||
" with error " << std::string(errorText) << " (" << errorCode <<
|
" with error " << std::string(errorText) << " (" << errorCode <<
|
||||||
").</h2></body></html>";
|
").</h2></body></html>";
|
||||||
frame->LoadString(ss.str(), failedUrl);
|
frame->LoadString(ss.str(), failedUrl);
|
||||||
@ -469,12 +470,14 @@ CefRefPtr<CefResourceHandler> ClientHandler::GetResourceHandler(
|
|||||||
// Show the request contents.
|
// Show the request contents.
|
||||||
std::string dump;
|
std::string dump;
|
||||||
DumpRequestContents(request, dump);
|
DumpRequestContents(request, dump);
|
||||||
|
std::string str = "<html><body bgcolor=\"white\"><pre>" + dump +
|
||||||
|
"</pre></body></html>";
|
||||||
CefRefPtr<CefStreamReader> stream =
|
CefRefPtr<CefStreamReader> stream =
|
||||||
CefStreamReader::CreateForData(
|
CefStreamReader::CreateForData(
|
||||||
static_cast<void*>(const_cast<char*>(dump.c_str())),
|
static_cast<void*>(const_cast<char*>(str.c_str())),
|
||||||
dump.size());
|
str.size());
|
||||||
ASSERT(stream.get());
|
ASSERT(stream.get());
|
||||||
return new CefStreamResourceHandler("text/plain", stream);
|
return new CefStreamResourceHandler("text/html", stream);
|
||||||
} else {
|
} else {
|
||||||
// Load the resource from file.
|
// Load the resource from file.
|
||||||
CefRefPtr<CefStreamReader> stream =
|
CefRefPtr<CefStreamReader> stream =
|
||||||
|
@ -16,7 +16,7 @@ function sendMessage() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<form>
|
<form>
|
||||||
Message: <input type="text" id="message" value="My Message">
|
Message: <input type="text" id="message" value="My Message">
|
||||||
<br/><input type="button" onclick="sendMessage();" value="Send Message">
|
<br/><input type="button" onclick="sendMessage();" value="Send Message">
|
||||||
|
@ -48,7 +48,7 @@ function show_file_dialog(element, test) {
|
|||||||
window.addEventListener('load', setup, false);
|
window.addEventListener('load', setup, false);
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<form>
|
<form>
|
||||||
Click a button to show the associated dialog type.
|
Click a button to show the associated dialog type.
|
||||||
<br/><input type="button" onclick="show_alert();" value="Show Alert">
|
<br/><input type="button" onclick="show_alert();" value="Show Alert">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<p id="instructions">Select some portion of the below page content and click the "Describe Selection" button. The selected region will then be described below.</p>
|
<p id="instructions">Select some portion of the below page content and click the "Describe Selection" button. The selected region will then be described below.</p>
|
||||||
<p id="p1">This is p1</p>
|
<p id="p1">This is p1</p>
|
||||||
<p id="p2">This is p2</p>
|
<p id="p2">This is p2</p>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
var val = window.localStorage.getItem('val');
|
var val = window.localStorage.getItem('val');
|
||||||
function addLine() {
|
function addLine() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Other Tests</title>
|
<title>Other Tests</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<h3>Various other internal and external tests.</h3>
|
<h3>Various other internal and external tests.</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://mudcu.be/labs/JS1k/BreathingGalaxies.html">Accelerated 2D Canvas</a></li>
|
<li><a href="http://mudcu.be/labs/JS1k/BreathingGalaxies.html">Accelerated 2D Canvas</a></li>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
body { font-family: Tahoma, Serif; font-size: 9pt; }
|
body { font-family: Tahoma, Serif; font-size: 9pt; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<h1>Performance Tests</h1>
|
<h1>Performance Tests</h1>
|
||||||
<input type="button" value="Run Tests" onClick="run();" id="run"/> Filter: <input type="text" size="50" id="filters"/>
|
<input type="button" value="Run Tests" onClick="run();" id="run"/> Filter: <input type="text" size="50" id="filters"/>
|
||||||
<div><span id="statusBox"></span> <progress id="progressBox" value="0" style="display:none"></progress></div>
|
<div><span id="statusBox"></span> <progress id="progressBox" value="0" style="display:none"></progress></div>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
.hide { display: none; }
|
.hide { display: none; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<h1>Performance Tests (2)</h1>
|
<h1>Performance Tests (2)</h1>
|
||||||
|
|
||||||
<form id="sForm" onsubmit="runTestSuite();return false">
|
<form id="sForm" onsubmit="runTestSuite();return false">
|
||||||
|
@ -32,7 +32,7 @@ function position() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<form>
|
<form>
|
||||||
Click a button to perform the associated window action.
|
Click a button to perform the associated window action.
|
||||||
<br/><input type="button" onclick="minimize();" value="Minimize">
|
<br/><input type="button" onclick="minimize();" value="Minimize">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body bgcolor="white">
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
function execXMLHttpRequest()
|
function execXMLHttpRequest()
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,8 @@ class ClientSchemeHandler : public CefResourceHandler {
|
|||||||
std::string url = request->GetURL();
|
std::string url = request->GetURL();
|
||||||
if (strstr(url.c_str(), "handler.html") != NULL) {
|
if (strstr(url.c_str(), "handler.html") != NULL) {
|
||||||
// Build the response html
|
// Build the response html
|
||||||
data_ = "<html><head><title>Client Scheme Handler</title></head><body>"
|
data_ = "<html><head><title>Client Scheme Handler</title></head>"
|
||||||
|
"<body bgcolor=\"white\">"
|
||||||
"This contents of this page page are served by the "
|
"This contents of this page page are served by the "
|
||||||
"ClientSchemeHandler class handling the client:// protocol."
|
"ClientSchemeHandler class handling the client:// protocol."
|
||||||
"<br/>You should see an image:"
|
"<br/>You should see an image:"
|
||||||
|
Reference in New Issue
Block a user