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

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

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, resolve comment rewrap conflicts. 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 7869 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 EXPECT_EQ(0, resource); // Fetching resource wasn't allowed. 7890 // Fetching resource wasn't allowed.
7891 ASSERT_TRUE(resource);
7892 EXPECT_TRUE(resource->errorOccurred());
7893 EXPECT_TRUE(resource->resourceError().isAccessCheck());
7891 } 7894 }
7892 7895
7893 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) { 7896 TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) {
7894 URLTestHelpers::registerMockedURLLoad( 7897 URLTestHelpers::registerMockedURLLoad(
7895 toKURL(m_notBaseURL + "link-manifest-fetch.json"), 7898 toKURL(m_notBaseURL + "link-manifest-fetch.json"),
7896 "link-manifest-fetch.json"); 7899 "link-manifest-fetch.json");
7897 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'", 7900 registerMockedHttpURLLoadWithCSP("foo.html", "manifest-src 'self'",
7898 /* report only */ true); 7901 /* report only */ true);
7899 7902
7900 FrameTestHelpers::WebViewHelper webViewHelper; 7903 FrameTestHelpers::WebViewHelper webViewHelper;
(...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
10159 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); 10162 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr);
10160 10163
10161 Document* document = 10164 Document* document =
10162 toLocalFrame(helper.webView()->page()->mainFrame())->document(); 10165 toLocalFrame(helper.webView()->page()->mainFrame())->document();
10163 EXPECT_TRUE(document->isImageDocument()); 10166 EXPECT_TRUE(document->isImageDocument());
10164 EXPECT_EQ(Resource::DecodeError, 10167 EXPECT_EQ(Resource::DecodeError,
10165 toImageDocument(document)->cachedImage()->getStatus()); 10168 toImageDocument(document)->cachedImage()->getStatus());
10166 } 10169 }
10167 10170
10168 } // namespace blink 10171 } // 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