Backout rev 56b28c7bc989 (bug 1415740 p2) for failing WPT manifest linting. r=me

--HG--
rename : testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html => testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-iframe.html
This commit is contained in:
Ben Kelly 2017-11-10 00:28:59 -08:00
Родитель 01a1a65f66
Коммит 6c269afe1a
2 изменённых файлов: 8 добавлений и 32 удалений

Просмотреть файл

@ -8,25 +8,13 @@ function resourceUrl(path) {
return get_host_info()['HTTPS_ORIGIN'] + base_path() + path;
}
function crossOriginUrl(path) {
return get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() + path;
}
function verify(performance, resource, mode, description) {
var url = mode === 'cross-origin' ? crossOriginUrl(resource)
: resourceUrl(resource);
var entryList = performance.getEntries();
var entry = performance.getEntriesByName(url)[0];
function verify(performance, resource, description) {
var entry = performance.getEntriesByName(resourceUrl(resource))[0];
assert_greater_than(entry.workerStart, 0, description);
assert_greater_than_equal(entry.workerStart, entry.startTime, description);
assert_less_than_equal(entry.workerStart, entry.fetchStart, description);
if (mode === 'cross-origin') {
assert_equals(entry.responseStart, 0, description);
assert_greater_than_equal(entry.responseEnd, entry.fetchStart, description);
} else {
assert_greater_than_equal(entry.responseStart, entry.fetchStart, description);
assert_greater_than_equal(entry.responseEnd, entry.responseStart, description);
}
assert_greater_than_equal(entry.responseStart, entry.fetchStart, description);
assert_greater_than_equal(entry.responseEnd, entry.responseStart, description);
assert_greater_than(entry.responseEnd, entry.fetchStart, description);
assert_greater_than(entry.duration, 0, description);
if (resource.indexOf('redirect.py') != -1) {
@ -39,7 +27,7 @@ function verify(performance, resource, mode, description) {
async_test(function(t) {
var worker_url = 'resources/resource-timing-worker.js';
var scope = 'resources/resource-timing-iframe.sub.html';
var scope = 'resources/resource-timing-iframe.html';
var registration;
service_worker_unregister_and_register(t, worker_url, scope)
@ -52,20 +40,10 @@ async_test(function(t) {
})
.then(function(frame) {
var performance = frame.contentWindow.performance;
verify(performance, 'resources/dummy.js', 'same-origin',
'Generated response');
verify(performance, 'resources/empty.js', 'same-origin',
'Network fallback');
verify(performance, 'resources/dummy.js', 'Generated response');
verify(performance, 'resources/empty.js', 'Network fallback');
verify(performance, 'resources/redirect.py?Redirect=empty.js',
'same-origin', 'Redirect');
verify(performance, 'resources/missing.jpg', 'same-origin',
'Network fallback image');
// Test that worker start is available on cross-origin no-cors
// subresources.
verify(performance, 'resources/missing.jpg', 'cross-origin',
'Network fallback cross-origin image');
'Redirect');
frame.remove();
return registration.unregister();
})

Просмотреть файл

@ -2,5 +2,3 @@
<script src="empty.js"></script>
<script src="dummy.js"></script>
<script src="redirect.py?Redirect=empty.js"></script>
<img src="missing.jpg">
<img src="https://{{domains[www1]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.jpg">