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

Unified Diff: third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: header changes 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp b/third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp
index 67c6163ab52a03be8f2e45be2e5a44e0ae4f1a71..2d83ecac33a357af80b84d3a09b0162b37479856 100644
--- a/third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebDocumentSubresourceFilterTest.cpp
@@ -7,6 +7,7 @@
#include "core/dom/Element.h"
#include "core/html/HTMLImageElement.h"
#include "platform/testing/URLTestHelpers.h"
+#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebURLLoaderMockFactory.h"
#include "public/web/WebCache.h"
@@ -101,9 +102,9 @@ class WebDocumentSubresourceFilterTest : public ::testing::Test {
private:
void registerMockedHttpURLLoad(const std::string& fileName) {
- URLTestHelpers::registerMockedURLFromBaseURL(
- WebString::fromUTF8(m_baseURL.c_str()),
- WebString::fromUTF8(fileName.c_str()));
+ URLTestHelpers::registerMockedURLLoadFromBase(
+ WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
+ WebString::fromUTF8(fileName));
}
// ::testing::Test:
@@ -122,7 +123,7 @@ TEST_F(WebDocumentSubresourceFilterTest, AllowedSubresource) {
expectSubresourceWasLoaded(true);
// The filter should not be consulted for the main document resource.
EXPECT_THAT(queriedSubresourcePaths(),
- testing::ElementsAre("/white-1x1.png"));
+ ::testing::ElementsAre("/white-1x1.png"));
}
TEST_F(WebDocumentSubresourceFilterTest, DisallowedSubresource) {
@@ -132,8 +133,8 @@ TEST_F(WebDocumentSubresourceFilterTest, DisallowedSubresource) {
TEST_F(WebDocumentSubresourceFilterTest, FilteringDecisionIsMadeLoadByLoad) {
for (const bool allowSubresources : {false, true}) {
- SCOPED_TRACE(testing::Message() << "First load allows subresources = "
- << allowSubresources);
+ SCOPED_TRACE(::testing::Message() << "First load allows subresources = "
+ << allowSubresources);
loadDocument(allowSubresources);
expectSubresourceWasLoaded(allowSubresources);
@@ -141,7 +142,7 @@ TEST_F(WebDocumentSubresourceFilterTest, FilteringDecisionIsMadeLoadByLoad) {
loadDocument(!allowSubresources);
expectSubresourceWasLoaded(!allowSubresources);
EXPECT_THAT(queriedSubresourcePaths(),
- testing::ElementsAre("/white-1x1.png"));
+ ::testing::ElementsAre("/white-1x1.png"));
WebCache::clear();
}
« no previous file with comments | « third_party/WebKit/Source/web/tests/VisualViewportTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebDocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698