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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html

Issue 2892803002: Fix layout tests to prevent errors from layout-test-tidy (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html b/third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html
index 4ddfd3f2b9a66e647549871b1271aa6fe093b936..a63d7ca1584b5e8b01597628460f27f7d52f3e93 100644
--- a/third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html
+++ b/third_party/WebKit/LayoutTests/webaudio/internals/scriptprocessornode-premature-death.html
@@ -3,34 +3,34 @@
<body>
<script>
description('Tests that a script processor node is not prematurely GCed');
-var jsTestIsAsync = true;
+window.jsTestIsAsync = true;
Raymond Toy 2017/05/19 13:53:38 This and line 86 are the things that really needed
hongchan 2017/05/19 16:15:29 Yes.
if (!window.internals) {
testFailed('This test requires window.internals.');
finishJSTest();
}
-var wasCalled, wasCollectedPrematurely, savedNode, savedCallback;
+let wasCalled, wasCollectedPrematurely, savedNode, savedCallback;
function test(saveReference, nextStep) {
debug('Testing ' + (saveReference ? 'with' : 'without') + ' explicitly ' +
'keeping a reference to the script processor node alive.');
// Create an audio context
- var context = new OfflineAudioContext(
+ let context = new OfflineAudioContext(
2, // channels
4096, // length (frames)
44100.0); // sample rate
// Set up a source, reading from an empty buffer
- var source = context.createBufferSource();
+ let source = context.createBufferSource();
source.buffer = context.createBuffer(
2, // source channels
4096, // length (frames)
44100.0); // sample rate
// Set up a script processor node to generate something
- var node = context.createScriptProcessor(
+ let node = context.createScriptProcessor(
512, // buffer size
0, // input channels
2); // output channels
@@ -43,7 +43,7 @@ function test(saveReference, nextStep) {
// generate anything
wasCalled = false;
- var callback = function () { wasCalled = true; };
+ let callback = function () { wasCalled = true; };
node.onaudioprocess = callback;
if (saveReference) {
@@ -53,7 +53,7 @@ function test(saveReference, nextStep) {
// Watch the callback; if it dies, we're obviously not generating anything
- var observation = internals.observeGC(callback);
+ let observation = internals.observeGC(callback);
node = callback = null;
gc();
wasCollectedPrematurely = observation.wasCollected;
@@ -83,5 +83,5 @@ function step2() {
step1();
-var successfullyParsed = true;
+window.successfullyParsed = true;
</script>

Powered by Google App Engine
This is Rietveld 408576698