Commit 91bc3df1 authored by jochen's avatar jochen Committed by Commit bot

Plumb manifest fetching through WebTestDelegate interface

BUG=478250
R=mkwst@chromium.org

Review URL: https://codereview.chromium.org/1145463002

Cr-Commit-Position: refs/heads/master@{#329823}
parent 87ff1a73
......@@ -604,6 +604,14 @@ std::string BlinkTestRunner::DumpHistoryForWindow(WebTestProxyBase* proxy) {
current_entry_indexes_[pos]);
}
void BlinkTestRunner::FetchManifest(
blink::WebView* view,
const GURL& url,
const base::Callback<void(const blink::WebURLResponse& response,
const std::string& data)>& callback) {
::content::FetchManifest(view, url, callback);
}
void BlinkTestRunner::SetPermission(const std::string& name,
const std::string& value,
const GURL& origin,
......
......@@ -109,6 +109,11 @@ class BlinkTestRunner : public RenderViewObserver,
const std::string& frame_name) override;
bool AllowExternalPages() override;
std::string DumpHistoryForWindow(WebTestProxyBase* proxy) override;
void FetchManifest(
blink::WebView* view,
const GURL& url,
const base::Callback<void(const blink::WebURLResponse& response,
const std::string& data)>& callback) override;
void SetPermission(const std::string& name,
const std::string& value,
const GURL& origin,
......
......@@ -7,7 +7,6 @@
#include <limits>
#include "base/logging.h"
#include "content/public/test/layouttest_support.h"
#include "content/shell/common/test_runner/test_preferences.h"
#include "content/shell/renderer/binding_helpers.h"
#include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
......@@ -2866,9 +2865,9 @@ void TestRunner::GetManifestThen(v8::Local<v8::Function> callback) {
scoped_ptr<InvokeCallbackTask> task(
new InvokeCallbackTask(this, callback));
FetchManifest(web_view_, web_view_->mainFrame()->document().manifestURL(),
base::Bind(&TestRunner::GetManifestCallback,
weak_factory_.GetWeakPtr(),
delegate_->FetchManifest(
web_view_, web_view_->mainFrame()->document().manifestURL(),
base::Bind(&TestRunner::GetManifestCallback, weak_factory_.GetWeakPtr(),
base::Passed(&task)));
}
......
......@@ -7,6 +7,7 @@
#include <string>
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
#include "third_party/WebKit/public/platform/WebString.h"
......@@ -24,6 +25,8 @@ class WebGamepad;
class WebGamepads;
class WebHistoryItem;
class WebLayer;
class WebURLResponse;
class WebView;
struct WebRect;
struct WebSize;
struct WebURLError;
......@@ -201,6 +204,13 @@ class WebTestDelegate {
// with the given WebTestProxyBase.
virtual std::string DumpHistoryForWindow(WebTestProxyBase* proxy) = 0;
// Fetch the manifest for a given WebView from the given url.
virtual void FetchManifest(
blink::WebView* view,
const GURL& url,
const base::Callback<void(const blink::WebURLResponse& response,
const std::string& data)>& callback) = 0;
// Sends a message to the LayoutTestPermissionManager in order for it to
// update its database.
virtual void SetPermission(const std::string& permission_name,
......
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