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

Unified Diff: content/browser/blob_storage/blob_storage_browsertest.cc

Issue 2717463004: [BlobStorage] Possible test segfault mitigation (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/blob_storage/blob_storage_browsertest.cc
diff --git a/content/browser/blob_storage/blob_storage_browsertest.cc b/content/browser/blob_storage/blob_storage_browsertest.cc
index 2073443bde44193a321f238dedefdf41fc6cc40d..b51989b417ac344590f258a3033f430e04d22dc6 100644
--- a/content/browser/blob_storage/blob_storage_browsertest.cc
+++ b/content/browser/blob_storage/blob_storage_browsertest.cc
@@ -49,6 +49,8 @@ class BlobStorageBrowserTest : public ContentBrowserTest {
content::ChromeBlobStorageContext* blob_context =
ChromeBlobStorageContext::GetFor(
shell()->web_contents()->GetBrowserContext());
+ if (!blob_context->context())
+ return nullptr;
return blob_context->context()->mutable_memory_controller();
}
@@ -56,6 +58,7 @@ class BlobStorageBrowserTest : public ContentBrowserTest {
// The test page will perform tests on blob storage, then navigate to either
// a #pass or #fail ref.
Shell* the_browser = incognito ? CreateOffTheRecordBrowser() : shell();
+ ASSERT_TRUE(the_browser);
VLOG(0) << "Navigating to URL and blocking. " << test_url.spec();
NavigateToURLBlockUntilNavigationsComplete(the_browser, test_url, 2);
@@ -82,6 +85,7 @@ IN_PROC_BROWSER_TEST_F(BlobStorageBrowserTest, BlobCombinations) {
SetBlobLimits();
SimpleTest(GetTestUrl("blob_storage", "blob_creation_and_slicing.html"));
storage::BlobMemoryController* memory_controller = GetMemoryController();
+ ASSERT_TRUE(memory_controller);
// Our exact usages depend on IPC message ordering & garbage collection.
// Since this is basically random, we just check bounds.
EXPECT_LT(0u, memory_controller->memory_usage());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698