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

Unified Diff: third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp

Issue 2324103002: Cleanup EXPECT/ASSERTs in unit tests in core/fetch and core/loader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
index 4a8fc5e64866e830b3a2e98917f8067dcd08d726..fe58e4cc1f1629abf7aadff115716d8eae05458b 100644
--- a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
+++ b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
@@ -150,24 +150,24 @@ TEST(LinkLoaderTest, Preload)
hrefURL,
dummyPageHolder->document(),
NetworkHintsMock());
- ASSERT(dummyPageHolder->document().fetcher());
+ ASSERT_TRUE(dummyPageHolder->document().fetcher());
HeapListHashSet<Member<Resource>>* preloads = dummyPageHolder->document().fetcher()->preloads();
if (testCase.expectingLoad) {
if (!preloads)
fprintf(stderr, "Unexpected result %s %s %s\n", testCase.href, testCase.as, testCase.type);
- ASSERT_NE(nullptr, preloads);
+ EXPECT_TRUE(preloads);
} else {
- ASSERT_EQ(nullptr, preloads);
+ EXPECT_FALSE(preloads);
}
if (preloads) {
if (testCase.priority == ResourceLoadPriorityUnresolved) {
- ASSERT_EQ((unsigned)0, preloads->size());
+ EXPECT_EQ(0u, preloads->size());
} else {
- ASSERT_EQ((unsigned)1, preloads->size());
+ EXPECT_EQ(1u, preloads->size());
if (preloads->size() > 0) {
Resource* resource = preloads->begin().get()->get();
- ASSERT_EQ(testCase.priority, resource->resourceRequest().priority());
- ASSERT_EQ(testCase.context, resource->resourceRequest().requestContext());
+ EXPECT_EQ(testCase.priority, resource->resourceRequest().priority());
+ EXPECT_EQ(testCase.context, resource->resourceRequest().requestContext());
}
}
dummyPageHolder->document().fetcher()->clearPreloads();
@@ -206,8 +206,8 @@ TEST(LinkLoaderTest, DNSPrefetch)
hrefURL,
dummyPageHolder->document(),
networkHints);
- ASSERT_FALSE(networkHints.didPreconnect());
- ASSERT_EQ(testCase.shouldLoad, networkHints.didDnsPrefetch());
+ EXPECT_FALSE(networkHints.didPreconnect());
+ EXPECT_EQ(testCase.shouldLoad, networkHints.didDnsPrefetch());
}
}
@@ -241,9 +241,9 @@ TEST(LinkLoaderTest, Preconnect)
hrefURL,
dummyPageHolder->document(),
networkHints);
- ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect());
- ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS());
- ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin());
+ EXPECT_EQ(testCase.shouldLoad, networkHints.didPreconnect());
+ EXPECT_EQ(testCase.isHTTPS, networkHints.isHTTPS());
+ EXPECT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698