Add CefServer API for handling HTTP/WebSocket requests (issue #2278)

This commit is contained in:
Marshall Greenblatt
2017-11-09 14:00:47 -05:00
parent 39e689d80a
commit 4b39753c41
46 changed files with 5041 additions and 71 deletions

View File

@@ -7,12 +7,14 @@
#include <algorithm>
#include <string>
#include "tests/cefclient/browser/test_runner.h"
namespace client {
namespace binding_test {
namespace {
const char kTestUrl[] = "http://tests/binding";
const char kTestUrlPath[] = "/binding";
const char kTestMessageName[] = "BindingTest";
// Handle messages in the browser process.
@@ -29,7 +31,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
CefRefPtr<Callback> callback) OVERRIDE {
// Only handle messages from the test URL.
const std::string& url = frame->GetURL();
if (url.find(kTestUrl) != 0)
if (!test_runner::IsTestURL(url, kTestUrlPath))
return false;
const std::string& message_name = request;