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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/fetch-resource.php

Issue 2370843003: Suborigin LayoutTest formatting and refactoring (Closed)
Patch Set: Created 4 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 <?php 1 <?php
2 if ($_GET["suborigin"]) { 2 if ($_GET["suborigin"]) {
3 header("Suborigin: " . $_GET["suborigin"]); 3 header("Suborigin: " . $_GET["suborigin"]);
4 } 4 }
5 ?> 5 ?>
6 <!DOCTYPE html> 6 <!DOCTYPE html>
7 <html> 7 <html>
8 <script> 8 <script>
9 var id = '<?php echo($_GET["id"]); ?>'; 9 var id = '<?php echo($_GET["id"]); ?>';
10 var resource_url = '<?php echo($_GET["resource"]); ?>' 10 var resource_url = '<?php echo($_GET["resource"]); ?>'
11 11
12 var is_mem_cached = window.internals.isLoadingFromMemoryCache(resource_url); 12 var is_mem_cached = window.internals.isLoadingFromMemoryCache(resource_url);
13 13
14 fetch(resource_url, {mode: 'no-cors'}) 14 fetch(resource_url, {mode: 'no-cors'})
15 .then(function(response) { 15 .then(function(response) {
16 window.parent.postMessage({'type': 'response', 'is_mem_cached': is_mem_cache d, 'id': id}, '*'); 16 window.parent.postMessage({
17 }) 17 'type': 'response',
18 .catch(function(e) { 18 'is_mem_cached': is_mem_cached,
19 window.parent.postMessage({'type': 'error', 'is_mem_cached': is_mem_cached, 'id': id}, '*') 19 'id': id
20 }); 20 }, '*');
21 })
22 .catch(function(e) {
23 window.parent.postMessage({
24 'type': 'error',
25 'is_mem_cached': is_mem_cached,
26 'id': id
27 }, '*');
28 });
21 </script> 29 </script>
22 </html> 30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698