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 bfdc2655ad
commit 89a1f2b372
46 changed files with 5041 additions and 71 deletions

View File

@@ -12,6 +12,7 @@
#include "include/base/cef_bind.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "tests/cefclient/browser/main_context.h"
#include "tests/cefclient/browser/test_runner.h"
#include "tests/cefclient/browser/window_test_runner.h"
#if defined(OS_WIN) || defined(OS_LINUX)
@@ -31,7 +32,7 @@ namespace window_test {
namespace {
const char kTestUrl[] = "http://tests/window";
const char kTestUrlPath[] = "/window";
const char kMessagePositionName[] = "WindowTest.Position";
const char kMessageMinimizeName[] = "WindowTest.Minimize";
const char kMessageMaximizeName[] = "WindowTest.Maximize";
@@ -69,7 +70,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;