Skip to content

Commit

Permalink
Catch unexpected exceptions in sync-xhr test.
Browse files Browse the repository at this point in the history
With this change, only the expected NetworkError from send() will be
propagated to the feature policy test framework. Other errors (including
NetworkErrors from other calls) will be prefixed with
"UnexpectedException:" and will cause the tests to fail.

Bug: 661283
Change-Id: I75e2fa6526211cc87c65f5f03e926903ae1ba22e
Reviewed-on: https://chromium-review.googlesource.com/874270
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530527}
  • Loading branch information
clelland authored and chromium-wpt-export-bot committed Jan 23, 2018
1 parent a19b359 commit 8f6cb93
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xhr/xmlhttprequest-sync-default-feature-policy.sub.html
Expand Up @@ -17,11 +17,15 @@
try {
var xhr = new XMLHttpRequest();
xhr.open("GET", "data:,", false);
xhr.send();
resolve();
try {
xhr.send();
} catch(e) {
reject(e);
}
} catch(e) {
reject(e);
reject({"name": "UnexpectedException:" + e.name});
}
resolve();
});
});
</script>
Expand Down

0 comments on commit 8f6cb93

Please sign in to comment.