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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)
Patch Set: Rebase. Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 public: 164 public:
165 static ImageResourceTestMockFetchContext* create() { 165 static ImageResourceTestMockFetchContext* create() {
166 return new ImageResourceTestMockFetchContext; 166 return new ImageResourceTestMockFetchContext;
167 } 167 }
168 168
169 virtual ~ImageResourceTestMockFetchContext() {} 169 virtual ~ImageResourceTestMockFetchContext() {}
170 170
171 bool allowImage(bool imagesEnabled, const KURL&) const override { 171 bool allowImage(bool imagesEnabled, const KURL&) const override {
172 return true; 172 return true;
173 } 173 }
174 bool canRequest(Resource::Type, 174 ResourceRequestBlockedReason canRequest(
175 const ResourceRequest&, 175 Resource::Type,
176 const KURL&, 176 const ResourceRequest&,
177 const ResourceLoaderOptions&, 177 const KURL&,
178 bool forPreload, 178 const ResourceLoaderOptions&,
179 FetchRequest::OriginRestriction) const override { 179 bool forPreload,
180 return true; 180 FetchRequest::OriginRestriction) const override {
181 return ResourceRequestBlockedReason::None;
181 } 182 }
182 bool shouldLoadNewResource(Resource::Type) const override { return true; } 183 bool shouldLoadNewResource(Resource::Type) const override { return true; }
183 WebTaskRunner* loadingTaskRunner() const override { return m_runner.get(); } 184 WebTaskRunner* loadingTaskRunner() const override { return m_runner.get(); }
184 185
185 private: 186 private:
186 ImageResourceTestMockFetchContext() 187 ImageResourceTestMockFetchContext()
187 : m_runner(wrapUnique(new scheduler::FakeWebTaskRunner)) {} 188 : m_runner(wrapUnique(new scheduler::FakeWebTaskRunner)) {}
188 189
189 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; 190 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner;
190 }; 191 };
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 EXPECT_TRUE(client->notifyFinishedCalled()); 1213 EXPECT_TRUE(client->notifyFinishedCalled());
1213 EXPECT_TRUE(cachedImage->getImage()->isBitmapImage()); 1214 EXPECT_TRUE(cachedImage->getImage()->isBitmapImage());
1214 EXPECT_EQ(50, cachedImage->getImage()->width()); 1215 EXPECT_EQ(50, cachedImage->getImage()->width());
1215 EXPECT_EQ(50, cachedImage->getImage()->height()); 1216 EXPECT_EQ(50, cachedImage->getImage()->height());
1216 1217
1217 WTF::setTimeFunctionsForTesting(nullptr); 1218 WTF::setTimeFunctionsForTesting(nullptr);
1218 } 1219 }
1219 1220
1220 } // namespace 1221 } // namespace
1221 } // namespace blink 1222 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/fetch/MockFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698