Fenced frames: Add limit to number of urn mappings for shared storage
use cases.

When number of urn mappings reaches limit, calls to selectURL() will
fail and report an error. SharedStorageWorkletHost::RunURLSelectionOperationOnWorklet
will return early and no url selection will be run.

Bug: 1351838
Change-Id: I6a499445193b0275357e88e3a71bd9900f1f4a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3879905
Reviewed-by: Shivani Sharma <[email protected]>
Commit-Queue: Xiaochen Zhou <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Garrett Tanzer <[email protected]>
Reviewed-by: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1051830}
diff --git a/content/browser/renderer_host/navigation_request_unittest.cc b/content/browser/renderer_host/navigation_request_unittest.cc
index 862b7a96..72cd15b 100644
--- a/content/browser/renderer_host/navigation_request_unittest.cc
+++ b/content/browser/renderer_host/navigation_request_unittest.cc
@@ -356,7 +356,9 @@
   FencedFrameURLMapping& fenced_frame_urls_map =
       main_test_rfh()->GetPage().fenced_frame_urls_map();
 
-  const GURL urn_uuid = fenced_frame_urls_map.GeneratePendingMappedURN();
+  auto pending_urn_uuid = fenced_frame_urls_map.GeneratePendingMappedURN();
+  EXPECT_TRUE(pending_urn_uuid.has_value());
+  GURL urn_uuid = pending_urn_uuid.value();
   const GURL mapped_url = GURL("https://chromium.org");
 
   auto navigation_simulator = NavigationSimulatorImpl::CreateRendererInitiated(