| OLD | NEW |
| 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 7870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7881 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'"); | 7881 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'"); |
| 7882 | 7882 |
| 7883 FrameTestHelpers::WebViewHelper webViewHelper; | 7883 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7884 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); | 7884 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); |
| 7885 Document* document = | 7885 Document* document = |
| 7886 webViewHelper.webView()->mainFrameImpl()->frame()->document(); | 7886 webViewHelper.webView()->mainFrameImpl()->frame()->document(); |
| 7887 | 7887 |
| 7888 Resource* resource = fetchManifest( | 7888 Resource* resource = fetchManifest( |
| 7889 document, toKURL(m_notBaseURL + "link-manifest-fetch.json")); | 7889 document, toKURL(m_notBaseURL + "link-manifest-fetch.json")); |
| 7890 | 7890 |
| 7891 EXPECT_EQ(0, resource); // Fetching resource wasn't allowed. | 7891 // Fetching resource wasn't allowed. |
| 7892 ASSERT_TRUE(resource); |
| 7893 EXPECT_TRUE(resource->errorOccurred()); |
| 7894 EXPECT_TRUE(resource->resourceError().isAccessCheck()); |
| 7892 } | 7895 } |
| 7893 | 7896 |
| 7894 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) { | 7897 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) { |
| 7895 URLTestHelpers::registerMockedURLLoad( | 7898 URLTestHelpers::registerMockedURLLoad( |
| 7896 toKURL(m_notBaseURL + "link-manifest-fetch.json"), | 7899 toKURL(m_notBaseURL + "link-manifest-fetch.json"), |
| 7897 "link-manifest-fetch.json"); | 7900 "link-manifest-fetch.json"); |
| 7898 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'", | 7901 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'", |
| 7899 /* report only */ true); | 7902 /* report only */ true); |
| 7900 | 7903 |
| 7901 FrameTestHelpers::WebViewHelper webViewHelper; | 7904 FrameTestHelpers::WebViewHelper webViewHelper; |
| (...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10160 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); | 10163 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); |
| 10161 | 10164 |
| 10162 Document* document = | 10165 Document* document = |
| 10163 toLocalFrame(helper.webView()->page()->mainFrame())->document(); | 10166 toLocalFrame(helper.webView()->page()->mainFrame())->document(); |
| 10164 EXPECT_TRUE(document->isImageDocument()); | 10167 EXPECT_TRUE(document->isImageDocument()); |
| 10165 EXPECT_EQ(Resource::DecodeError, | 10168 EXPECT_EQ(Resource::DecodeError, |
| 10166 toImageDocument(document)->cachedImage()->getStatus()); | 10169 toImageDocument(document)->cachedImage()->getStatus()); |
| 10167 } | 10170 } |
| 10168 | 10171 |
| 10169 } // namespace blink | 10172 } // namespace blink |
| OLD | NEW |