Fix clang-format configuration

The configuration was only including files that were in a commit diff.
This causes issues where we generate sources during the PRESUBMIT (which
are not in the git diff at that point in time) and don't format.

At the same time, we remove the complicated logic to reuse the
`.eslintignore` for clang-format purposes and use the correct
`.clang-format` "DisableFormat" options to disable formatting in various
directories.

Roll CodeMirror: ignore

Change-Id: I21b95a6e09c5d6bf036bf1aace103d6c26823ecc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091445
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
This commit is contained in:
Tim van der Lippe
2020-03-06 12:06:33 +00:00
committed by Commit Bot
parent cae7b53aee
commit d8c23debbe
49 changed files with 164 additions and 179 deletions
-3
View File
@@ -14,8 +14,5 @@ front_end/protocol_externs.js
front_end/javascript_metadata/NativeFunctions.js
front_end/sdk/wasm_source_map/pkg/wasm_source_map.js
front_end/third_party/
test/e2e/resources/
test/webtests/
scripts/
test/e2e/**/*.js
test/shared/**/*.js
+1 -23
View File
@@ -116,29 +116,7 @@ def _CheckFormat(input_api, output_api):
def popen(args):
return input_api.subprocess.Popen(args=args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
affected_files = _getAffectedJSFiles(input_api)
if len(affected_files) == 0:
return results
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), 'scripts')]
import devtools_paths
finally:
sys.path = original_sys_path
ignore_files = []
eslint_ignore_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '.eslintignore')
with open(eslint_ignore_path, 'r') as ignore_manifest:
for line in ignore_manifest:
if '*' not in line.strip():
ignore_files.append(input_api.os_path.normpath(line.strip()))
formattable_files = [
affected_file for affected_file in affected_files if all(ignore_file not in affected_file for ignore_file in ignore_files)
]
if len(formattable_files) == 0:
return results
format_args = ['git', 'cl', 'format', '--js'] + formattable_files
format_args = ['git', 'cl', 'format', '--js']
format_process = popen(format_args)
format_out, _ = format_process.communicate()
if format_process.returncode != 0:
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
@@ -0,0 +1 @@
DisableFormat: true
@@ -0,0 +1 @@
DisableFormat: true
+1
View File
@@ -0,0 +1 @@
DisableFormat: true
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests accessibility in the Clear Storage view using the axe-core linter.`);
TestRunner.addResult('Tests accessibility in the Clear Storage view using the axe-core linter.');
await TestRunner.loadModule('application_test_runner');
await TestRunner.loadModule('axe_core_test_runner');
await ApplicationTestRunner.resetState();
@@ -3,7 +3,7 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests accessibility of ServiceWorkersView on application panel.`);
TestRunner.addResult('Tests accessibility of ServiceWorkersView on application panel.');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('application_test_runner');
await ApplicationTestRunner.resetState();
@@ -22,4 +22,4 @@
await AxeCoreTestRunner.runValidation(element);
TestRunner.completeTest();
})();
})();
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
await TestRunner.loadModule('axe_core_test_runner');
const locationsToTest =
[
@@ -14,13 +14,14 @@
'sensors',
];
//TODO(crbug.com/1004940): exclude scrollable-region-focusable for performance.monitor only
// TODO(crbug.com/1004940): exclude scrollable-region-focusable for performance.monitor only
const NO_SCROLLABLE_REGION_FOCUSABLE_RULESET = {
'scrollable-region-focusable': { enabled: false, },
};
for (const location of locationsToTest)
for (const location of locationsToTest) {
await loadViewAndTestElementViolations(location);
}
TestRunner.completeTest();
@@ -2,62 +2,62 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
// but it is reasonable to have trees with no leaves.
const NO_REQUIRED_CHILDREN_RULESET = {
'aria-required-children': {
enabled: false,
},
};
const DEFAULT_RULESET = { };
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('elements_test_runner');
const tests = [
testElementsDomTree,
testElementsDomBreadcrumbs,
testElementsStylesPane,
testElementsComputedStylesPane,
];
(async function() {
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
// but it is reasonable to have trees with no leaves.
const NO_REQUIRED_CHILDREN_RULESET = {
'aria-required-children': {
enabled: false,
},
};
const DEFAULT_RULESET = {};
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('elements_test_runner');
const tests = [
testElementsDomTree,
testElementsDomBreadcrumbs,
testElementsStylesPane,
testElementsComputedStylesPane,
];
async function testElementsDomTree() {
TestRunner.addResult('Tests accessibility in the DOM tree using the axe-core linter');
const view = 'elements';
await UI.viewManager.showView(view);
const widget = await UI.viewManager.view(view).widget();
const element = widget.element.querySelector('#elements-content');
async function testElementsDomTree() {
TestRunner.addResult('Tests accessibility in the DOM tree using the axe-core linter');
const view = 'elements';
await UI.viewManager.showView(view);
const widget = await UI.viewManager.view(view).widget();
const element = widget.element.querySelector('#elements-content');
await AxeCoreTestRunner.runValidation(element, NO_REQUIRED_CHILDREN_RULESET);
}
await AxeCoreTestRunner.runValidation(element, NO_REQUIRED_CHILDREN_RULESET);
}
async function testElementsDomBreadcrumbs() {
TestRunner.addResult('Tests accessibility in the DOM breadcrumbs using the axe-core linter');
const view = 'elements';
await UI.viewManager.showView(view);
const widget = await UI.viewManager.view(view).widget();
const element = widget.element.querySelector('#elements-crumbs');
async function testElementsDomBreadcrumbs() {
TestRunner.addResult('Tests accessibility in the DOM breadcrumbs using the axe-core linter');
const view = 'elements';
await UI.viewManager.showView(view);
const widget = await UI.viewManager.view(view).widget();
const element = widget.element.querySelector('#elements-crumbs');
await AxeCoreTestRunner.runValidation(element, DEFAULT_RULESET);
}
await AxeCoreTestRunner.runValidation(element, DEFAULT_RULESET);
}
async function testElementsStylesPane() {
TestRunner.addResult('Tests accessibility of the Styles pane using the axe-core linter');
await UI.viewManager.showView('elements');
const panel = self.runtime.sharedInstance(Elements.ElementsPanel);
const element = panel._stylesWidget.element;
async function testElementsStylesPane() {
TestRunner.addResult('Tests accessibility of the Styles pane using the axe-core linter');
await UI.viewManager.showView('elements');
const panel = self.runtime.sharedInstance(Elements.ElementsPanel);
const element = panel._stylesWidget.element;
await AxeCoreTestRunner.runValidation(element, NO_REQUIRED_CHILDREN_RULESET);
}
await AxeCoreTestRunner.runValidation(element, NO_REQUIRED_CHILDREN_RULESET);
}
async function testElementsComputedStylesPane() {
TestRunner.addResult('Tests accessibility in the Computed Styles pane using the axe-core linter');
await UI.viewManager.showView('elements');
await ElementsTestRunner.showComputedStyles();
const panel = self.runtime.sharedInstance(Elements.ElementsPanel);
const element = panel._computedStyleWidget.element;
async function testElementsComputedStylesPane() {
TestRunner.addResult('Tests accessibility in the Computed Styles pane using the axe-core linter');
await UI.viewManager.showView('elements');
await ElementsTestRunner.showComputedStyles();
const panel = self.runtime.sharedInstance(Elements.ElementsPanel);
const element = panel._computedStyleWidget.element;
await AxeCoreTestRunner.runValidation(element, DEFAULT_RULESET);
}
await AxeCoreTestRunner.runValidation(element, DEFAULT_RULESET);
}
TestRunner.runAsyncTestSuite(tests);
})();
TestRunner.runAsyncTestSuite(tests);
})();
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
TestRunner.addResult('Tests accessibility in the lighthouse start view using the axe-core linter.\n');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('lighthouse_test_runner');
await TestRunner.showPanel('lighthouse');
await AxeCoreTestRunner.runValidation(LighthouseTestRunner.getContainerElement());
TestRunner.completeTest();
(async function() {
TestRunner.addResult('Tests accessibility in the lighthouse start view using the axe-core linter.\n');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('lighthouse_test_runner');
await TestRunner.showPanel('lighthouse');
await AxeCoreTestRunner.runValidation(LighthouseTestRunner.getContainerElement());
TestRunner.completeTest();
})();
@@ -3,7 +3,7 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests accessibility in heap profiler using the axe-core linter.`);
TestRunner.addResult('Tests accessibility in heap profiler using the axe-core linter.');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('heap_profiler_test_runner');
await TestRunner.showPanel('heap_profiler');
@@ -12,4 +12,4 @@
await AxeCoreTestRunner.runValidation(widget.element);
TestRunner.completeTest();
})();
})();
@@ -12,4 +12,4 @@
await AxeCoreTestRunner.runValidation(widget.element);
TestRunner.completeTest();
})();
})();
@@ -41,7 +41,7 @@
PerformanceTestRunner.createPerformanceModelWithEvents(testData);
async function testDetailsView() {
TestRunner.addResult(`Tests accessibility in performance Details view using the axe-core linter`);
TestRunner.addResult('Tests accessibility in performance Details view using the axe-core linter');
const detailsView = runtime.sharedInstance(Timeline.TimelineDetailsView);
// Details pane gets data from the parent TimelineDetails view
@@ -82,4 +82,4 @@
testBottomUpView,
testCallTreeView,
]);
})();
})();
@@ -3,7 +3,7 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Test accessibility in Quick Open dialog\n`);
TestRunner.addResult('Test accessibility in Quick Open dialog\n');
await self.runtime.loadModulePromise('quick_open');
await TestRunner.loadModule('axe_core_test_runner');
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
await TestRunner.loadModule('axe_core_test_runner');
TestRunner.addResult(`Tests accessibility in the rendering view using the axe-core linter.`);
TestRunner.addResult('Tests accessibility in the rendering view using the axe-core linter.');
await UI.viewManager.showView('rendering');
const renderingView = await UI.viewManager.view('rendering').widget();
await AxeCoreTestRunner.runValidation(renderingView.element);
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
await TestRunner.loadModule('security_test_runner');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.showPanel('security');
@@ -29,7 +29,7 @@
SecurityTestRunner.dispatchRequestFinished(request1);
const securityPanel = runtime.sharedInstance(Security.SecurityPanel);
securityPanel.showOrigin("https://foo.test");
securityPanel.showOrigin('https://foo.test');
await AxeCoreTestRunner.runValidation(securityPanel.contentElement);
TestRunner.completeTest();
@@ -39,4 +39,4 @@
}
TestRunner.runAsyncTestSuite([testAddPattern, testPatternList, testPatternError]);
})();
})();
@@ -11,7 +11,7 @@
const addDeviceButton = devicesWidget._defaultFocusedElement;
addDeviceButton.click();
TestRunner.addResult(`Invalidating the device pixel ratio`);
TestRunner.addResult('Invalidating the device pixel ratio');
const editor = devicesWidget._list._editor;
const title = editor.control('title');
const width = editor.control('width');
@@ -28,4 +28,4 @@
}
TestRunner.runAsyncTestSuite([testNewDeviceError]);
})();
})();
@@ -51,4 +51,4 @@
}
TestRunner.runAsyncTestSuite([testAddLocation, testNewLocationError]);
})();
})();
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the settings tool shortcuts pane using the axe-core linter.');
await TestRunner.loadModule('axe_core_test_runner');
@@ -18,4 +18,4 @@
}
TestRunner.runAsyncTestSuite([testShortcuts]);
})();
})();
@@ -10,7 +10,7 @@
await TestRunner.navigatePromise('../sources/debugger-breakpoints/resources/dom-breakpoints.html');
TestRunner.addResult('Adding global listener.');
await TestRunner.evaluateInPagePromise(`window.addEventListener('touchstart', () => console.log);`);
await TestRunner.evaluateInPagePromise('window.addEventListener(\'touchstart\', () => console.log);');
await UI.viewManager.showView('sources.globalListeners');
const globalListenersPane = self.runtime.sharedInstance(BrowserDebugger.ObjectEventListenersSidebarPane);
const eventListenersView = globalListenersPane._eventListenersView;
@@ -12,8 +12,8 @@
const sourceFrame = await SourcesTestRunner.showScriptSourcePromise('set-breakpoint.html');
TestRunner.addResult('Setting a breakpoint.');
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 13, '', true)
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 11, '', false)
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 13, '', true);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 11, '', false);
await UI.viewManager.showView('sources.jsBreakpoints');
const breakpointsPaneElement = runtime.sharedInstance(Sources.JavaScriptBreakpointsSidebarPane).contentElement;
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the Sources panel Navigator pane Contentscripts tab using axe-core.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -26,11 +26,11 @@
async function setup() {
// Add content scripts
var pageMock = new SDKTestRunner.PageMock('http://example.com');
const pageMock = new SDKTestRunner.PageMock('http://example.com');
pageMock.connectAsMainTarget('page-target');
const url = 'contentScript1.js';
pageMock.evalScript(url, 'var script', true /* isContentScript */);
await TestRunner.waitForUISourceCode(url)
await TestRunner.waitForUISourceCode(url);
}
async function testA11yForView(ruleSet) {
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the Sources panel Navigator pane FileSystem tab using axe-core.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the Sources panel Navigator pane Network tab using axe-core.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the Sources panel Navigator pane Overrides tab using axe-core.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the Sources panel Navigator pane Snippets tab using axe-core.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests accessibility in the editor pane in sources panel using the axe-core linter.');
// axe-core issue #1444 -- role="tree" requires children with role="treeitem",
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.showPanel('sources');
@@ -3,13 +3,13 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests that console inputs are evaluated in REPL mode\n`);
TestRunner.addResult('Tests that console inputs are evaluated in REPL mode\n');
await TestRunner.loadModule('console_test_runner');
await TestRunner.showPanel('console');
TestRunner.addSniffer(TestRunner.RuntimeAgent, "invoke_evaluate", function(args) {
TestRunner.addResult("Called RuntimeAgent.invoke_evaluate");
TestRunner.addSniffer(TestRunner.RuntimeAgent, 'invoke_evaluate', function(args) {
TestRunner.addResult('Called RuntimeAgent.invoke_evaluate');
TestRunner.addResult("Value of 'replMode': " + args.replMode);
});
@@ -13,7 +13,7 @@
LighthouseTestRunner.getRunButton().click();
const {artifacts, lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult(`\n=============== Lighthouse Results ===============`);
TestRunner.addResult('\n=============== Lighthouse Results ===============');
TestRunner.addResult(`URL: ${lhr.finalUrl}`);
TestRunner.addResult(`Version: ${lhr.lighthouseVersion}`);
TestRunner.addResult(`TestedAsMobileDevice: ${artifacts.TestedAsMobileDevice}`);
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function () {
(async function() {
TestRunner.addResult('Tests that exporting works.\n');
await TestRunner.navigatePromise('resources/lighthouse-basic.html');
@@ -20,7 +20,7 @@
LighthouseTestRunner.getRunButton().click();
const {artifacts, lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult(`\n=============== Lighthouse Results ===============`);
TestRunner.addResult('\n=============== Lighthouse Results ===============');
TestRunner.addResult(`emulatedFormFactor: ${lhr.configSettings.emulatedFormFactor}`);
TestRunner.addResult(`disableStorageReset: ${lhr.configSettings.disableStorageReset}`);
TestRunner.addResult(`throttlingMethod: ${lhr.configSettings.throttlingMethod}`);
@@ -13,17 +13,20 @@
const checkboxes = containerElement.querySelectorAll('.checkbox');
for (const checkbox of checkboxes) {
if (checkbox.textElement.textContent === 'Progressive Web App' ||
checkbox.textElement.textContent === 'Clear storage')
checkbox.textElement.textContent === 'Clear storage') {
continue;
}
if (checkbox.checkboxElement.checked) checkbox.checkboxElement.click();
if (checkbox.checkboxElement.checked) {
checkbox.checkboxElement.click();
}
}
LighthouseTestRunner.dumpStartAuditState();
LighthouseTestRunner.getRunButton().click();
const {lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult(`\n=============== Audits run ===============`);
TestRunner.addResult('\n=============== Audits run ===============');
TestRunner.addResult(Object.keys(lhr.audits).sort().join('\n'));
TestRunner.completeTest();
@@ -5,7 +5,7 @@
(async function() {
// about:blank never fires a load event so just wait until we see the URL change
function navigateToAboutBlankAndWait() {
var listenerPromise = new Promise(resolve => {
const listenerPromise = new Promise(resolve => {
self.SDK.targetManager.addEventListener(SDK.TargetManager.Events.InspectedURLChanged, resolve);
});
@@ -21,8 +21,8 @@
TestRunner.addResult('\n\n**Prevents audit with no categories**');
LighthouseTestRunner.openStartAudit();
var containerElement = LighthouseTestRunner.getContainerElement();
var checkboxes = containerElement.querySelectorAll('.checkbox');
const containerElement = LighthouseTestRunner.getContainerElement();
const checkboxes = containerElement.querySelectorAll('.checkbox');
checkboxes.forEach(checkbox => checkbox.checkboxElement.checked && checkbox.checkboxElement.click());
LighthouseTestRunner.dumpStartAuditState();
@@ -5,7 +5,7 @@
(async function() {
// screenshots in content shell are flaky and NO_NAVSTART occurs on bots way more frequently than local
// ignore the results of the trace-dependent audits, just make sure they ran
var FLAKY_AUDITS = [
const FLAKY_AUDITS = [
// metrics
'first-contentful-paint',
'first-meaningful-paint',
@@ -42,12 +42,12 @@
LighthouseTestRunner.dumpStartAuditState();
TestRunner.addResult(`\n=============== Lighthouse Status Updates ===============`);
TestRunner.addResult('\n=============== Lighthouse Status Updates ===============');
LighthouseTestRunner.addStatusListener(msg => TestRunner.addResult(msg));
LighthouseTestRunner.getRunButton().click();
var {artifacts, lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult(`\n=============== Lighthouse Results ===============`);
const {artifacts, lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult('\n=============== Lighthouse Results ===============');
TestRunner.addResult(`URL: ${lhr.finalUrl}`);
TestRunner.addResult(`Version: ${lhr.lighthouseVersion}`);
TestRunner.addResult(`TestedAsMobileDevice: ${artifacts.TestedAsMobileDevice}`);
@@ -55,7 +55,7 @@
TestRunner.addResult('\n');
Object.keys(lhr.audits).sort().forEach(auditName => {
var audit = lhr.audits[auditName];
const audit = lhr.audits[auditName];
if (FLAKY_AUDITS.includes(auditName)) {
TestRunner.addResult(`${auditName}: flaky`);
@@ -12,18 +12,20 @@
const containerElement = LighthouseTestRunner.getContainerElement();
const checkboxes = containerElement.querySelectorAll('.checkbox');
for (const checkbox of checkboxes) {
if (checkbox.textElement.textContent === 'Performance' ||
checkbox.textElement.textContent === 'Clear storage')
if (checkbox.textElement.textContent === 'Performance' || checkbox.textElement.textContent === 'Clear storage') {
continue;
}
if (checkbox.checkboxElement.checked) checkbox.checkboxElement.click();
if (checkbox.checkboxElement.checked) {
checkbox.checkboxElement.click();
}
}
LighthouseTestRunner.dumpStartAuditState();
LighthouseTestRunner.getRunButton().click();
const {lhr} = await LighthouseTestRunner.waitForResults();
TestRunner.addResult(`\n=============== Audits run ===============`);
TestRunner.addResult('\n=============== Audits run ===============');
TestRunner.addResult(Object.keys(lhr.audits).sort().join('\n'));
const waitForShowView = new Promise(resolve => {
@@ -1,3 +1,5 @@
/* eslint-disable */
function foo() {
return 42;
}
@@ -7,8 +9,8 @@ function boo() {
}
function main() {
var a = 1;
var b = 2;
const a = 1;
const b = 2;
return a + b;
}
@@ -19,11 +21,6 @@ function process(a, b) {
}
function another() {
return 1;
}
@@ -1,3 +1,4 @@
/* eslint-disable */
define(['dart_sdk'], function(dart_sdk) {
'use strict';
const core = dart_sdk.core;
@@ -12,23 +13,21 @@ define(['dart_sdk'], function(dart_sdk) {
let StringAndListTovoid = () => (StringAndListTovoid = dart.constFn(dart.fnType(dart.void, [core.String, core.List])))();
let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.fnType(dart.void, [])))();
breakpoint._foo = function(a, b) {
let val1 = a[$codeUnits][$length];
let val2 = a[$runes].last;
let val3 = dart.test(b[$isNotEmpty]) ? 42 : null;
const val1 = a[$codeUnits][$length];
const val2 = a[$runes].last;
const val3 = dart.test(b[$isNotEmpty]) ? 42 : null;
core.print(val3);
};
dart.fn(breakpoint._foo, StringAndListTovoid());
breakpoint.main = function() {
breakpoint._foo("hello", []);
breakpoint._foo('hello', []);
};
dart.fn(breakpoint.main, VoidTovoid());
dart.trackLibraries("breakpoint", {
"breakpoint.dart": breakpoint
}, null);
dart.trackLibraries('breakpoint', {'breakpoint.dart': breakpoint}, null);
// Exports:
return {
breakpoint: breakpoint
};
});
//# sourceMappingURL=breakpoint.js.map
// # sourceMappingURL=breakpoint.js.map
@@ -1,7 +1,7 @@
onmessage = function (data) {
var a = 1;
var b = 2;
return a + b;
onmessage = function(data) {
const a = 1;
const b = 2;
return a + b;
};
postMessage('ready');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyLXdpdGgtc291cmNlbWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsid29ya2VyLXdpdGgtc291cmNlbWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFNBQVMsR0FBRyxVQUFBLElBQUk7SUFDZCxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDVixJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDVixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDZixDQUFDLENBQUM7QUFDRixXQUFXLENBQUMsT0FBTyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJvbm1lc3NhZ2UgPSBkYXRhID0+IHtcbiAgdmFyIGEgPSAxO1xuICB2YXIgYiA9IDI7XG4gIHJldHVybiBhICsgYjtcbn07XG5wb3N0TWVzc2FnZSgncmVhZHknKTsiXX0=
// # sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyLXdpdGgtc291cmNlbWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsid29ya2VyLXdpdGgtc291cmNlbWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFNBQVMsR0FBRyxVQUFBLElBQUk7SUFDZCxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDVixJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDVixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDZixDQUFDLENBQUM7QUFDRixXQUFXLENBQUMsT0FBTyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJvbm1lc3NhZ2UgPSBkYXRhID0+IHtcbiAgdmFyIGEgPSAxO1xuICB2YXIgYiA9IDI7XG4gIHJldHVybiBhICsgYjtcbn07XG5wb3N0TWVzc2FnZSgncmVhZHknKTsiXX0=
@@ -1,5 +1,5 @@
onmessage = (data) => {
var a = 1;
var b = 2;
onmessage = data => {
const a = 1;
const b = 2;
return a + b;
};
@@ -3,20 +3,20 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests that snippet scripts are evaluated in REPL mode\n`);
TestRunner.addResult('Tests that snippet scripts are evaluated in REPL mode\n');
await TestRunner.showPanel('sources');
await TestRunner.showPanel('sources');
TestRunner.addSniffer(TestRunner.RuntimeAgent, "invoke_evaluate", function(args) {
TestRunner.addResult("Called RuntimeAgent.invoke_evaluate");
TestRunner.addResult("Value of 'replMode': " + args.replMode);
});
TestRunner.addSniffer(TestRunner.RuntimeAgent, 'invoke_evaluate', function(args) {
TestRunner.addResult('Called RuntimeAgent.invoke_evaluate');
TestRunner.addResult('Value of \'replMode\': ' + args.replMode);
});
const uiSourceCode = await Snippets.project.createFile('', null, '');
await uiSourceCode.rename('Snippet1');
uiSourceCode.setWorkingCopy('let a = 1; let a = 2;');
const uiSourceCode = await Snippets.project.createFile('', null, '');
await uiSourceCode.rename('Snippet1');
uiSourceCode.setWorkingCopy('let a = 1; let a = 2;');
await Snippets.evaluateScriptSnippet(uiSourceCode);
await Snippets.evaluateScriptSnippet(uiSourceCode);
TestRunner.completeTest();
TestRunner.completeTest();
})();
@@ -3,18 +3,18 @@
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests the test runner shows assertions in the logs\n`);
TestRunner.addResult('Tests the test runner shows assertions in the logs\n');
TestRunner.addResult(`Passing assert should not show up`);
console.assert(true, `This is a passing assertion.`);
TestRunner.addResult('Passing assert should not show up');
console.assert(true, 'This is a passing assertion.');
TestRunner.addResult('');
TestRunner.addResult(`Failing assert should show up`);
console.assert(false, `This is a failing assertion.`);
TestRunner.addResult('Failing assert should show up');
console.assert(false, 'This is a failing assertion.');
TestRunner.addResult('');
TestRunner.addResult(`Failing assert with multiple arguments`);
console.assert(false, `This is `, `a `, `failing assertion.`);
TestRunner.addResult('Failing assert with multiple arguments');
console.assert(false, 'This is ', 'a ', 'failing assertion.');
TestRunner.completeTest();
})();