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

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

Issue 2408443003: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed)
Patch Set: Add comment. Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.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 7870 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698