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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/platform/WebDocumentSubresourceFilter.h" 5 #include "public/platform/WebDocumentSubresourceFilter.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/html/HTMLImageElement.h" 8 #include "core/html/HTMLImageElement.h"
9 #include "platform/testing/URLTestHelpers.h" 9 #include "platform/testing/URLTestHelpers.h"
10 #include "platform/testing/UnitTestHelpers.h" 10 #include "platform/testing/UnitTestHelpers.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ::testing::ElementsAre("/white-1x1.png")); 128 ::testing::ElementsAre("/white-1x1.png"));
129 } 129 }
130 130
131 TEST_F(WebDocumentSubresourceFilterTest, DisallowedSubresource) { 131 TEST_F(WebDocumentSubresourceFilterTest, DisallowedSubresource) {
132 loadDocument(false /* allowSubresources */); 132 loadDocument(false /* allowSubresources */);
133 expectSubresourceWasLoaded(false); 133 expectSubresourceWasLoaded(false);
134 } 134 }
135 135
136 TEST_F(WebDocumentSubresourceFilterTest, FilteringDecisionIsMadeLoadByLoad) { 136 TEST_F(WebDocumentSubresourceFilterTest, FilteringDecisionIsMadeLoadByLoad) {
137 for (const bool allowSubresources : {false, true}) { 137 for (const bool allowSubresources : {false, true}) {
138 SCOPED_TRACE(::testing::Message() << "First load allows subresources = " 138 SCOPED_TRACE(::testing::Message()
139 << allowSubresources); 139 << "First load allows subresources = " << allowSubresources);
140 140
141 loadDocument(allowSubresources); 141 loadDocument(allowSubresources);
142 expectSubresourceWasLoaded(allowSubresources); 142 expectSubresourceWasLoaded(allowSubresources);
143 143
144 loadDocument(!allowSubresources); 144 loadDocument(!allowSubresources);
145 expectSubresourceWasLoaded(!allowSubresources); 145 expectSubresourceWasLoaded(!allowSubresources);
146 EXPECT_THAT(queriedSubresourcePaths(), 146 EXPECT_THAT(queriedSubresourcePaths(),
147 ::testing::ElementsAre("/white-1x1.png")); 147 ::testing::ElementsAre("/white-1x1.png"));
148 148
149 WebCache::clear(); 149 WebCache::clear();
150 } 150 }
151 } 151 }
152 152
153 } // namespace blink 153 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/VisualViewportTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698