chrome-devtools-frontend 1.0.966659 → 1.0.967728

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -576,6 +576,7 @@ grd_files_debug_sources = [
576
576
  "front_end/core/sdk/CSSRule.js",
577
577
  "front_end/core/sdk/CSSStyleDeclaration.js",
578
578
  "front_end/core/sdk/CSSStyleSheetHeader.js",
579
+ "front_end/core/sdk/CSSSupports.js",
579
580
  "front_end/core/sdk/CategorizedBreakpoint.js",
580
581
  "front_end/core/sdk/ChildTargetManager.js",
581
582
  "front_end/core/sdk/CompilerSourceMappingContentProvider.js",
@@ -2966,6 +2966,9 @@
2966
2966
  "panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
2967
2967
  "message": "Owner"
2968
2968
  },
2969
+ "panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
2970
+ "message": "No interest group events recorded."
2971
+ },
2969
2972
  "panels/application/components/OriginTrialTreeView.ts | expiryTime": {
2970
2973
  "message": "Expiry Time"
2971
2974
  },
@@ -2966,6 +2966,9 @@
2966
2966
  "panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
2967
2967
  "message": "Ôẃn̂ér̂"
2968
2968
  },
2969
+ "panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
2970
+ "message": "N̂ó îńt̂ér̂éŝt́ ĝŕôúp̂ év̂én̂t́ŝ ŕêćôŕd̂éd̂."
2971
+ },
2969
2972
  "panels/application/components/OriginTrialTreeView.ts | expiryTime": {
2970
2973
  "message": "Êx́p̂ír̂ý T̂ím̂é"
2971
2974
  },
@@ -9,7 +9,7 @@ import type {CSSModel, Edit} from './CSSModel.js';
9
9
  import {CSSLocation} from './CSSModel.js';
10
10
  import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
11
11
 
12
- type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery;
12
+ type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery|Protocol.CSS.CSSSupports;
13
13
 
14
14
  export abstract class CSSQuery {
15
15
  text = '';
@@ -7,6 +7,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
7
7
 
8
8
  import {CSSContainerQuery} from './CSSContainerQuery.js';
9
9
  import {CSSMedia} from './CSSMedia.js';
10
+ import {CSSSupports} from './CSSSupports.js';
10
11
 
11
12
  import type {CSSModel, Edit} from './CSSModel.js';
12
13
  import {CSSStyleDeclaration, Type} from './CSSStyleDeclaration.js';
@@ -99,6 +100,7 @@ export class CSSStyleRule extends CSSRule {
99
100
  selectors!: CSSValue[];
100
101
  media: CSSMedia[];
101
102
  containerQueries: CSSContainerQuery[];
103
+ supports: CSSSupports[];
102
104
  wasUsed: boolean;
103
105
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
104
106
  // TODO(crbug.com/1011811): Replace with spread operator or better types once Closure is gone.
@@ -108,6 +110,7 @@ export class CSSStyleRule extends CSSRule {
108
110
  this.containerQueries = payload.containerQueries ?
109
111
  CSSContainerQuery.parseContainerQueriesPayload(cssModel, payload.containerQueries) :
110
112
  [];
113
+ this.supports = payload.supports ? CSSSupports.parseSupportsPayload(cssModel, payload.supports) : [];
111
114
  this.wasUsed = wasUsed || false;
112
115
  }
113
116
 
@@ -191,12 +194,9 @@ export class CSSStyleRule extends CSSRule {
191
194
  this.selectors[i].rebase(edit);
192
195
  }
193
196
  }
194
- for (const media of this.media) {
195
- media.rebase(edit);
196
- }
197
- for (const containerQuery of this.containerQueries) {
198
- containerQuery.rebase(edit);
199
- }
197
+ this.media.forEach(media => media.rebase(edit));
198
+ this.containerQueries.forEach(cq => cq.rebase(edit));
199
+ this.supports.forEach(supports => supports.rebase(edit));
200
200
 
201
201
  super.rebase(edit);
202
202
  }
