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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html

Issue 2373503003: Add clean up logic to navigator.credentials layout tests (Closed)
Patch Set: 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
Index: third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html
index 043ae352d61d0798d050486f24e0cb4ca0edb209..347fc413fa6d90d72063b970e1a654354afa5276 100644
--- a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html
+++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-get-errors.html
@@ -3,29 +3,26 @@
<script src="../resources/testharnessreport.js"></script>
<script src="/serviceworker/resources/interfaces.js"></script>
<script>
-function stubResolverUndefinedChecker(c) {
- assert_equals(c, undefined);
- this.done();
-}
-
-function stubRejectionChecker(reason) {
- assert_unreached("get() should not reject, but did: " + reason.name);
-}
+add_completion_callback(() => {
+ if (window.testRunner) {
+ // Clear the error value by passing an empty string.
+ testRunner.setMockCredentialManagerError("");
+ }
+});
promise_test(function (t) {
if (window.testRunner)
- testRunner.addMockCredentialManagerError("pending");
+ testRunner.setMockCredentialManagerError("pending");
return promise_rejects(t, "InvalidStateError", navigator.credentials.get({ password: true }));
});
promise_test(function (t) {
if (window.testRunner)
- testRunner.addMockCredentialManagerError("disabled");
+ testRunner.setMockCredentialManagerError("disabled");
return promise_rejects(t, "InvalidStateError", navigator.credentials.get({ password: true }));
});
promise_test(function (t) {
if (window.testRunner)
- testRunner.addMockCredentialManagerError("unknown");
+ testRunner.setMockCredentialManagerError("unknown");
return promise_rejects(t, "NotReadableError", navigator.credentials.get({ password: true }));
});
</script>
-

Powered by Google App Engine
This is Rietveld 408576698