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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console/command-line-api.js

Issue 2976833002: Script migration (Closed)
Patch Set: transformed Created 3 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698