2015-01-22 21:21:21 +01:00
|
|
|
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_TEST_RUNNER_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_TEST_RUNNER_H_
|
|
|
|
#pragma once
|
2015-01-22 21:21:21 +01:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "include/cef_browser.h"
|
|
|
|
#include "include/cef_resource_handler.h"
|
|
|
|
#include "include/cef_request.h"
|
|
|
|
#include "include/wrapper/cef_message_router.h"
|
|
|
|
|
|
|
|
namespace client {
|
|
|
|
namespace test_runner {
|
|
|
|
|
|
|
|
// Run a test.
|
|
|
|
void RunTest(CefRefPtr<CefBrowser> browser, int id);
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
// Returns the contents of the CefRequest as a string.
|
|
|
|
std::string DumpRequestContents(CefRefPtr<CefRequest> request);
|
|
|
|
|
|
|
|
// Returns a data: URI with the specified contents.
|
|
|
|
std::string GetDataURI(const std::string& data,
|
|
|
|
const std::string& mime_type);
|
2015-01-22 21:21:21 +01:00
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
// Returns the string representation of the specified error code.
|
|
|
|
std::string GetErrorString(cef_errorcode_t code);
|
|
|
|
|
2015-01-22 21:21:21 +01:00
|
|
|
// Get test resources.
|
|
|
|
CefRefPtr<CefResourceHandler> GetResourceHandler(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request);
|
|
|
|
|
|
|
|
// Show a JS alert message.
|
|
|
|
void Alert(CefRefPtr<CefBrowser> browser, const std::string& message);
|
|
|
|
|
|
|
|
// Create all CefMessageRouterBrowserSide::Handler objects. They will be
|
|
|
|
// deleted when the ClientHandler is destroyed.
|
|
|
|
typedef std::set<CefMessageRouterBrowserSide::Handler*> MessageHandlerSet;
|
|
|
|
void CreateMessageHandlers(MessageHandlerSet& handlers);
|
|
|
|
|
|
|
|
// Register scheme handlers for tests.
|
|
|
|
void RegisterSchemeHandlers();
|
|
|
|
|
|
|
|
} // namespace test_runner
|
|
|
|
} // namespace client
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_TEST_RUNNER_H_
|