@@ -0,0 +1,30 @@
1
+ // Copyright 2022 The Chromium 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
+ import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import type * as Protocol from '../../generated/protocol.js';
7
+
8
+ import type {CSSModel} from './CSSModel.js';
9
+ import {CSSQuery} from './CSSQuery.js';
10
+
11
+ export class CSSSupports extends CSSQuery {
12
+ static parseSupportsPayload(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports[]): CSSSupports[] {
13
+ return payload.map(supports => new CSSSupports(cssModel, supports));
14
+ }
15
+
16
+ constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports) {
17
+ super(cssModel);
18
+ this.reinitialize(payload);
19
+ }
20
+
21
+ reinitialize(payload: Protocol.CSS.CSSSupports): void {
22
+ this.text = payload.text;
23
+ this.range = payload.range ? TextUtils.TextRange.TextRange.fromObject(payload.range) : null;
24
+ this.styleSheetId = payload.styleSheetId;
25
+ }
26
+
27
+ active(): boolean {
28
+ return true;
29
+ }
30
+ }
@@ -34,6 +34,7 @@ import * as CSSQuery from './CSSQuery.js';
34
34
  import * as CSSRule from './CSSRule.js';
35
35
  import * as CSSStyleDeclaration from './CSSStyleDeclaration.js';
36
36
  import * as CSSStyleSheetHeader from './CSSStyleSheetHeader.js';
37
+ import * as CSSSupports from './CSSSupports.js';
37
38
  import * as DebuggerModel from './DebuggerModel.js';
38
39
  import * as DOMDebuggerModel from './DOMDebuggerModel.js';
39
40
  import * as DOMModel from './DOMModel.js';
