| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file.v8 | 3 // found in the LICENSE file.v8 |
| 4 | 4 |
| 5 InspectorTest.log('Checks that Runtime agent correctly restore its state.'); | 5 InspectorTest.log('Checks that Runtime agent correctly restore its state.'); |
| 6 | 6 |
| 7 InspectorTest.addScript(` | 7 InspectorTest.addScript(` |
| 8 var formatter = { | 8 var formatter = { |
| 9 header: function(x) | 9 header: function(x) |
| 10 { | 10 { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 .then(() => Protocol.Runtime.evaluate({ expression: 'console.log(42);' })) | 49 .then(() => Protocol.Runtime.evaluate({ expression: 'console.log(42);' })) |
| 50 .then(Protocol.Runtime.disable) | 50 .then(Protocol.Runtime.disable) |
| 51 .then(() => { | 51 .then(() => { |
| 52 Protocol.Runtime.onConsoleAPICalled(null); | 52 Protocol.Runtime.onConsoleAPICalled(null); |
| 53 next(); | 53 next(); |
| 54 }); | 54 }); |
| 55 }, | 55 }, |
| 56 | 56 |
| 57 function testSetCustomObjectFormatterEnabled(next) { | 57 function testSetCustomObjectFormatterEnabled(next) { |
| 58 Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage); | 58 Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage); |
| 59 // cleanup console message storage | 59 Protocol.Runtime.discardConsoleEntries() |
| 60 reconnect(); | 60 .then(reconnect) |
| 61 Protocol.Runtime.enable() | 61 .then(() => Protocol.Runtime.enable()) |
| 62 .then(() => Protocol.Runtime.setCustomObjectFormatterEnabled({ enabled: tr
ue })) | 62 .then(() => Protocol.Runtime.setCustomObjectFormatterEnabled({ enabled: tr
ue })) |
| 63 .then(reconnect) | 63 .then(reconnect) |
| 64 .then(() => Protocol.Runtime.evaluate({ expression: 'console.log({ name: 4
2 })'})) | 64 .then(() => Protocol.Runtime.evaluate({ expression: 'console.log({ name: 4
2 })'})) |
| 65 .then(InspectorTest.logMessage) | 65 .then(InspectorTest.logMessage) |
| 66 .then(Protocol.Runtime.disable) | 66 .then(Protocol.Runtime.disable) |
| 67 .then(() => { | 67 .then(() => { |
| 68 Protocol.Runtime.onConsoleAPICalled(null); | 68 Protocol.Runtime.onConsoleAPICalled(null); |
| 69 next(); | 69 next(); |
| 70 }); | 70 }); |
| 71 }, | 71 }, |
| 72 ]); | 72 ]); |
| 73 | 73 |
| 74 function reconnect() { | 74 function reconnect() { |
| 75 InspectorTest.logMessage('will reconnect..'); | 75 InspectorTest.logMessage('will reconnect..'); |
| 76 utils.reconnect(); | 76 InspectorTest.session.reconnect(); |
| 77 } | 77 } |
| OLD | NEW |