Skip to content

Commit 7b480fe

Browse files
committed
fail prefetch at network level
1 parent 2b1741a commit 7b480fe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

infrastructure/testdriver/bidi/speculation/prefetch_status_updated.https.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@
116116

117117
promise_test(async t => {
118118
const receivedEvents = new Set();
119-
const expectedStatuses = new Set(['pending', 'failure']);
119+
const expectedStatuses = new Set(['failure']);
120120

121-
const errorUrl = window.location.origin + "/infrastructure/testdriver/bidi/speculation/resources/nonexistent-404-page.html";
121+
// Set error url to fail at network layer and only expect failure event
122+
const errorUrl = "http://0.0.0.0:1/test.html";
122123

123124
// Create a promise that resolves when we receive the 'failure' event
124125
const failureEventPromise = new Promise((resolve, reject) => {
@@ -151,9 +152,9 @@
151152
assert_true(
152153
receivedStatuses.size === expectedStatuses.size &&
153154
[...expectedStatuses].every(status => receivedStatuses.has(status)),
154-
'Should have received pending and failure events'
155+
'Should have received only failure event'
155156
);
156157

157-
}, "prefetch_status_updated event with prefetch failure", { timeout: 30000 });
158+
}, "prefetch_status_updated event with prefetch failure");
158159

159160
</script>

0 commit comments

Comments
 (0)