mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefServer API for handling HTTP/WebSocket requests (issue #2278)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user