Commit 7081e308 authored by danakj's avatar danakj Committed by Commit Bot

Remove FetchManifest() helper in web_test_support_renderer.

TestRunnerForSpecificView can call the blink method directly. Add a
TODO to move it over TestRunnerBindings, if it can know about the
frame it's bound to.

R=avi@chromium.org

Bug: 866140
Change-Id: Idaef58ff1dafac9c4d625c9ae0a7f2d80aa8011a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140979
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757939}
parent 30f97a28
......@@ -13,11 +13,9 @@
#include "base/callback_forward.h"
namespace blink {
struct Manifest;
class WebInputEvent;
struct WebSize;
class WebURL;
class WebView;
} // namespace blink
namespace gfx {
......@@ -39,10 +37,6 @@ void EnableRendererWebTestMode();
// between WebFrames and RenderFrames.
void EnableWebTestProxyCreation();
typedef base::OnceCallback<void(const blink::WebURL&, const blink::Manifest&)>
FetchManifestCallback;
void FetchManifest(blink::WebView* view, FetchManifestCallback callback);
// Returns the length of the local session history of a render view.
int GetLocalSessionHistoryLength(RenderView* render_view);
......
......@@ -565,13 +565,6 @@ bool BlinkTestRunner::AllowExternalPages() {
return test_config_->allow_external_pages;
}
void BlinkTestRunner::FetchManifest(
blink::WebView* view,
base::OnceCallback<void(const blink::WebURL&, const blink::Manifest&)>
callback) {
::content::FetchManifest(view, std::move(callback));
}
void BlinkTestRunner::SetPermission(const std::string& name,
const std::string& value,
const GURL& origin,
......
......@@ -114,10 +114,6 @@ class BlinkTestRunner : public RenderViewObserver,
void LoadURLForFrame(const blink::WebURL& url,
const std::string& frame_name) override;
bool AllowExternalPages() override;
void FetchManifest(
blink::WebView* view,
base::OnceCallback<void(const blink::WebURL&, const blink::Manifest&)>
callback) override;
void SetPermission(const std::string& name,
const std::string& value,
const GURL& origin,
......
......@@ -49,6 +49,7 @@
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_input_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_manifest_manager.h"
#include "third_party/blink/public/web/web_render_theme.h"
#include "third_party/blink/public/web/web_script_source.h"
#include "third_party/blink/public/web/web_security_policy.h"
......@@ -317,6 +318,8 @@ void TestRunnerForSpecificView::CopyImageAtAndCapturePixelsAsyncThen(
void TestRunnerForSpecificView::GetManifestThen(
v8::Local<v8::Function> callback) {
// TODO(danakj): Move GetManifestThen method to per-frame TestRunnerBindings,
// instead of per-view bindings. Then we don't need to find a (main) frame.
if (!web_view()->MainFrame()->IsWebLocalFrame()) {
CHECK(false) << "This function cannot be called if the main frame is not a "
"local frame.";
......@@ -325,8 +328,8 @@ void TestRunnerForSpecificView::GetManifestThen(
v8::UniquePersistent<v8::Function> persistent_callback(
blink::MainThreadIsolate(), callback);
delegate()->FetchManifest(
web_view(),
blink::WebManifestManager::RequestManifestForTesting(
web_view()->MainFrame()->ToWebLocalFrame(),
base::BindOnce(&TestRunnerForSpecificView::GetManifestCallback,
weak_factory_.GetWeakPtr(),
std::move(persistent_callback)));
......
......@@ -26,7 +26,6 @@ class DictionaryValue;
} // namespace base
namespace blink {
struct Manifest;
class WebInputEvent;
class WebLocalFrame;
class WebPlugin;
......@@ -195,12 +194,6 @@ class WebTestDelegate {
// Returns true if resource requests to external URLs should be permitted.
virtual bool AllowExternalPages() = 0;
// Fetch the manifest for a given WebView from the given url.
virtual void FetchManifest(
blink::WebView* view,
base::OnceCallback<void(const blink::WebURL&, const blink::Manifest&)>
callback) = 0;
// Sends a message to the WebTestPermissionManager in order for it to
// update its database.
virtual void SetPermission(const std::string& permission_name,
......
......@@ -29,7 +29,6 @@
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/platform/web_float_rect.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/web/web_manifest_manager.h"
#include "third_party/blink/public/web/web_view.h"
#include "ui/base/ui_base_switches.h"
#include "ui/events/blink/blink_event_util.h"
......@@ -87,12 +86,6 @@ void EnableWebTestProxyCreation() {
RenderFrameImpl::InstallCreateHook(CreateWebFrameTestProxy);
}
void FetchManifest(blink::WebView* view, FetchManifestCallback callback) {
blink::WebManifestManager::RequestManifestForTesting(
RenderFrameImpl::FromWebFrame(view->MainFrame())->GetWebFrame(),
std::move(callback));
}
void SetWorkerRewriteURLFunction(RewriteURLFunction rewrite_url_function) {
WebWorkerFetchContextImpl::InstallRewriteURLFunction(rewrite_url_function);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment