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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload.html

Issue 268743003: [XHR] Delete an incorrect ASSERT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload.html b/LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload.html
new file mode 100644
index 0000000000000000000000000000000000000000..8a5cd34a27df1fdd32df73cafb7e56fbdff88eca
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload.html
@@ -0,0 +1,51 @@
+<html>
+<body>
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+(function() {
+description('Make two XHRs for the resource which is already cached.');
+window.jsTestIsAsync = true;
+var url = 'resources/get.txt';
+function get(xhr, async) {
+ return new Promise(function(resolve, reject) {
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === xhr.DONE) {
+ if (xhr.status === 200) {
+ resolve(xhr.responseText);
+ } else {
+ reject(xhr.status);
+ }
+ }
+ };
+ xhr.open('GET', url, async);
+ xhr.send();
+ });
+}
+var xhr1 = new XMLHttpRequest();
+var xhr2 = new XMLHttpRequest();
+
+Promise.resolve().then(function() {
+ var async = get(xhr1, true);
+ var sync = get(xhr2, false);
+ return Promise.all([sync, async]);
+}).then(function(results) {
+ window.result1 = results[0];
+ window.result2 = results[1];
+ shouldBeEqualToString('result1', 'PASS');
+ shouldBeEqualToString('result2', 'PASS');
+ if (localStorage.reload) {
+ testPassed('DONE');
+ finishJSTest();
+ } else {
+ localStorage.reload = true;
+ location.reload(true);
+ }
+}, function(e) {
+ testFailed(e);
+ finishJSTest();
+});
+}());
+
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/duplicate-revalidation-reload-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698