Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3599)

Unified Diff: content/test/layouttest_support.cc

Issue 584553002: Extend the TestRunner so that the manifest-src CSP directive can be tested from layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Second try Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index d582632d3cac0a1af625c23d7c76c07e2f3e2bfc..a63a26477bf9c238bc2911b55fab9b2f794b73f9 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -11,6 +11,7 @@
#include "content/common/gpu/image_transport_surface.h"
#include "content/public/common/page_state.h"
#include "content/public/renderer/renderer_gamepad_provider.h"
+#include "content/renderer/fetchers/manifest_fetcher.h"
#include "content/renderer/history_entry.h"
#include "content/renderer/history_serialization.h"
#include "content/renderer/render_frame_impl.h"
@@ -25,6 +26,7 @@
#include "third_party/WebKit/public/platform/WebDeviceOrientationData.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
#include "third_party/WebKit/public/web/WebHistoryItem.h"
+#include "third_party/WebKit/public/web/WebView.h"
#if defined(OS_MACOSX)
#include "content/browser/frame_host/popup_menu_helper_mac.h"
@@ -82,6 +84,25 @@ void EnableWebTestProxyCreation(
RenderFrameImpl::InstallCreateHook(CreateWebFrameTestProxy);
}
+void FetchManifestDoneCallback(
+ scoped_ptr<ManifestFetcher> fetcher,
+ const FetchManifestCallback& callback,
+ const blink::WebURLResponse& response,
+ const std::string& data) {
+ // |fetcher| will be autodeleted here as it is going out of scope.
+ callback.Run(response, data);
+}
+
+void FetchManifest(blink::WebView* view, const GURL& url,
+ const FetchManifestCallback& callback) {
+ scoped_ptr<ManifestFetcher> fetcher(new ManifestFetcher(url));
+
+ fetcher->Start(view->mainFrame(),
+ base::Bind(&FetchManifestDoneCallback,
+ base::Passed(&fetcher),
+ callback));
+}
+
void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider) {
RenderThreadImpl::current()->webkit_platform_support()->
SetPlatformEventObserverForTesting(
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698