Skip to content

Commit

Permalink
Fix lint issues from Mozilla upstreaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Apr 8, 2016
1 parent 712dd11 commit 7338006
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 61 deletions.
3 changes: 3 additions & 0 deletions lint.whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ W3C-TEST.ORG:subresource-integrity/refresh-header.js.headers

# semi-legitimate use of console.*
CONSOLE:streams/resources/test-utils.js
CONSOLE:service-workers/service-worker/resources/navigation-redirect-other-origin.html
CONSOLE:service-workers/service-worker/navigation-redirect.https.html
CONSOLE:service-workers/service-worker/resources/clients-get-other-origin.html

# Lint doesn't know about sub.svg I guess
PARSE-FAILED:content-security-policy/svg/including.sub.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var frame = document.createElement('iframe');
frames.push(frame);
frame.src = INSTALL_APPCACHE_URL;
document.body.appendChild(frame);
document.body.appendChild(frame);
resolve_install_appcache = function() {
document.body.removeChild(frame);
resolve();
Expand Down Expand Up @@ -73,10 +73,10 @@
return service_worker_unregister_and_register(
t, SERVICE_WORKER_SCRIPT, SERVICE_WORKER_SCOPE);
})
.then(function(r) {
.then(function(r) {
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
.then(function() {
return is_appcached();
})
.then(function(result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
worker = registration.installing;
worker = registration.installing;
return wait_for_state(t, worker, 'activated');
})
.then(function() {
Expand Down
2 changes: 1 addition & 1 deletion service-workers/service-worker/indexeddb.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]);
})
.catch(unreached_rejection(t));

function onMessage() {
var openRequest = indexedDB.open('db');
openRequest.onsuccess = t.step_func(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
'&mode=no-cors&url=' + encodeURIComponent(remote_image_url),
'use-credentials',
LOAD_ERROR),

// CORS response
create_test_promise(
image_url +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import time
def main(request, response):
print dir(response)
response.headers.set("Content-Type", "application/javascript")
response.headers.set("Transfer-encoding", "chunked")
response.write_status_headers()
Expand Down
40 changes: 20 additions & 20 deletions service-workers/service-worker/resources/load_worker.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
self.onmessage = function (evt) {
if (evt.data == "xhr") {
var xhr = new XMLHttpRequest();
xhr.open("GET", "synthesized-response.txt", true);
xhr.responseType = "text";
xhr.send();
xhr.onload = function (evt) {
postMessage(xhr.responseText);
};
xhr.onerror = function() {
postMessage("XHR failed!");
};
var xhr = new XMLHttpRequest();
xhr.open("GET", "synthesized-response.txt", true);
xhr.responseType = "text";
xhr.send();
xhr.onload = function (evt) {
postMessage(xhr.responseText);
};
xhr.onerror = function() {
postMessage("XHR failed!");
};
} else if (evt.data == "fetch") {
fetch("synthesized-response.txt")
.then(function(response) {
return response.text();
fetch("synthesized-response.txt")
.then(function(response) {
return response.text();
})
.then(function(data) {
postMessage(data);
.then(function(data) {
postMessage(data);
})
.catch(function(error) {
postMessage("Fetch failed!");
});
.catch(function(error) {
postMessage("Fetch failed!");
});
} else if (evt.data == "importScripts") {
importScripts("synthesized-response.js");
importScripts("synthesized-response.js");
} else {
throw "Unexpected message! " + evt.data;
throw "Unexpected message! " + evt.data;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ var response_script = "postMessage(\"This load was successfully intercepted.\");
self.onfetch = function(event) {
var url = event.request.url;
if (url.indexOf("synthesized-response.txt") != -1) {
event.respondWith(new Response(response_text));
event.respondWith(new Response(response_text));
} else if (url.indexOf("synthesized-response.js") != -1) {
event.respondWith(new Response(response_script));
event.respondWith(new Response(response_script));
}
};

56 changes: 28 additions & 28 deletions web-animations/animation-effect-timing/direction.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>direction tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-direction">
<link rel="author" title="Ryo Kato" href="mailto:foobar094@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
<body>
<div id="log"></div>
<script>
'use strict';

test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);

var directions = ['normal', 'reverse', 'alternate', 'alternate-reverse'];
directions.forEach(function(direction) {
anim.effect.timing.direction = direction;
assert_equals(anim.effect.timing.direction, direction,
'set direction to ' + direction);
});
}, 'set direction to a valid keyword');

</script>
</body>
<!DOCTYPE html>
<meta charset=utf-8>
<title>direction tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-direction">
<link rel="author" title="Ryo Kato" href="mailto:foobar094@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
<body>
<div id="log"></div>
<script>
'use strict';

test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);

var directions = ['normal', 'reverse', 'alternate', 'alternate-reverse'];
directions.forEach(function(direction) {
anim.effect.timing.direction = direction;
assert_equals(anim.effect.timing.direction, direction,
'set direction to ' + direction);
});
}, 'set direction to a valid keyword');

</script>
</body>
4 changes: 2 additions & 2 deletions web-animations/animation/cancel.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is not animated after cancelling');

animation.currentTime = 50 * MS_PER_SEC;
assert_equals(getComputedStyle(div).marginLeft, '50px',
'margin-left style is updated when cancelled animation is'
+ ' seeked');
}, 'After cancelling an animation, it can still be seeked');

promise_test(function(t) {
var div = createDiv(t);
var animation = div.animate({marginLeft:['100px', '200px']},
Expand Down
2 changes: 1 addition & 1 deletion web-animations/animation/playState.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
promise_test(function(t) {
var div = createDiv(t);
var animation = div.animate({}, 100 * MS_PER_SEC);

assert_equals(animation.playState, 'pending');
return animation.ready.then(function() {
assert_equals(animation.playState, 'running');
Expand Down

0 comments on commit 7338006

Please sign in to comment.