diff options
Diffstat (limited to 'third_party/WebKit/LayoutTests/inspector-protocol')
4 files changed, 0 insertions, 202 deletions
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-expected.txt deleted file mode 100644 index 44a3b44..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -PASS: received size for type Audio is more than 15000000 - diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test-expected.txt deleted file mode 100644 index 7af9721..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test-expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -This test is checking that AudioContext is deleting after navigation. It is not possible to count AudioContext objects directly. But we could use Native Memory Snapshot which has information about Page.Audio.SharedData. All the shared data are retained by HRTFDatabaseLoader refcounted singleton and Native Memory Instrumentation is visiting it via public getter. - -Action: Wait for Audio data -PASS: Memory size for Page.Audio more than 15000000 -Action: Navigate IFrame to resources/blank.html -PASS: IFrame was navigated to resources/blank.html -Action: Run GC and check Page.Audio data size -PASS: No Page.Audio data found - diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test.html b/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test.html deleted file mode 100644 index b3fc218..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio-leak-test.html +++ /dev/null @@ -1,105 +0,0 @@ -<html> -<head> -<script src="../http/tests/inspector-protocol/resources/protocol-test.js"></script> -<script> - -function runTestOnlyOnce() -{ - if (window.testFirstRun) - return; - window.testFirstRun = 1; - - runTest(); -} - -function navigateIFrame() -{ - var iframe = document.getElementById("iframe"); - iframe.src = "resources/blank.html"; -} - -function test() -{ - function sizeForType(entry, typeNames) - { - for (var index = 0; index < typeNames.length; ++index) { - var typeName = typeNames[index]; - var found = 0; - for (var i = 0; i < entry.children.length; ++i) { - var childEntry = entry.children[i]; - if (childEntry.name === typeName) { - if (index === typeNames.length - 1) - return childEntry.size; - - if (!childEntry.children) - return -1; - - entry = childEntry; - found = 1; - break; - } - } - if (!found) - return -1; - } - - return -1; - } - - var pivotSize = 15000000; - - function noAudioSharedData(messageObject) - { - var size = sizeForType(messageObject["result"]["distribution"], ["Audio"]); - if (size === -1) - InspectorTest.log("PASS: No Page.Audio data found"); - else - InspectorTest.log("FAIL: " + size + " bytes of Page.Audio data was found"); - InspectorTest.completeTest(); - } - - function iFrameNavigated(messageObject) { - InspectorTest.log("PASS: IFrame was navigated to resources/blank.html"); - InspectorTest.sendCommand('HeapProfiler.collectGarbage', {}, function() { } ); - InspectorTest.log("Action: Run GC and check Page.Audio data size"); - InspectorTest.sendCommand('Memory.getProcessMemoryDistribution', {}, noAudioSharedData); - } - - function waitForSharedAudioData(messageObject) { - var size = sizeForType(messageObject["result"]["distribution"], ["Audio"]); - if (size === -1) { - InspectorTest.log("FAIL: No Page.Audio data was found."); - InspectorTest.completeTest(); - return; - } - if (size < pivotSize) - InspectorTest.sendCommand('Memory.getProcessMemoryDistribution', {}, waitForSharedAudioData); - else { - InspectorTest.log("PASS: Memory size for Page.Audio more than " + pivotSize); - - InspectorTest.sendCommand('Page.enable', {}, function() { } ); - - InspectorTest.log("Action: Navigate IFrame to resources/blank.html"); - InspectorTest.eventHandler["Page.frameNavigated"] = iFrameNavigated; - InspectorTest.sendCommand('Runtime.evaluate', {expression: 'navigateIFrame()'}, function() { } ); - } - } - - InspectorTest.log(""); - InspectorTest.log("Action: Wait for Audio data"); - InspectorTest.sendCommand('Memory.getProcessMemoryDistribution', {}, waitForSharedAudioData); -} -</script> -</head> -<body onload="testRunner.waitUntilDone()"> -This test is checking that AudioContext is deleting after navigation. -It is not possible to count AudioContext objects directly. -But we could use Native Memory Snapshot which has information about Page.Audio.SharedData. -All the shared data are retained by HRTFDatabaseLoader refcounted singleton -and Native Memory Instrumentation is visiting it via public getter. - -<iframe id="iframe" onLoad="runTestOnlyOnce()" src="resources/audio-context.html" > -</iframe> - -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio.html b/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio.html deleted file mode 100644 index 43ddac9..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/nmi-webaudio.html +++ /dev/null @@ -1,86 +0,0 @@ -<html> -<head> -<script type="text/javascript" src="../http/tests/inspector-protocol/resources/protocol-test.js"></script> -<script> - -var sampleRate = 44100.0; -var renderLengthSeconds = 0.125; - -function createSinWaveBuffer(context, lengthInSeconds, frequency) -{ - var audioBuffer = context.createBuffer(1, lengthInSeconds * sampleRate, sampleRate); - var data = audioBuffer.getChannelData(0); - for (var i = 0; i < audioBuffer.length; ++i) - data[i] = Math.sin(frequency * 2 * Math.PI * i / sampleRate); - return audioBuffer; -} - -function runPageTest() -{ - testRunner.waitUntilDone(); - - // Create offline audio context. - var context = new webkitOfflineAudioContext(1, sampleRate * renderLengthSeconds, sampleRate); - - var bufferSource = context.createBufferSource(); - bufferSource.buffer = createSinWaveBuffer(context, renderLengthSeconds, 880); - bufferSource.connect(context.destination); - context.oncomplete = runTest; - context.startRendering(); -} - -function test() -{ - function sizeForType(entry, typeNames) - { - for (var index = 0; index < typeNames.length; ++index) { - var typeName = typeNames[index]; - var found = 0; - for (var i = 0; i < entry.children.length; ++i) { - var childEntry = entry.children[i]; - if (childEntry.name === typeName) { - if (index === typeNames.length - 1) - return childEntry.size; - - if (!childEntry.children) - return -1; - - entry = childEntry; - found = 1; - break; - } - } - if (!found) - return -1; - } - - return -1; - } - - function receivedSizeMoreThan(messageObject, typeNames, expectedSize) - { - var entry = messageObject["result"]["distribution"]; - var size = sizeForType(entry, typeNames); - if (size > expectedSize) - InspectorTest.log("PASS: received size for type " + typeNames.join('.') + " is more than " + expectedSize); - else - InspectorTest.log("FAIL: received size " + size + " for type " + typeNames.join('.') + " is less than " + expectedSize); - } - - function handleMemorySnapshot(messageObject) - { - if ("error" in messageObject) - InspectorTest.log(messageObject.error.message); - else - receivedSizeMoreThan(messageObject, ["Audio"], 15000000); - - InspectorTest.completeTest(); - } - - InspectorTest.sendCommand("Memory.getProcessMemoryDistribution", {}, handleMemorySnapshot); -} -</script> -</head> -<body onLoad="runPageTest();"> -</body> -</html> |