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

Side by Side Diff: LayoutTests/storage/quota/storagequota-query-info.html

Issue 669353002: Fix broken Promise-related layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@return-rejected
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 <script type="text/javascript"> 6 <script type="text/javascript">
7 description("This tests navigator.storageQuota.queryInfo."); 7 description("This tests navigator.storageQuota.queryInfo.");
8 8
9 var usage; 9 var usage;
10 var quota; 10 var quota;
(...skipping 28 matching lines...) Expand all
39 // Quota value would vary depending on the test environment. 39 // Quota value would vary depending on the test environment.
40 shouldBeGreaterThanOrEqual("usage", "0"); 40 shouldBeGreaterThanOrEqual("usage", "0");
41 shouldBeGreaterThanOrEqual("quota", "usage"); 41 shouldBeGreaterThanOrEqual("quota", "usage");
42 42
43 runNextTest(); 43 runNextTest();
44 }, onrejected); 44 }, onrejected);
45 } 45 }
46 46
47 function runQueryUnknownTest() { 47 function runQueryUnknownTest() {
48 debug("* Querying about unknown storage."); 48 debug("* Querying about unknown storage.");
49 shouldThrow("navigator.storageQuota.queryInfo('unknown')"); 49 navigator.storageQuota.queryInfo('unknown').then(function() {
50 runNextTest(); 50 testFailed('resolved unexpectedly');
51 }, function(e) {
52 testPassed('rejected as expected: ' + e);
53 }).then(runNextTest);
51 } 54 }
52 55
53 function runQueryWithMissingArgumentTest() { 56 function runQueryWithMissingArgumentTest() {
54 debug("* Querying with missing storage type."); 57 debug("* Querying with missing storage type.");
55 shouldThrow("navigator.storageQuota.queryInfo()"); 58 navigator.storageQuota.queryInfo().then(function() {
56 runNextTest(); 59 testFailed('resolved unexpectedly');
60 }, function(e) {
61 testPassed('rejected as expected: ' + e);
62 }).then(runNextTest);
57 } 63 }
58 64
59 // End of test body functions --------------------------------------------- 65 // End of test body functions ---------------------------------------------
60 66
61 var testsList = [ 67 var testsList = [
62 runQueryTemporaryTest, 68 runQueryTemporaryTest,
63 runQueryPersistentTest, 69 runQueryPersistentTest,
64 runQueryUnknownTest, 70 runQueryUnknownTest,
65 runQueryWithMissingArgumentTest, 71 runQueryWithMissingArgumentTest,
66 ]; 72 ];
(...skipping 10 matching lines...) Expand all
77 83
78 if (navigator.storageQuota) { 84 if (navigator.storageQuota) {
79 window.jsTestIsAsync = true; 85 window.jsTestIsAsync = true;
80 runNextTest(); 86 runNextTest();
81 } else { 87 } else {
82 debug("This test requires navigator.storageQuota."); 88 debug("This test requires navigator.storageQuota.");
83 } 89 }
84 </script> 90 </script>
85 </body> 91 </body>
86 </html> 92 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698