| 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 6874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6885 { | 6885 { |
| 6886 URLTestHelpers::registerMockedURLLoad(toKURL(m_notBaseURL + "link-manifest-f
etch.json"), "link-manifest-fetch.json"); | 6886 URLTestHelpers::registerMockedURLLoad(toKURL(m_notBaseURL + "link-manifest-f
etch.json"), "link-manifest-fetch.json"); |
| 6887 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'"); | 6887 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'"); |
| 6888 | 6888 |
| 6889 FrameTestHelpers::WebViewHelper webViewHelper; | 6889 FrameTestHelpers::WebViewHelper webViewHelper; |
| 6890 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); | 6890 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); |
| 6891 Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->docu
ment(); | 6891 Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->docu
ment(); |
| 6892 | 6892 |
| 6893 Resource* resource = fetchManifest(document, toKURL(m_notBaseURL + "link-man
ifest-fetch.json")); | 6893 Resource* resource = fetchManifest(document, toKURL(m_notBaseURL + "link-man
ifest-fetch.json")); |
| 6894 | 6894 |
| 6895 EXPECT_EQ(0, resource); // Fetching resource wasn't allowed. | 6895 // Fetching resource wasn't allowed. |
| 6896 ASSERT_TRUE(resource); |
| 6897 EXPECT_TRUE(resource->errorOccurred()); |
| 6898 EXPECT_TRUE(resource->resourceError().isAccessCheck()); |
| 6896 } | 6899 } |
| 6897 | 6900 |
| 6898 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) | 6901 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) |
| 6899 { | 6902 { |
| 6900 URLTestHelpers::registerMockedURLLoad(toKURL(m_notBaseURL + "link-manifest-f
etch.json"), "link-manifest-fetch.json"); | 6903 URLTestHelpers::registerMockedURLLoad(toKURL(m_notBaseURL + "link-manifest-f
etch.json"), "link-manifest-fetch.json"); |
| 6901 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'", /* repor
t only */ true); | 6904 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'", /* repor
t only */ true); |
| 6902 | 6905 |
| 6903 FrameTestHelpers::WebViewHelper webViewHelper; | 6906 FrameTestHelpers::WebViewHelper webViewHelper; |
| 6904 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); | 6907 webViewHelper.initializeAndLoad(m_baseURL + "foo.html"); |
| 6905 Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->docu
ment(); | 6908 Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->docu
ment(); |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8938 FrameTestHelpers::WebViewHelper helper; | 8941 FrameTestHelpers::WebViewHelper helper; |
| 8939 helper.initializeAndLoad(url, true); | 8942 helper.initializeAndLoad(url, true); |
| 8940 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); | 8943 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); |
| 8941 | 8944 |
| 8942 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do
cument(); | 8945 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do
cument(); |
| 8943 EXPECT_TRUE(document->isImageDocument()); | 8946 EXPECT_TRUE(document->isImageDocument()); |
| 8944 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g
etStatus()); | 8947 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g
etStatus()); |
| 8945 } | 8948 } |
| 8946 | 8949 |
| 8947 } // namespace blink | 8950 } // namespace blink |
| OLD | NEW |