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