mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: Simplify tests and related resource loading.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1173 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
||||
// Copyright (c) 2013 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.
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
#include "cefclient/client_handler.h"
|
||||
#include "cefclient/plugin_test.h"
|
||||
|
||||
void InitOSRPluginTest() {
|
||||
namespace osrplugin_test {
|
||||
|
||||
const char kTestUrl[] = "http://tests/osrplugin";
|
||||
|
||||
void InitTest() {
|
||||
// Structure providing information about the client plugin.
|
||||
CefPluginInfo plugin_info;
|
||||
CefString(&plugin_info.display_name).FromASCII("Client OSR Plugin");
|
||||
@@ -28,7 +32,7 @@ void InitOSRPluginTest() {
|
||||
CefRegisterPlugin(plugin_info);
|
||||
}
|
||||
|
||||
void RunOSRPluginTest(CefRefPtr<CefBrowser> browser, bool transparent) {
|
||||
void RunTest(CefRefPtr<CefBrowser> browser, bool transparent) {
|
||||
class Listener : public CefDOMEventListener {
|
||||
public:
|
||||
Listener() {}
|
||||
@@ -124,8 +128,10 @@ void RunOSRPluginTest(CefRefPtr<CefBrowser> browser, bool transparent) {
|
||||
// The DOM visitor will be called after the path is loaded.
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
static_cast<ClientHandler*>(client.get())->AddDOMVisitor(
|
||||
"http://tests/osrapp", new Visitor());
|
||||
kTestUrl, new Visitor());
|
||||
|
||||
SetOffScreenTransparent(transparent);
|
||||
browser->GetMainFrame()->LoadURL("http://tests/osrapp");
|
||||
browser->GetMainFrame()->LoadURL(kTestUrl);
|
||||
}
|
||||
|
||||
} // namespace osrplugin_test
|
||||
|
Reference in New Issue
Block a user