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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 398313002: Teach ContentSecurityPolicy about WebURLRequest::RequestContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: UseCounter Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 5882 matching lines...) Expand 10 before | Expand all | Expand 10 after
5893 registerMockedChromeURLLoad("test.pdf"); 5893 registerMockedChromeURLLoad("test.pdf");
5894 5894
5895 RefPtr<blink::LocalFrame> frame = toLocalFrame(webViewHelper.webViewImpl()-> page()->mainFrame()); 5895 RefPtr<blink::LocalFrame> frame = toLocalFrame(webViewHelper.webViewImpl()-> page()->mainFrame());
5896 5896
5897 MockDocumentThreadableLoaderClient client; 5897 MockDocumentThreadableLoaderClient client;
5898 blink::ThreadableLoaderOptions options; 5898 blink::ThreadableLoaderOptions options;
5899 5899
5900 // First try to load the request with regular access. Should fail. 5900 // First try to load the request with regular access. Should fail.
5901 options.crossOriginRequestPolicy = blink::UseAccessControl; 5901 options.crossOriginRequestPolicy = blink::UseAccessControl;
5902 blink::ResourceLoaderOptions resourceLoaderOptions; 5902 blink::ResourceLoaderOptions resourceLoaderOptions;
5903 blink::ResourceRequest request(resourceUrl);
5904 request.setRequestContext(WebURLRequest::RequestContextInternal);
5903 blink::DocumentThreadableLoader::loadResourceSynchronously( 5905 blink::DocumentThreadableLoader::loadResourceSynchronously(
5904 *frame->document(), blink::ResourceRequest(resourceUrl), client, options , resourceLoaderOptions); 5906 *frame->document(), request, client, options, resourceLoaderOptions);
5905 EXPECT_TRUE(client.failed()); 5907 EXPECT_TRUE(client.failed());
5906 5908
5907 client.reset(); 5909 client.reset();
5908 // Try to load the request with cross origin access. Should succeed. 5910 // Try to load the request with cross origin access. Should succeed.
5909 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; 5911 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests;
5910 blink::DocumentThreadableLoader::loadResourceSynchronously( 5912 blink::DocumentThreadableLoader::loadResourceSynchronously(
5911 *frame->document(), blink::ResourceRequest(resourceUrl), client, options , resourceLoaderOptions); 5913 *frame->document(), request, client, options, resourceLoaderOptions);
5912 EXPECT_FALSE(client.failed()); 5914 EXPECT_FALSE(client.failed());
5913 } 5915 }
5914 5916
5915 } // namespace 5917 } // namespace
OLDNEW
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698