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

Side by Side Diff: test/inspector/runtime/console-messages-limits.js

Issue 2653293003: [inspector] introduced memory size limit for console message storage (Closed)
Patch Set: addressed comments Created 3 years, 10 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
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 print('Checks that console message storage doesn\'t exceed limits');
6
7 InspectorTest.addScript(`
8 function generateEmptyMessages(n) {
9 for (var i = 0; i < n; ++i) {
10 console.log('');
11 }
12 }
13
14 function generate1MbMessages(n) {
15 for (var i = 0; i < n; ++i) {
16 console.log(new Array(1024 * 1024 - 32).join('!'));
17 }
18 }
19 //# sourceURL=test.js`, 7, 26);
20
21 var messagesReported = 0;
22 Protocol.Runtime.onConsoleAPICalled(message => {
23 ++messagesReported;
24 });
25
26 InspectorTest.runTestSuite([
27 function testMaxConsoleMessagesCount(next) {
28 messagesReported = 0;
29 Protocol.Runtime.evaluate({ expression: 'generateEmptyMessages(1005)'})
30 .then(() => Protocol.Runtime.enable())
31 .then(() => Protocol.Runtime.disable())
32 .then(() => InspectorTest.log(`Messages reported: ${messagesReported}`))
33 .then(next);
34 },
35
36 function testMaxConsoleMessagesV8Size(next) {
37 messagesReported = 0;
38 Protocol.Runtime.evaluate({ expression: 'generate1MbMessages(11)'})
39 .then(() => Protocol.Runtime.enable())
40 .then(() => Protocol.Runtime.disable())
41 .then(() => InspectorTest.log(`Messages reported: ${messagesReported}`))
42 .then(next);
43 }
44 ]);
OLDNEW
« no previous file with comments | « src/inspector/v8-console-message.cc ('k') | test/inspector/runtime/console-messages-limits-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698