| Index: third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js b/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js
|
| index d1ce0590860fa8e191093fe38b281cc9140f6925..8b30144db119963d58723445dd0c037b7c15b1ed 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js
|
| @@ -4,51 +4,53 @@
|
|
|
| (async function() {
|
| TestRunner.addResult('Tests that command line api works.\n');
|
| -
|
| - await TestRunner.loadModule("console_test_runner");
|
| - await TestRunner.loadModule("elements_test_runner");
|
| - await TestRunner.loadPanel("console");
|
| -
|
| - var expressions = [
|
| - "String($0)",
|
| - "$3",
|
| - "String(keys([3,4]))",
|
| - "String(values([3,4]))",
|
| - "String($('#foo'))",
|
| - "String($('#foo', document.body))",
|
| - "String($('#foo', 'non-node'))",
|
| - "String($('#foo', $('#bar')))",
|
| - "String($$('p'))",
|
| - "String($$('p', document.body))",
|
| - "String($('foo'))",
|
| - "console.assert(keys(window).indexOf('__commandLineAPI') === -1)"
|
| - ];
|
| +
|
| + await TestRunner.loadModule('console_test_runner');
|
| + await TestRunner.loadModule('elements_test_runner');
|
| + await TestRunner.loadPanel('console');
|
|
|
| await TestRunner.loadHTML(`
|
| <p id="foo">
|
| - Tests that command line api works.
|
| </p><p id="bar"></p>
|
| `);
|
|
|
| - ElementsTestRunner.selectNodeWithId("foo", step1);
|
| + function assertNoBoundCommandLineAPI() {
|
| + ['__commandLineAPI', '__scopeChainForEval'].forEach(function(name) {
|
| + console.assert(!(name in window), 'FAIL: Should be no ' + name);
|
| + });
|
| + }
|
| +
|
| + var expressions = [
|
| + 'String($0)',
|
| + '$3',
|
| + 'String(keys([3,4]))',
|
| + 'String(values([3,4]))',
|
| + 'String($(\'#foo\'))',
|
| + 'String($(\'#foo\', document.body))',
|
| + 'String($(\'#foo\', \'non-node\'))',
|
| + 'String($(\'#foo\', $(\'#bar\')))',
|
| + 'String($$(\'p\'))',
|
| + 'String($$(\'p\', document.body))',
|
| + 'String($(\'foo\'))',
|
| + 'console.assert(keys(window).indexOf(\'__commandLineAPI\') === -1)'
|
| + ];
|
| +
|
| + ElementsTestRunner.selectNodeWithId('foo', step1);
|
|
|
| function step1(node) {
|
| var expression = expressions.shift();
|
| +
|
| if (!expression) {
|
| step2();
|
| return;
|
| }
|
| - Common.console.log("");
|
| +
|
| + Common.console.log('');
|
| ConsoleTestRunner.evaluateInConsole(expression, step1);
|
| }
|
|
|
| function step2() {
|
| - function assertNoBoundCommandLineAPI() {
|
| - ["__commandLineAPI", "__scopeChainForEval"].forEach(function(name) {
|
| - console.assert(!(name in window), "FAIL: Should be no " + name);
|
| - });
|
| - }
|
| - TestRunner.evaluateInPage(assertNoBoundCommandLineAPI, step3);
|
| + TestRunner.evaluateInPage('assertNoBoundCommandLineAPI()', step3);
|
| }
|
|
|
| function step3() {
|
|
|