@@ -101,6 +102,7 @@ export {
101
102
  CSSRule,
102
103
  CSSStyleDeclaration,
103
104
  CSSStyleSheetHeader,
105
+ CSSSupports,
104
106
  DebuggerModel,
105
107
  DOMDebuggerModel,
106
108
  DOMModel,
@@ -364,6 +364,7 @@ ConsoleTestRunner.dumpConsoleMessagesWithClasses = async function(sortMessages,
364
364
  let messageText = ConsoleTestRunner.prepareConsoleMessageText(element);
365
365
  if (trimMessages) {
366
366
  messageText = messageText.replace(/[ ]+/g, ' ');
367
+ messageText = messageText.replace(/\s+\n\s+/g, ' ');
367
368
  }
368
369
  result.push(messageText + ' ' + element.getAttribute('class') + ' > ' + contentElement.getAttribute('class'));
369
370
  }
@@ -4144,10 +4144,6 @@ export const NativeFunctions = [
4144
4144
  name: 'isInputPending',
4145
4145
  signatures: [['?options']]
4146
4146
  },
4147
- {
4148
- name: 'WindowControlsOverlayGeometryChangeEvent',
4149
- signatures: [['type','eventInitDict']]
4150
- },
4151
4147
  {
4152
4148
  name: 'stop',
4153
4149
  signatures: [['?when']],
@@ -5297,6 +5293,10 @@ export const NativeFunctions = [
5297
5293
  name: 'adAuctionComponents',
5298
5294
  signatures: [['numComponents']]
5299
5295
  },
5296
+ {
5297
+ name: 'deprecatedURNToURL',
5298
+ signatures: [['uuid_url']]
5299
+ },
5300
5300
  {
5301
5301
  name: 'createAdRequest',
5302
5302
  signatures: [['config']]
@@ -5876,24 +5876,9 @@ export const NativeFunctions = [
5876
5876
  signatures: [['path','?options','?successCallback','?errorCallback']],
5877
5877
  receiver: 'DirectoryEntry'
5878
5878
  },
5879
- {
5880
- name: 'rename',
5881
- signatures: [['new_entry_name']],
5882
- receiver: 'FileSystemFileHandle'
5883
- },
5884
- {
5885
- name: 'rename',
5886
- signatures: [['new_entry_name']],
5887
- receiver: 'FileSystemHandle'
5888
- },
5889
- {
5890
- name: 'rename',
5891
- signatures: [['old_name','new_name']],
5892
- receiver: 'NativeIOFileManager'
5893
- },
5894
5879
  {
5895
5880
  name: 'move',
5896
- signatures: [['destination_directory','?new_entry_name']]
5881
+ signatures: [['new_entry_name'],['destination_directory','?new_entry_name']]
5897
5882
  },
5898
5883
  {
5899
5884
  name: 'queryPermission',
@@ -6396,6 +6381,10 @@ export const NativeFunctions = [
6396
6381
  signatures: [['sync']],
6397
6382
  receiver: 'WebGL2RenderingContextBase'
6398
6383
  },
6384
+ {
6385
+ name: 'rename',
6386
+ signatures: [['old_name','new_name']]
6387
+ },
6399
6388
  {
6400
6389
  name: 'renameSync',
6401
6390
  signatures: [['old_name','new_name']]
@@ -6679,6 +6668,10 @@ export const NativeFunctions = [
6679
6668
  name: 'PictureInPictureEvent',
6680
6669
  signatures: [['type','eventInitDict']]
6681
6670
  },
6671
+ {
6672
+ name: 'requestPictureInPictureWindow',
6673
+ signatures: [['options']]
6674
+ },
6682
6675
  {
6683
6676
  name: 'refresh',
6684
6677
  signatures: [['?reload']]
@@ -8401,7 +8394,7 @@ export const NativeFunctions = [
8401
8394
  },
8402
8395
  {
8403
8396
  name: 'dispatch',
8404
- signatures: [['x','?y','?z']]
8397
+ signatures: [['workgroupCountX','?workgroupCountY','?workgroupCountZ']]
8405
8398
  },
8406
8399
  {
8407
8400
  name: 'dispatchIndirect',
@@ -8683,6 +8676,10 @@ export const NativeFunctions = [
8683
8676
  name: 'USBOutTransferResult',
8684
8677
  signatures: [['status','?bytesWritten']]
8685
8678
  },
8679
+ {
8680
+ name: 'WindowControlsOverlayGeometryChangeEvent',
8681
+ signatures: [['type','eventInitDict']]
8682
+ },
8686
8683
  {
8687
8684
  name: 'getPose',
8688
8685
  signatures: [['relative_to']]
@@ -32,6 +32,10 @@ const UIStrings = {
32
32
  *@description Text in InterestGroupStorage Items View of the Application panel
33
33
  */
34
34
  groupName: 'Name',
35
+ /**
36
+ *@description Text shown instead of a table when the table would be empty.
37
+ */
38
+ noEvents: 'No interest group events recorded.',
35
39
  };
36
40
  const str_ = i18n.i18n.registerUIStrings('panels/application/components/InterestGroupAccessGrid.ts', UIStrings);
37
41
  export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -62,13 +66,17 @@ export class InterestGroupAccessGrid extends HTMLElement {
62
66
  {iconName: 'ic_info_black_18dp', color: 'var(--color-link)', width: '14px'} as
63
67
  IconButton.Icon.IconWithName}>
64
68
  </${IconButton.Icon.Icon.litTagName}>
65
- ${this.#renderGrid()}
69
+ ${this.#renderGridOrNoDataMessage()}
66
70
  </div>
67
71
  `, this.#shadow, {host: this});
68
72
  // clang-format on
69
73
  }
70
74
 
71
- #renderGrid(): LitHtml.TemplateResult {
75
+ #renderGridOrNoDataMessage(): LitHtml.TemplateResult {
76
+ if (this.#datastores.length === 0) {
77
+ return LitHtml.html`<div class="no-events-message">${i18nString(UIStrings.noEvents)}</div>`;
78
+ }
79
+
72
80
  const gridData: DataGrid.DataGridController.DataGridControllerData = {
73
81
  columns: [
74
82
  {
@@ -21,6 +21,6 @@ devtools-data-grid-controller {
21
21
  height: 14px;
22
22
  }
23
23
 
24
- .no-tt-message {
24
+ .no-events-message {
25
25
  margin-top: 20px;
26
26
  }
@@ -4,6 +4,10 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
+ devtools-interest-group-access-grid {
8
+ overflow: auto;
9
+ }
10
+
7
11
  .placeholder {
8
12
  display: flex;
9
13
  align-items: center;
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
+ import * as Root from '../../core/root/root.js';
9
10
  import * as SDK from '../../core/sdk/sdk.js';
10
11
  import * as Bindings from '../../models/bindings/bindings.js';
11
12
  import * as TextUtils from '../../models/text_utils/text_utils.js';
@@ -116,6 +117,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
116
117
  private prompt: CSSPropertyPrompt|null;
117
118
  private lastComputedValue: string|null;
118
119
  private contextForTest!: Context|undefined;
120
+ #propertyTextFromSource: string;
119
121
 
120
122
  constructor(
121
123
  stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
@@ -145,6 +147,8 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
145
147
  this.prompt = null;
146
148
 
147
149
  this.lastComputedValue = null;
150
+
151
+ this.#propertyTextFromSource = property.propertyText || '';
148
152
  }
149
153
 
150
154
  matchedStyles(): SDK.CSSMatchedStyles.CSSMatchedStyles {
@@ -478,7 +482,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
478
482
  this.listItemElement.classList.remove('disabled');
479
483
  }
480
484
 
481
- this.listItemElement.classList.toggle('changed', this.parentPane().isPropertyChanged(this.property));
485
+ this.listItemElement.classList.toggle('changed', this.isPropertyChanged(this.property));
482
486
  }
483
487
 
484
488
  node(): SDK.DOMModel.DOMNode|null {
@@ -523,6 +527,14 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
523
527
  this.styleTextAppliedForTest();
524
528
  }
525
529
 
530
+ private isPropertyChanged(property: SDK.CSSProperty.CSSProperty): boolean {
531
+ if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.STYLES_PANE_CSS_CHANGES)) {
532
+ return false;
533
+ }
534
+ // Check local cache first, then check against diffs from the workspace.
535
+ return this.#propertyTextFromSource !== property.propertyText || this.parentPane().isPropertyChanged(property);
536
+ }
537
+
526
538
  async onpopulate(): Promise<void> {
527
539
  // Only populate once and if this property is a shorthand.
528
540
  if (this.childCount() || !this.isShorthand) {
@@ -1481,7 +1493,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
1481
1493
  return;
1482
1494
  }
1483
1495
  if (updatedProperty) {
1484
- this.listItemElement.classList.toggle('changed', this.parentPane().isPropertyChanged(updatedProperty));
1496
+ this.listItemElement.classList.toggle('changed', this.isPropertyChanged(updatedProperty));
1485
1497
  }
1486
1498
 
1487
1499
  this.matchedStylesInternal.resetActiveProperties();
@@ -1023,9 +1023,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1023
1023
  }
1024
1024
 
1025
1025
  isPropertyChanged(property: SDK.CSSProperty.CSSProperty): boolean {
1026
- if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.STYLES_PANE_CSS_CHANGES)) {
1027
- return false;
1028
- }
1029
1026
  const url = property.ownerStyle.parentRule?.resourceURL();
1030
1027
  if (!url) {
1031
1028
  return false;
@@ -1843,6 +1840,12 @@ export class StylePropertiesSection {
1843
1840
  this.updateRuleOrigin();
1844
1841
  }
1845
1842
 
1843
+ protected createAtRuleLists(rule: SDK.CSSRule.CSSStyleRule): void {
1844
+ this.createMediaList(rule.media);
1845
+ this.createContainerQueryList(rule.containerQueries);
1846
+ this.createSupportsList(rule.supports);
1847
+ }
1848
+
1846
1849
  protected createMediaList(mediaRules: SDK.CSSMedia.CSSMedia[]): void {
1847
1850
  for (let i = mediaRules.length - 1; i >= 0; --i) {
1848
1851
  const media = mediaRules[i];
@@ -1910,6 +1913,28 @@ export class StylePropertiesSection {
1910
1913
  }
1911
1914
  }
1912
1915
 
1916
+ protected createSupportsList(supportsList: SDK.CSSSupports.CSSSupports[]): void {
1917
+ for (let i = supportsList.length - 1; i >= 0; --i) {
1918
+ const supports = supportsList[i];
1919
+ if (!supports.text) {
1920
+ continue;
1921
+ }
1922
+
1923
+ let onQueryTextClick;
1924
+ if (supports.styleSheetId) {
1925
+ onQueryTextClick = this.handleQueryRuleClick.bind(this, supports);
1926
+ }
1927
+
1928
+ const supportsElement = new ElementsComponents.CSSQuery.CSSQuery();
1929
+ supportsElement.data = {
1930
+ queryPrefix: '@supports',
1931
+ queryText: supports.text,
1932
+ onQueryTextClick,
1933
+ };
1934
+ this.queryListElement.append(supportsElement);
1935
+ }
1936
+ }
1937
+
1913
1938
  private async addContainerForContainerQuery(containerQuery: SDK.CSSContainerQuery.CSSContainerQuery): Promise<void> {
1914
1939
  const container = await containerQuery.getContainerForNode(this.matchedStyles.node().id);
1915
1940
  if (!container) {
@@ -1940,8 +1965,7 @@ export class StylePropertiesSection {
1940
1965
  private updateQueryList(): void {
1941
1966
  this.queryListElement.removeChildren();
1942
1967
  if (this.styleInternal.parentRule && this.styleInternal.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
1943
- this.createMediaList(this.styleInternal.parentRule.media);
1944
- this.createContainerQueryList(this.styleInternal.parentRule.containerQueries);
1968
+ this.createAtRuleLists(this.styleInternal.parentRule);
1945
1969
  }
1946
1970
  }
1947
1971
 
@@ -2213,8 +2237,7 @@ export class StylePropertiesSection {
2213
2237
  event.consume(true);
2214
2238
  }
2215
2239
 
2216
- private handleQueryRuleClick(query: SDK.CSSMedia.CSSMedia|SDK.CSSContainerQuery.CSSContainerQuery, event: Event):
2217
- void {
2240
+ private handleQueryRuleClick(query: SDK.CSSQuery.CSSQuery, event: Event): void {
2218
2241
  const element = event.currentTarget as Element;
2219
2242
  if (UI.UIUtils.isBeingEdited(element)) {
2220
2243
  return;
@@ -2276,8 +2299,8 @@ export class StylePropertiesSection {
2276
2299
  }
2277
2300
 
2278
2301
  private editingMediaCommitted(
2279
- query: SDK.CSSMedia.CSSMedia|SDK.CSSContainerQuery.CSSContainerQuery, element: Element, newContent: string,
2280
- _oldContent: string, _context: Context|undefined, _moveDirection: string): void {
2302
+ query: SDK.CSSQuery.CSSQuery, element: Element, newContent: string, _oldContent: string,
2303
+ _context: Context|undefined, _moveDirection: string): void {
2281
2304
  this.parentPane.setEditingStyle(false);
2282
2305
  this.editingMediaFinished(element);
2283
2306
 
@@ -2563,8 +2586,7 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
2563
2586
  cssModel, this.parentPane.linkifier, styleSheetId, this.actualRuleLocation()));
2564
2587
  if (insertAfterStyle && insertAfterStyle.parentRule &&
2565
2588
  insertAfterStyle.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
2566
- this.createMediaList(insertAfterStyle.parentRule.media);
2567
- this.createContainerQueryList(insertAfterStyle.parentRule.containerQueries);
2589
+ this.createAtRuleLists(insertAfterStyle.parentRule);
2568
2590
  }
2569
2591
  this.element.classList.add('blank-section');
2570
2592
  }
@@ -12,6 +12,8 @@
12
12
  input {
13
13
  height: 12px;
14
14
  width: 12px;
15
+ min-height: 12px;
16
+ min-width: 12px;
15
17
  }
16
18
 
17
19
  label {
@@ -188,6 +188,7 @@ function detectLineSeparator(text: string): CM.Extension {
188
188
 
189
189
  const baseKeymap = CM.keymap.of([
190
190
  {key: 'Tab', run: CM.acceptCompletion},
191
+ {key: 'End', run: CM.acceptCompletion},
191
192
  {key: 'Ctrl-m', run: CM.cursorMatchingBracket, shift: CM.selectMatchingBracket},
192
193
  {key: 'Mod-/', run: CM.toggleComment},
193
194
  {key: 'Mod-d', run: CM.selectNextOccurrence},
package/package.json CHANGED
@@ -39,6 +39,7 @@
39
39
  "debug-unittest": "DEBUG_TEST=1 npm run unittest",
40
40
  "e2etest": "third_party/node/node.py --output scripts/test/run_test_suite.js --config=test/e2e/test-runner-config.json",
41
41
  "eslint-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/eslint_rules/tests/*_test.js\"",
42
+ "build-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/build/tests/*_test.js\"",
42
43
  "generate-dark-mode-styles": "third_party/node/node.py --output scripts/dark_mode/generate_dark_theme_sheet.js",
43
44
  "generate-protocol-resources": "scripts/deps/generate_protocol_resources.py && git cl format --js",
44
45
  "install-deps": "scripts/deps/manage_node_deps.py",
@@ -53,5 +54,5 @@
53
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
56
  },
56
- "version": "1.0.966659"
57
+ "version": "1.0.967728"
57
58
  }
@@ -27,16 +27,17 @@ const plugin = {
27
27
  return null;
28
28
  }
29
29
 
30
- if (res.external && res.id) {
31
- return {
32
- external: res.external,
33
- path: './' + path.relative(outdir, res.id),
34
- };
35
- }
36
-
37
30
  if (res.external) {
31
+ // res.id can be both of absolutized local JavaScript path or node's
32
+ // builtin module (e.g. 'fs', 'path'), and only relativize the path in
33
+ // former case.
34
+ if (path.isAbsolute(res.id)) {
35
+ res.id = './' + path.relative(outdir, res.id);
36
+ }
37
+
38
38
  return {
39
- external: true,
39
+ external: res.external,
40
+ path: res.id,
40
41
  };
41
42
  }
42
43
 
@@ -0,0 +1,30 @@
1
+ // Copyright 2022 The Chromium 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
+ const {assert} = require('chai');
6
+ const path = require('path');
7
+
8
+ const {devtoolsPlugin} = require('../devtools_plugin.js');
9
+
10
+ describe('devtools_plugin can compute paths with', () => {
11
+ it('same directory import', () => {
12
+ assert.deepEqual(
13
+ devtoolsPlugin('./AnotherFile.js', 'front_end/core/sdk/FirstFile.js'),
14
+ {id: path.join('front_end', 'core', 'sdk', 'AnotherFile.js'), external: false});
15
+ });
16
+
17
+ it('different directory import', () => {
18
+ assert.deepEqual(
19
+ devtoolsPlugin('../common/common.js', 'front_end/core/sdk/FirstFile.js'),
20
+ {id: path.join('front_end', 'core', 'common', 'common.js'), external: true});
21
+ });
22
+
23
+ it('node built-in modules', () => {
24
+ assert.deepEqual(devtoolsPlugin('fs', 'scripts/some-script.js'), {id: 'fs', external: true});
25
+ });
26
+
27
+ it('importing generated files', () => {
28
+ assert.strictEqual(devtoolsPlugin('../../generated/Protocol.js', 'front_end/core/sdk/FirstFile.js'), null);
29
+ });
30
+ });