 Chromium Code Reviews
 Chromium Code Reviews 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
    
  
    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| Index: content/test/layouttest_support.cc | 
| diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc | 
| index d582632d3cac0a1af625c23d7c76c07e2f3e2bfc..c92f7cfe5ba8d9ac827ca402694d77effeb51934 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,24 @@ void EnableWebTestProxyCreation( | 
| RenderFrameImpl::InstallCreateHook(CreateWebFrameTestProxy); | 
| } | 
| +void FetchManifestDoneCallback(ManifestFetcher* fetcher, | 
| 
mlamouri (slow - plz ping)
2014/09/18 17:36:05
nit: I think you should align parameters.
 | 
| + ManifestFetcher::Callback callback, | 
| 
mlamouri (slow - plz ping)
2014/09/18 17:36:05
const ManifestFetcher::Callback& callback
 | 
| + const blink::WebURLResponse& response, | 
| + const std::string& data) { | 
| + delete fetcher; | 
| + callback.Run(response, data); | 
| +} | 
| + | 
| +void FetchManifest(blink::WebView* view, GURL url, | 
| + ManifestFetcher::Callback callback) { | 
| 
mlamouri (slow - plz ping)
2014/09/18 17:36:05
It's a bit odd to have a non typed callback in the
 | 
| + ManifestFetcher* fetcher = new ManifestFetcher(url); | 
| + | 
| + fetcher->Start(view->mainFrame(), | 
| + base::Bind(&FetchManifestDoneCallback, | 
| + base::Unretained(fetcher), | 
| 
mlamouri (slow - plz ping)
2014/09/18 17:36:05
Alternatively, you could make |fetcher| be a scope
 | 
| + callback)); | 
| +} | 
| + | 
| void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider) { | 
| RenderThreadImpl::current()->webkit_platform_support()-> | 
| SetPlatformEventObserverForTesting( |