webext-schema 7.0.0 → 7.1.1

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.
@@ -200,13 +200,16 @@ describe('Schema', () => {
200
200
  namespace: 'foo'
201
201
  });
202
202
  schema._assignImportMap();
203
- assert.deepEqual(schema._browser, {
204
- foo: {
205
- baz: {}
203
+ assert.deepEqual(
204
+ schema._browser,
205
+ {
206
+ foo: {
207
+ baz: {}
208
+ },
209
+ bar: {}
206
210
  },
207
- bar: {
208
- }
209
- }, 'browser');
211
+ 'browser'
212
+ );
210
213
  assert.strictEqual(schema._importMap.size, 0, 'size');
211
214
  });
212
215
 
@@ -223,14 +226,18 @@ describe('Schema', () => {
223
226
  namespace: 'bar'
224
227
  });
225
228
  schema._assignImportMap();
226
- assert.deepEqual(schema._browser, {
227
- foo: {
228
- baz: {}
229
+ assert.deepEqual(
230
+ schema._browser,
231
+ {
232
+ foo: {
233
+ baz: {}
234
+ },
235
+ bar: {
236
+ baz: {}
237
+ }
229
238
  },
230
- bar: {
231
- baz: {}
232
- }
233
- }, 'browser');
239
+ 'browser'
240
+ );
234
241
  assert.strictEqual(schema._importMap.size, 0, 'size');
235
242
  });
236
243
 
@@ -249,16 +256,20 @@ describe('Schema', () => {
249
256
  namespace: 'bar'
250
257
  });
251
258
  schema._assignImportMap();
252
- assert.deepEqual(schema._browser, {
253
- foo: {
254
- baz: {
259
+ assert.deepEqual(
260
+ schema._browser,
261
+ {
262
+ foo: {
263
+ baz: {
264
+ qux: {}
265
+ }
266
+ },
267
+ bar: {
255
268
  qux: {}
256
269
  }
257
270
  },
258
- bar: {
259
- qux: {}
260
- }
261
- }, 'browser');
271
+ 'browser'
272
+ );
262
273
  assert.strictEqual(schema._importMap.size, 0, 'size');
263
274
  });
264
275
 
@@ -279,18 +290,22 @@ describe('Schema', () => {
279
290
  namespace: 'bar'
280
291
  });
281
292
  schema._assignImportMap();
282
- assert.deepEqual(schema._browser, {
283
- foo: {
284
- baz: {
285
- qux: {}
293
+ assert.deepEqual(
294
+ schema._browser,
295
+ {
296
+ foo: {
297
+ baz: {
298
+ qux: {}
299
+ }
300
+ },
301
+ bar: {
302
+ quux: {
303
+ qux: {}
304
+ }
286
305
  }
287
306
  },
288
- bar: {
289
- quux: {
290
- qux: {}
291
- }
292
- }
293
- }, 'browser');
307
+ 'browser'
308
+ );
294
309
  assert.strictEqual(schema._importMap.size, 0, 'size');
295
310
  });
296
311
 
@@ -309,16 +324,20 @@ describe('Schema', () => {
309
324
  namespace: 'foo'
310
325
  });
311
326
  schema._assignImportMap();
312
- assert.deepEqual(schema._browser, {
313
- foo: {
314
- bar: {
315
- qux: {}
316
- },
317
- baz: {
318
- qux: {}
327
+ assert.deepEqual(
328
+ schema._browser,
329
+ {
330
+ foo: {
331
+ bar: {
332
+ qux: {}
333
+ },
334
+ baz: {
335
+ qux: {}
336
+ }
319
337
  }
320
- }
321
- }, 'browser');
338
+ },
339
+ 'browser'
340
+ );
322
341
  assert.strictEqual(schema._importMap.size, 0, 'size');
323
342
  });
324
343
  });
@@ -345,13 +364,16 @@ describe('Schema', () => {
345
364
  namespace: 'foo'
346
365
  });
347
366
  schema._assignRefMap();
348
- assert.deepEqual(schema._browser, {
349
- foo: {
350
- baz: {}
367
+ assert.deepEqual(
368
+ schema._browser,
369
+ {
370
+ foo: {
371
+ baz: {}
372
+ },
373
+ bar: {}
351
374
  },
352
- bar: {
353
- }
354
- }, 'browser');
375
+ 'browser'
376
+ );
355
377
  assert.strictEqual(schema._refMap.size, 0, 'size');
356
378
  });
357
379
 
@@ -368,14 +390,18 @@ describe('Schema', () => {
368
390
  namespace: 'bar'
369
391
  });
370
392
  schema._assignRefMap();
371
- assert.deepEqual(schema._browser, {
372
- foo: {
373
- baz: {}
393
+ assert.deepEqual(
394
+ schema._browser,
395
+ {
396
+ foo: {
397
+ baz: {}
398
+ },
399
+ bar: {
400
+ baz: {}
401
+ }
374
402
  },
375
- bar: {
376
- baz: {}
377
- }
378
- }, 'browser');
403
+ 'browser'
404
+ );
379
405
  assert.strictEqual(schema._refMap.size, 0, 'size');
380
406
  });
381
407
 
@@ -394,16 +420,20 @@ describe('Schema', () => {
394
420
  namespace: 'bar'
395
421
  });
396
422
  schema._assignRefMap();
397
- assert.deepEqual(schema._browser, {
398
- foo: {
399
- baz: {
423
+ assert.deepEqual(
424
+ schema._browser,
425
+ {
426
+ foo: {
427
+ baz: {
428
+ qux: {}
429
+ }
430
+ },
431
+ bar: {
400
432
  qux: {}
401
433
  }
402
434
  },
403
- bar: {
404
- qux: {}
405
- }
406
- }, 'browser');
435
+ 'browser'
436
+ );
407
437
  assert.strictEqual(schema._refMap.size, 0, 'size');
408
438
  });
409
439
 
@@ -424,18 +454,22 @@ describe('Schema', () => {
424
454
  namespace: 'bar'
425
455
  });
426
456
  schema._assignRefMap();
427
- assert.deepEqual(schema._browser, {
428
- foo: {
429
- baz: {
430
- qux: {}
457
+ assert.deepEqual(
458
+ schema._browser,
459
+ {
460
+ foo: {
461
+ baz: {
462
+ qux: {}
463
+ }
464
+ },
465
+ bar: {
466
+ quux: {
467
+ qux: {}
468
+ }
431
469
  }
432
470
  },
433
- bar: {
434
- quux: {
435
- qux: {}
436
- }
437
- }
438
- }, 'browser');
471
+ 'browser'
472
+ );
439
473
  assert.strictEqual(schema._refMap.size, 0, 'size');
440
474
  });
441
475
 
@@ -454,16 +488,20 @@ describe('Schema', () => {
454
488
  namespace: 'foo'
455
489
  });
456
490
  schema._assignRefMap();
457
- assert.deepEqual(schema._browser, {
458
- foo: {
459
- bar: {
460
- qux: {}
461
- },
462
- baz: {
463
- qux: {}
491
+ assert.deepEqual(
492
+ schema._browser,
493
+ {
494
+ foo: {
495
+ bar: {
496
+ qux: {}
497
+ },
498
+ baz: {
499
+ qux: {}
500
+ }
464
501
  }
465
- }
466
- }, 'browser');
502
+ },
503
+ 'browser'
504
+ );
467
505
  assert.strictEqual(schema._refMap.size, 0, 'size');
468
506
  });
469
507
  });
@@ -520,26 +558,35 @@ describe('Schema', () => {
520
558
  assert.strictEqual(typeof res.foo, 'object', 'result');
521
559
  assert.strictEqual(typeof res.foo.addListener, 'function', 'addListener');
522
560
  assert.strictEqual(typeof res.foo.hasListener, 'function', 'hasListener');
523
- assert.strictEqual(typeof res.foo.removeListener, 'function',
524
- 'removeListener');
561
+ assert.strictEqual(
562
+ typeof res.foo.removeListener,
563
+ 'function',
564
+ 'removeListener'
565
+ );
525
566
  });
526
567
 
527
568
  it('should add listeners', () => {
528
569
  const schema = new Schema();
529
- const res = schema._mockEvents({
530
- foo: {}
531
- }, [
570
+ const res = schema._mockEvents(
532
571
  {
533
- name: 'foo',
534
- type: 'function'
535
- }
536
- ]);
572
+ foo: {}
573
+ },
574
+ [
575
+ {
576
+ name: 'foo',
577
+ type: 'function'
578
+ }
579
+ ]
580
+ );
537
581
  assert.strictEqual(typeof res, 'object', 'result');
538
582
  assert.strictEqual(typeof res.foo, 'object', 'result');
539
583
  assert.strictEqual(typeof res.foo.addListener, 'function', 'addListener');
540
584
  assert.strictEqual(typeof res.foo.hasListener, 'function', 'hasListener');
541
- assert.strictEqual(typeof res.foo.removeListener, 'function',
542
- 'removeListener');
585
+ assert.strictEqual(
586
+ typeof res.foo.removeListener,
587
+ 'function',
588
+ 'removeListener'
589
+ );
543
590
  });
544
591
  });
545
592
 
@@ -597,14 +644,17 @@ describe('Schema', () => {
597
644
 
598
645
  it('should add functions', () => {
599
646
  const schema = new Schema();
600
- const res = schema._mockFunctions({
601
- foo: {}
602
- }, [
647
+ const res = schema._mockFunctions(
603
648
  {
604
- name: 'foo',
605
- type: 'function'
606
- }
607
- ]);
649
+ foo: {}
650
+ },
651
+ [
652
+ {
653
+ name: 'foo',
654
+ type: 'function'
655
+ }
656
+ ]
657
+ );
608
658
  assert.strictEqual(typeof res, 'object', 'result');
609
659
  assert.strictEqual(typeof res.foo, 'function', 'function');
610
660
  });
@@ -634,107 +684,154 @@ describe('Schema', () => {
634
684
 
635
685
  it('should not add properties', () => {
636
686
  const schema = new Schema();
637
- const res = schema._mockProperties({}, {
638
- bar: {
639
- name: 'baz',
640
- type: 'function',
641
- unsupported: true
642
- }
643
- }, 'foo');
687
+ const res = schema._mockProperties(
688
+ {},
689
+ {
690
+ bar: {
691
+ name: 'baz',
692
+ type: 'function',
693
+ unsupported: true
694
+ }
695
+ },
696
+ 'foo'
697
+ );
644
698
  assert.deepEqual(res, {}, 'result');
645
699
  });
646
700
 
647
701
  it('should set map', () => {
648
702
  const schema = new Schema();
649
- const res = schema._mockProperties({
650
- }, {
651
- bar: {
652
- $ref: 'baz'
653
- }
654
- }, 'foo');
655
- assert.deepEqual(res, {
656
- bar: {}
657
- }, 'result');
658
- assert.deepEqual(Array.from(schema._refMap), [
659
- [
660
- 'foo.bar',
661
- {
662
- $ref: 'baz',
663
- namespace: 'foo'
703
+ const res = schema._mockProperties(
704
+ {},
705
+ {
706
+ bar: {
707
+ $ref: 'baz'
664
708
  }
665
- ]
666
- ], 'map');
709
+ },
710
+ 'foo'
711
+ );
712
+ assert.deepEqual(
713
+ res,
714
+ {
715
+ bar: {}
716
+ },
717
+ 'result'
718
+ );
719
+ assert.deepEqual(
720
+ Array.from(schema._refMap),
721
+ [
722
+ [
723
+ 'foo.bar',
724
+ {
725
+ $ref: 'baz',
726
+ namespace: 'foo'
727
+ }
728
+ ]
729
+ ],
730
+ 'map'
731
+ );
667
732
  });
668
733
 
669
734
  it('should add properties', () => {
670
735
  const schema = new Schema();
671
- const res = schema._mockProperties({
672
- }, {
673
- bar: {
674
- value: -1
675
- }
676
- }, 'foo');
677
- assert.deepEqual(res, {
678
- bar: -1
679
- }, 'result');
736
+ const res = schema._mockProperties(
737
+ {},
738
+ {
739
+ bar: {
740
+ value: -1
741
+ }
742
+ },
743
+ 'foo'
744
+ );
745
+ assert.deepEqual(
746
+ res,
747
+ {
748
+ bar: -1
749
+ },
750
+ 'result'
751
+ );
680
752
  });
681
753
 
682
754
  it('should add properties', () => {
683
755
  const schema = new Schema();
684
- const res = schema._mockProperties({
685
- }, {
686
- bar: {
687
- type: 'function'
688
- }
689
- }, 'foo');
756
+ const res = schema._mockProperties(
757
+ {},
758
+ {
759
+ bar: {
760
+ type: 'function'
761
+ }
762
+ },
763
+ 'foo'
764
+ );
690
765
  assert.strictEqual(typeof res, 'object', 'result');
691
766
  assert.strictEqual(typeof res.bar, 'function', 'property');
692
767
  });
693
768
 
694
769
  it('should add properties', () => {
695
770
  const schema = new Schema();
696
- const res = schema._mockProperties({
697
- }, {
698
- bar: {
699
- type: 'object'
700
- }
701
- }, 'foo');
702
- assert.deepEqual(res, {
703
- bar: {}
704
- }, 'result');
771
+ const res = schema._mockProperties(
772
+ {},
773
+ {
774
+ bar: {
775
+ type: 'object'
776
+ }
777
+ },
778
+ 'foo'
779
+ );
780
+ assert.deepEqual(
781
+ res,
782
+ {
783
+ bar: {}
784
+ },
785
+ 'result'
786
+ );
705
787
  });
706
788
 
707
789
  it('should add properties', () => {
708
790
  const schema = new Schema();
709
- const res = schema._mockProperties({
710
- bar: {}
711
- }, {
712
- bar: {
713
- properties: {
714
- baz: {
715
- type: 'object'
791
+ const res = schema._mockProperties(
792
+ {
793
+ bar: {}
794
+ },
795
+ {
796
+ bar: {
797
+ properties: {
798
+ baz: {
799
+ type: 'object'
800
+ }
716
801
  }
717
802
  }
718
- }
719
- }, 'foo');
720
- assert.deepEqual(res, {
721
- bar: {
722
- baz: {}
723
- }
724
- }, 'result');
803
+ },
804
+ 'foo'
805
+ );
806
+ assert.deepEqual(
807
+ res,
808
+ {
809
+ bar: {
810
+ baz: {}
811
+ }
812
+ },
813
+ 'result'
814
+ );
725
815
  });
726
816
 
727
817
  it('should add properties', () => {
728
818
  const schema = new Schema();
729
- const res = schema._mockProperties({
730
- }, {
731
- bar: {
732
- type: 'string'
733
- }
734
- }, 'foo');
735
- assert.deepEqual(res, {
736
- bar: null
737
- }, 'result');
819
+ const res = schema._mockProperties(
820
+ {},
821
+ {
822
+ bar: {
823
+ type: 'string'
824
+ }
825
+ },
826
+ 'foo'
827
+ );
828
+ assert.deepEqual(
829
+ res,
830
+ {
831
+ bar: null
832
+ },
833
+ 'result'
834
+ );
738
835
  });
739
836
  });
740
837
 
@@ -762,57 +859,83 @@ describe('Schema', () => {
762
859
 
763
860
  it('should set map', () => {
764
861
  const schema = new Schema();
765
- const res = schema._mockTypes({
766
- }, [
767
- {
768
- $import: 'bar',
769
- id: 'baz'
770
- }
771
- ], 'foo');
772
- assert.deepEqual(res, {
773
- baz: {}
774
- }, 'result');
775
- assert.deepEqual(Array.from(schema._importMap), [
862
+ const res = schema._mockTypes(
863
+ {},
776
864
  [
777
- 'foo.baz',
778
865
  {
779
866
  $import: 'bar',
780
- namespace: 'foo'
867
+ id: 'baz'
781
868
  }
782
- ]
783
- ], 'map');
869
+ ],
870
+ 'foo'
871
+ );
872
+ assert.deepEqual(
873
+ res,
874
+ {
875
+ baz: {}
876
+ },
877
+ 'result'
878
+ );
879
+ assert.deepEqual(
880
+ Array.from(schema._importMap),
881
+ [
882
+ [
883
+ 'foo.baz',
884
+ {
885
+ $import: 'bar',
886
+ namespace: 'foo'
887
+ }
888
+ ]
889
+ ],
890
+ 'map'
891
+ );
784
892
  });
785
893
 
786
894
  it('should add types', () => {
787
895
  const schema = new Schema();
788
- const res = schema._mockTypes({
789
- }, [
896
+ const res = schema._mockTypes(
897
+ {},
898
+ [
899
+ {
900
+ id: 'baz',
901
+ type: 'object'
902
+ }
903
+ ],
904
+ 'foo'
905
+ );
906
+ assert.deepEqual(
907
+ res,
790
908
  {
791
- id: 'baz',
792
- type: 'object'
793
- }
794
- ], 'foo');
795
- assert.deepEqual(res, {
796
- baz: {}
797
- }, 'result');
909
+ baz: {}
910
+ },
911
+ 'result'
912
+ );
798
913
  });
799
914
 
800
915
  it('should add types', () => {
801
916
  const schema = new Schema();
802
- const res = schema._mockTypes({
803
- baz: {}
804
- }, [
917
+ const res = schema._mockTypes(
805
918
  {
806
- events: [],
807
- functions: [],
808
- id: 'baz',
809
- properties: {},
810
- type: 'object'
811
- }
812
- ], 'foo');
813
- assert.deepEqual(res, {
814
- baz: {}
815
- }, 'result');
919
+ baz: {}
920
+ },
921
+ [
922
+ {
923
+ events: [],
924
+ functions: [],
925
+ id: 'baz',
926
+ properties: {},
927
+ type: 'object'
928
+ }
929
+ ],
930
+ 'foo'
931
+ );
932
+ assert.deepEqual(
933
+ res,
934
+ {
935
+ baz: {}
936
+ },
937
+ 'result'
938
+ );
816
939
  });
817
940
  });
818
941
 
@@ -865,8 +988,11 @@ describe('Schema', () => {
865
988
  describe('get schema', () => {
866
989
  it('should throw', () => {
867
990
  const schema = new Schema();
868
- assert.throws(() => schema.get(), TypeError,
869
- 'Expected String but got Undefined.');
991
+ assert.throws(
992
+ () => schema.get(),
993
+ TypeError,
994
+ 'Expected String but got Undefined.'
995
+ );
870
996
  });
871
997
 
872
998
  it('should get null', () => {
@@ -973,137 +1099,276 @@ describe('Schema', () => {
973
1099
  const browser = schema.mock();
974
1100
  assert.strictEqual(typeof browser, 'object', 'browser');
975
1101
  const {
976
- bookmarks, browserAction, browserSettings, commands, contextMenus,
977
- contextualIdentities, devtools, i18n, management, menus, notifications,
978
- permissions, privacy, runtime, sessions, storage, tabs, theme, windows
1102
+ bookmarks,
1103
+ browserAction,
1104
+ browserSettings,
1105
+ commands,
1106
+ contextMenus,
1107
+ contextualIdentities,
1108
+ devtools,
1109
+ i18n,
1110
+ management,
1111
+ menus,
1112
+ notifications,
1113
+ permissions,
1114
+ privacy,
1115
+ runtime,
1116
+ sessions,
1117
+ storage,
1118
+ tabs,
1119
+ theme,
1120
+ windows
979
1121
  } = browser;
980
1122
  const { inspectedWindow } = devtools;
981
1123
  assert.strictEqual(typeof bookmarks, 'object', 'bookmarks');
982
- assert.strictEqual(typeof bookmarks.create, 'function',
983
- 'bookmarks.create');
984
- assert.strictEqual(typeof bookmarks.create.callCount, 'number',
985
- 'stub bookmarks.create');
1124
+ assert.strictEqual(
1125
+ typeof bookmarks.create,
1126
+ 'function',
1127
+ 'bookmarks.create'
1128
+ );
1129
+ assert.strictEqual(
1130
+ typeof bookmarks.create.callCount,
1131
+ 'number',
1132
+ 'stub bookmarks.create'
1133
+ );
986
1134
  assert.strictEqual(typeof browserAction, 'object', 'browserAction');
987
- assert.strictEqual(typeof browserAction.setTitle, 'function',
988
- 'browserAction.setTitle');
989
- assert.strictEqual(typeof browserAction.setTitle.callCount, 'number',
990
- 'stub browserAction.setTitle');
991
- assert.strictEqual(typeof browserAction.onClicked, 'object',
992
- 'browserAction.onClicked');
993
- assert.strictEqual(typeof browserAction.onClicked.addListener, 'function',
994
- 'browserAction.onClicked.addListener');
995
- assert.strictEqual(typeof browserAction.onClicked.addListener.callCount,
996
- 'number', 'stub browserAction.onClicked.addListener.callCount');
1135
+ assert.strictEqual(
1136
+ typeof browserAction.setTitle,
1137
+ 'function',
1138
+ 'browserAction.setTitle'
1139
+ );
1140
+ assert.strictEqual(
1141
+ typeof browserAction.setTitle.callCount,
1142
+ 'number',
1143
+ 'stub browserAction.setTitle'
1144
+ );
1145
+ assert.strictEqual(
1146
+ typeof browserAction.onClicked,
1147
+ 'object',
1148
+ 'browserAction.onClicked'
1149
+ );
1150
+ assert.strictEqual(
1151
+ typeof browserAction.onClicked.addListener,
1152
+ 'function',
1153
+ 'browserAction.onClicked.addListener'
1154
+ );
1155
+ assert.strictEqual(
1156
+ typeof browserAction.onClicked.addListener.callCount,
1157
+ 'number',
1158
+ 'stub browserAction.onClicked.addListener.callCount'
1159
+ );
997
1160
  assert.strictEqual(typeof browserSettings, 'object', 'browserSettings');
998
- assert.strictEqual(typeof browserSettings.closeTabsByDoubleClick,
999
- 'object', 'browserSettings.closeTabsByDoubleClick');
1161
+ assert.strictEqual(
1162
+ typeof browserSettings.closeTabsByDoubleClick,
1163
+ 'object',
1164
+ 'browserSettings.closeTabsByDoubleClick'
1165
+ );
1000
1166
  assert.strictEqual(typeof commands, 'object', 'commands');
1001
- assert.strictEqual(typeof commands.update, 'function',
1002
- 'commands.update');
1003
- assert.strictEqual(typeof commands.update.callCount, 'number',
1004
- 'stub commands.update');
1167
+ assert.strictEqual(typeof commands.update, 'function', 'commands.update');
1168
+ assert.strictEqual(
1169
+ typeof commands.update.callCount,
1170
+ 'number',
1171
+ 'stub commands.update'
1172
+ );
1005
1173
  assert.strictEqual(typeof contextMenus, 'object', 'contextMenus');
1006
- assert.strictEqual(typeof contextMenus.create, 'function',
1007
- 'contextMenus.create');
1008
- assert.strictEqual(typeof contextMenus.create.callCount, 'number',
1009
- 'stub contextMenus.create');
1010
- assert.strictEqual(typeof contextualIdentities, 'object',
1011
- 'contextualIdentities');
1012
- assert.strictEqual(typeof contextualIdentities.get, 'function',
1013
- 'contextualIdentities.get');
1014
- assert.strictEqual(typeof contextualIdentities.get.callCount, 'number',
1015
- 'stub contextualIdentities.get');
1174
+ assert.strictEqual(
1175
+ typeof contextMenus.create,
1176
+ 'function',
1177
+ 'contextMenus.create'
1178
+ );
1179
+ assert.strictEqual(
1180
+ typeof contextMenus.create.callCount,
1181
+ 'number',
1182
+ 'stub contextMenus.create'
1183
+ );
1184
+ assert.strictEqual(
1185
+ typeof contextualIdentities,
1186
+ 'object',
1187
+ 'contextualIdentities'
1188
+ );
1189
+ assert.strictEqual(
1190
+ typeof contextualIdentities.get,
1191
+ 'function',
1192
+ 'contextualIdentities.get'
1193
+ );
1194
+ assert.strictEqual(
1195
+ typeof contextualIdentities.get.callCount,
1196
+ 'number',
1197
+ 'stub contextualIdentities.get'
1198
+ );
1016
1199
  assert.strictEqual(typeof devtools, 'object', 'devtools');
1017
1200
  assert.strictEqual(typeof inspectedWindow, 'object', 'inspectedWindow');
1018
- assert.strictEqual(typeof inspectedWindow.reload, 'function',
1019
- 'inspectedWindow.reload');
1020
- assert.strictEqual(typeof inspectedWindow.reload.callCount, 'number',
1021
- 'stub inspectedWindow.reload');
1201
+ assert.strictEqual(
1202
+ typeof inspectedWindow.reload,
1203
+ 'function',
1204
+ 'inspectedWindow.reload'
1205
+ );
1206
+ assert.strictEqual(
1207
+ typeof inspectedWindow.reload.callCount,
1208
+ 'number',
1209
+ 'stub inspectedWindow.reload'
1210
+ );
1022
1211
  assert.strictEqual(typeof i18n, 'object', 'i18n');
1023
- assert.strictEqual(typeof i18n.getMessage, 'function',
1024
- 'i18n.getMessage');
1025
- assert.strictEqual(typeof i18n.getMessage.callCount, 'number',
1026
- 'stub i18n.getMessage');
1212
+ assert.strictEqual(typeof i18n.getMessage, 'function', 'i18n.getMessage');
1213
+ assert.strictEqual(
1214
+ typeof i18n.getMessage.callCount,
1215
+ 'number',
1216
+ 'stub i18n.getMessage'
1217
+ );
1027
1218
  assert.strictEqual(typeof management, 'object', 'management');
1028
- assert.strictEqual(typeof management.get, 'function',
1029
- 'management.get');
1030
- assert.strictEqual(typeof management.get.callCount, 'number',
1031
- 'stub management.get');
1219
+ assert.strictEqual(typeof management.get, 'function', 'management.get');
1220
+ assert.strictEqual(
1221
+ typeof management.get.callCount,
1222
+ 'number',
1223
+ 'stub management.get'
1224
+ );
1032
1225
  assert.strictEqual(typeof menus, 'object', 'menus');
1033
- assert.strictEqual(typeof menus.create, 'function',
1034
- 'menus.create');
1035
- assert.strictEqual(typeof menus.create.callCount, 'number',
1036
- 'stub menus.create');
1037
- assert.strictEqual(typeof menus.getTargetElement, 'function',
1038
- 'menus.getTargetElement');
1039
- assert.strictEqual(typeof menus.getTargetElement.callCount, 'number',
1040
- 'stub menus.getTargetElement');
1041
- assert.strictEqual(typeof menus.removeAll, 'function',
1042
- 'menus.removeAll');
1043
- assert.strictEqual(typeof menus.removeAll.callCount, 'number',
1044
- 'stub menus.removeAll');
1226
+ assert.strictEqual(typeof menus.create, 'function', 'menus.create');
1227
+ assert.strictEqual(
1228
+ typeof menus.create.callCount,
1229
+ 'number',
1230
+ 'stub menus.create'
1231
+ );
1232
+ assert.strictEqual(
1233
+ typeof menus.getTargetElement,
1234
+ 'function',
1235
+ 'menus.getTargetElement'
1236
+ );
1237
+ assert.strictEqual(
1238
+ typeof menus.getTargetElement.callCount,
1239
+ 'number',
1240
+ 'stub menus.getTargetElement'
1241
+ );
1242
+ assert.strictEqual(typeof menus.removeAll, 'function', 'menus.removeAll');
1243
+ assert.strictEqual(
1244
+ typeof menus.removeAll.callCount,
1245
+ 'number',
1246
+ 'stub menus.removeAll'
1247
+ );
1045
1248
  assert.strictEqual(typeof notifications, 'object', 'notifications');
1046
- assert.strictEqual(typeof notifications.create, 'function',
1047
- 'notifications.create');
1048
- assert.strictEqual(typeof notifications.create.callCount, 'number',
1049
- 'stub notifications.create');
1050
- assert.strictEqual(typeof notifications.onClosed, 'object',
1051
- 'notifications.onClosed');
1052
- assert.strictEqual(typeof notifications.onClosed.addListener, 'function',
1053
- 'notifications.onClosed.addListener');
1054
- assert.strictEqual(typeof notifications.onClosed.addListener.callCount,
1055
- 'number', 'stub notifications.onClosed.addListener');
1249
+ assert.strictEqual(
1250
+ typeof notifications.create,
1251
+ 'function',
1252
+ 'notifications.create'
1253
+ );
1254
+ assert.strictEqual(
1255
+ typeof notifications.create.callCount,
1256
+ 'number',
1257
+ 'stub notifications.create'
1258
+ );
1259
+ assert.strictEqual(
1260
+ typeof notifications.onClosed,
1261
+ 'object',
1262
+ 'notifications.onClosed'
1263
+ );
1264
+ assert.strictEqual(
1265
+ typeof notifications.onClosed.addListener,
1266
+ 'function',
1267
+ 'notifications.onClosed.addListener'
1268
+ );
1269
+ assert.strictEqual(
1270
+ typeof notifications.onClosed.addListener.callCount,
1271
+ 'number',
1272
+ 'stub notifications.onClosed.addListener'
1273
+ );
1056
1274
  assert.strictEqual(typeof permissions, 'object', 'permissions');
1057
- assert.strictEqual(typeof permissions.request, 'function',
1058
- 'permissions.request');
1059
- assert.strictEqual(typeof permissions.request.callCount, 'number',
1060
- 'stub permissions.request');
1061
- assert.strictEqual(typeof privacy.network.tlsVersionRestrictionConfig,
1062
- 'object', 'privacy.network.tlsVersionRestrictionConfig');
1275
+ assert.strictEqual(
1276
+ typeof permissions.request,
1277
+ 'function',
1278
+ 'permissions.request'
1279
+ );
1280
+ assert.strictEqual(
1281
+ typeof permissions.request.callCount,
1282
+ 'number',
1283
+ 'stub permissions.request'
1284
+ );
1285
+ assert.strictEqual(
1286
+ typeof privacy.network.tlsVersionRestrictionConfig,
1287
+ 'object',
1288
+ 'privacy.network.tlsVersionRestrictionConfig'
1289
+ );
1063
1290
  assert.strictEqual(typeof runtime, 'object', 'runtime');
1064
- assert.strictEqual(typeof runtime.connect, 'function',
1065
- 'runtime.connect');
1066
- assert.strictEqual(typeof runtime.connect.callCount, 'number',
1067
- 'stub runtime.connect');
1291
+ assert.strictEqual(typeof runtime.connect, 'function', 'runtime.connect');
1292
+ assert.strictEqual(
1293
+ typeof runtime.connect.callCount,
1294
+ 'number',
1295
+ 'stub runtime.connect'
1296
+ );
1068
1297
  assert.strictEqual(typeof runtime.Port, 'object', 'runtime.Port');
1069
- assert.strictEqual(typeof runtime.Port.disconnect, 'function',
1070
- 'runtime.Port.disconnect');
1071
- assert.strictEqual(typeof runtime.Port.onDisconnect.addListener,
1072
- 'function', 'runtime.Port.disconnect');
1073
- assert.strictEqual(typeof runtime.Port.onDisconnect.addListener,
1074
- 'function', 'runtime.Port.onDisconnect.addListener');
1298
+ assert.strictEqual(
1299
+ typeof runtime.Port.disconnect,
1300
+ 'function',
1301
+ 'runtime.Port.disconnect'
1302
+ );
1303
+ assert.strictEqual(
1304
+ typeof runtime.Port.onDisconnect.addListener,
1305
+ 'function',
1306
+ 'runtime.Port.disconnect'
1307
+ );
1308
+ assert.strictEqual(
1309
+ typeof runtime.Port.onDisconnect.addListener,
1310
+ 'function',
1311
+ 'runtime.Port.onDisconnect.addListener'
1312
+ );
1075
1313
  assert.strictEqual(typeof sessions, 'object', 'sessions');
1076
- assert.strictEqual(typeof sessions.getRecentlyClosed, 'function',
1077
- 'sessions.getRecentlyClosed');
1078
- assert.strictEqual(typeof sessions.getRecentlyClosed.callCount, 'number',
1079
- 'stub sessions.getRecentlyClosed');
1314
+ assert.strictEqual(
1315
+ typeof sessions.getRecentlyClosed,
1316
+ 'function',
1317
+ 'sessions.getRecentlyClosed'
1318
+ );
1319
+ assert.strictEqual(
1320
+ typeof sessions.getRecentlyClosed.callCount,
1321
+ 'number',
1322
+ 'stub sessions.getRecentlyClosed'
1323
+ );
1080
1324
  assert.strictEqual(typeof storage, 'object', 'storage');
1081
1325
  assert.strictEqual(typeof storage.local, 'object', 'storage.local');
1082
- assert.strictEqual(typeof storage.local.get, 'function',
1083
- 'storage.local.get');
1084
- assert.strictEqual(typeof storage.local.get.callCount, 'number',
1085
- 'stub storage.local.get');
1086
- assert.strictEqual(typeof storage.onChanged, 'object',
1087
- 'storage.onChanged');
1088
- assert.strictEqual(typeof storage.onChanged.addListener, 'function',
1089
- 'storage.onChanged.addListener');
1090
- assert.strictEqual(typeof storage.onChanged.addListener.callCount,
1091
- 'number', 'stub storage.onChanged.addListener');
1326
+ assert.strictEqual(
1327
+ typeof storage.local.get,
1328
+ 'function',
1329
+ 'storage.local.get'
1330
+ );
1331
+ assert.strictEqual(
1332
+ typeof storage.local.get.callCount,
1333
+ 'number',
1334
+ 'stub storage.local.get'
1335
+ );
1336
+ assert.strictEqual(
1337
+ typeof storage.onChanged,
1338
+ 'object',
1339
+ 'storage.onChanged'
1340
+ );
1341
+ assert.strictEqual(
1342
+ typeof storage.onChanged.addListener,
1343
+ 'function',
1344
+ 'storage.onChanged.addListener'
1345
+ );
1346
+ assert.strictEqual(
1347
+ typeof storage.onChanged.addListener.callCount,
1348
+ 'number',
1349
+ 'stub storage.onChanged.addListener'
1350
+ );
1092
1351
  assert.strictEqual(typeof tabs, 'object', 'tabs');
1093
- assert.strictEqual(typeof tabs.get, 'function',
1094
- 'tabs.get');
1095
- assert.strictEqual(typeof tabs.get.callCount, 'number',
1096
- 'stub tabs.get');
1352
+ assert.strictEqual(typeof tabs.get, 'function', 'tabs.get');
1353
+ assert.strictEqual(typeof tabs.get.callCount, 'number', 'stub tabs.get');
1097
1354
  assert.strictEqual(typeof theme, 'object', 'theme');
1098
- assert.strictEqual(typeof theme.getCurrent, 'function',
1099
- 'theme.getCurrent');
1100
- assert.strictEqual(typeof theme.getCurrent.callCount, 'number',
1101
- 'stub theme.getCurrent');
1355
+ assert.strictEqual(
1356
+ typeof theme.getCurrent,
1357
+ 'function',
1358
+ 'theme.getCurrent'
1359
+ );
1360
+ assert.strictEqual(
1361
+ typeof theme.getCurrent.callCount,
1362
+ 'number',
1363
+ 'stub theme.getCurrent'
1364
+ );
1102
1365
  assert.strictEqual(typeof windows, 'object', 'windows');
1103
- assert.strictEqual(typeof windows.get, 'function',
1104
- 'windows.get');
1105
- assert.strictEqual(typeof windows.get.callCount, 'number',
1106
- 'stub windows.get');
1366
+ assert.strictEqual(typeof windows.get, 'function', 'windows.get');
1367
+ assert.strictEqual(
1368
+ typeof windows.get.callCount,
1369
+ 'number',
1370
+ 'stub windows.get'
1371
+ );
1107
1372
  });
1108
1373
 
1109
1374
  it('should get stubbed api', () => {
@@ -1111,144 +1376,282 @@ describe('Schema', () => {
1111
1376
  const browser = schema.mock();
1112
1377
  assert.strictEqual(typeof browser, 'object', 'browser');
1113
1378
  const {
1114
- bookmarks, browserAction, browserSettings, commands, contextMenus,
1115
- contextualIdentities, devtools, i18n, management, menus, notifications,
1116
- permissions, privacy, runtime, sessions, storage, tabs, theme, windows
1379
+ bookmarks,
1380
+ browserAction,
1381
+ browserSettings,
1382
+ commands,
1383
+ contextMenus,
1384
+ contextualIdentities,
1385
+ devtools,
1386
+ i18n,
1387
+ management,
1388
+ menus,
1389
+ notifications,
1390
+ permissions,
1391
+ privacy,
1392
+ runtime,
1393
+ sessions,
1394
+ storage,
1395
+ tabs,
1396
+ theme,
1397
+ windows
1117
1398
  } = browser;
1118
1399
  const { inspectedWindow } = devtools;
1119
1400
  assert.strictEqual(typeof bookmarks, 'object', 'bookmarks');
1120
- assert.strictEqual(typeof bookmarks.create, 'function',
1121
- 'bookmarks.create');
1122
- assert.strictEqual(typeof bookmarks.create.callCount, 'number',
1123
- 'stub bookmarks.create');
1401
+ assert.strictEqual(
1402
+ typeof bookmarks.create,
1403
+ 'function',
1404
+ 'bookmarks.create'
1405
+ );
1406
+ assert.strictEqual(
1407
+ typeof bookmarks.create.callCount,
1408
+ 'number',
1409
+ 'stub bookmarks.create'
1410
+ );
1124
1411
  assert.strictEqual(typeof browserAction, 'object', 'browserAction');
1125
- assert.strictEqual(typeof browserAction.setTitle, 'function',
1126
- 'browserAction.setTitle');
1127
- assert.strictEqual(typeof browserAction.setTitle.callCount, 'number',
1128
- 'stub browserAction.setTitle');
1129
- assert.strictEqual(typeof browserAction.onClicked, 'object',
1130
- 'browserAction.onClicked');
1131
- assert.strictEqual(typeof browserAction.onClicked.addListener, 'function',
1132
- 'browserAction.onClicked.addListener');
1133
- assert.strictEqual(typeof browserAction.onClicked.addListener.callCount,
1134
- 'number', 'stub browserAction.onClicked.addListener.callCount');
1412
+ assert.strictEqual(
1413
+ typeof browserAction.setTitle,
1414
+ 'function',
1415
+ 'browserAction.setTitle'
1416
+ );
1417
+ assert.strictEqual(
1418
+ typeof browserAction.setTitle.callCount,
1419
+ 'number',
1420
+ 'stub browserAction.setTitle'
1421
+ );
1422
+ assert.strictEqual(
1423
+ typeof browserAction.onClicked,
1424
+ 'object',
1425
+ 'browserAction.onClicked'
1426
+ );
1427
+ assert.strictEqual(
1428
+ typeof browserAction.onClicked.addListener,
1429
+ 'function',
1430
+ 'browserAction.onClicked.addListener'
1431
+ );
1432
+ assert.strictEqual(
1433
+ typeof browserAction.onClicked.addListener.callCount,
1434
+ 'number',
1435
+ 'stub browserAction.onClicked.addListener.callCount'
1436
+ );
1135
1437
  assert.strictEqual(typeof browserSettings, 'object', 'browserSettings');
1136
- assert.strictEqual(typeof browserSettings.closeTabsByDoubleClick,
1137
- 'object', 'browserSettings.closeTabsByDoubleClick');
1438
+ assert.strictEqual(
1439
+ typeof browserSettings.closeTabsByDoubleClick,
1440
+ 'object',
1441
+ 'browserSettings.closeTabsByDoubleClick'
1442
+ );
1138
1443
  assert.strictEqual(typeof commands, 'object', 'commands');
1139
- assert.strictEqual(typeof commands.update, 'function',
1140
- 'commands.update');
1141
- assert.strictEqual(typeof commands.update.callCount, 'number',
1142
- 'stub commands.update');
1444
+ assert.strictEqual(typeof commands.update, 'function', 'commands.update');
1445
+ assert.strictEqual(
1446
+ typeof commands.update.callCount,
1447
+ 'number',
1448
+ 'stub commands.update'
1449
+ );
1143
1450
  assert.strictEqual(typeof contextMenus, 'object', 'contextMenus');
1144
- assert.strictEqual(typeof contextMenus.create, 'function',
1145
- 'contextMenus.create');
1146
- assert.strictEqual(typeof contextMenus.create.callCount, 'number',
1147
- 'stub contextMenus.create');
1148
- assert.strictEqual(typeof contextualIdentities, 'object',
1149
- 'contextualIdentities');
1150
- assert.strictEqual(typeof contextualIdentities.get, 'function',
1151
- 'contextualIdentities.get');
1152
- assert.strictEqual(typeof contextualIdentities.get.callCount, 'number',
1153
- 'stub contextualIdentities.get');
1451
+ assert.strictEqual(
1452
+ typeof contextMenus.create,
1453
+ 'function',
1454
+ 'contextMenus.create'
1455
+ );
1456
+ assert.strictEqual(
1457
+ typeof contextMenus.create.callCount,
1458
+ 'number',
1459
+ 'stub contextMenus.create'
1460
+ );
1461
+ assert.strictEqual(
1462
+ typeof contextualIdentities,
1463
+ 'object',
1464
+ 'contextualIdentities'
1465
+ );
1466
+ assert.strictEqual(
1467
+ typeof contextualIdentities.get,
1468
+ 'function',
1469
+ 'contextualIdentities.get'
1470
+ );
1471
+ assert.strictEqual(
1472
+ typeof contextualIdentities.get.callCount,
1473
+ 'number',
1474
+ 'stub contextualIdentities.get'
1475
+ );
1154
1476
  assert.strictEqual(typeof devtools, 'object', 'devtools');
1155
1477
  assert.strictEqual(typeof inspectedWindow, 'object', 'inspectedWindow');
1156
- assert.strictEqual(typeof inspectedWindow.reload, 'function',
1157
- 'inspectedWindow.reload');
1158
- assert.strictEqual(typeof inspectedWindow.reload.callCount, 'number',
1159
- 'stub inspectedWindow.reload');
1478
+ assert.strictEqual(
1479
+ typeof inspectedWindow.reload,
1480
+ 'function',
1481
+ 'inspectedWindow.reload'
1482
+ );
1483
+ assert.strictEqual(
1484
+ typeof inspectedWindow.reload.callCount,
1485
+ 'number',
1486
+ 'stub inspectedWindow.reload'
1487
+ );
1160
1488
  assert.strictEqual(typeof i18n, 'object', 'i18n');
1161
- assert.strictEqual(typeof i18n.getMessage, 'function',
1162
- 'i18n.getMessage');
1163
- assert.strictEqual(typeof i18n.getMessage.callCount, 'number',
1164
- 'stub i18n.getMessage');
1489
+ assert.strictEqual(typeof i18n.getMessage, 'function', 'i18n.getMessage');
1490
+ assert.strictEqual(
1491
+ typeof i18n.getMessage.callCount,
1492
+ 'number',
1493
+ 'stub i18n.getMessage'
1494
+ );
1165
1495
  assert.strictEqual(typeof management, 'object', 'management');
1166
- assert.strictEqual(typeof management.get, 'function',
1167
- 'management.get');
1168
- assert.strictEqual(typeof management.get.callCount, 'number',
1169
- 'stub management.get');
1496
+ assert.strictEqual(typeof management.get, 'function', 'management.get');
1497
+ assert.strictEqual(
1498
+ typeof management.get.callCount,
1499
+ 'number',
1500
+ 'stub management.get'
1501
+ );
1170
1502
  assert.strictEqual(typeof menus, 'object', 'menus');
1171
- assert.strictEqual(typeof menus.create, 'function',
1172
- 'menus.create');
1173
- assert.strictEqual(typeof menus.create.callCount, 'number',
1174
- 'stub menus.create');
1175
- assert.strictEqual(typeof menus.getTargetElement, 'function',
1176
- 'menus.getTargetElement');
1177
- assert.strictEqual(typeof menus.getTargetElement.callCount, 'number',
1178
- 'stub menus.getTargetElement');
1179
- assert.strictEqual(typeof menus.removeAll, 'function',
1180
- 'menus.removeAll');
1181
- assert.strictEqual(typeof menus.removeAll.callCount, 'number',
1182
- 'stub menus.removeAll');
1503
+ assert.strictEqual(typeof menus.create, 'function', 'menus.create');
1504
+ assert.strictEqual(
1505
+ typeof menus.create.callCount,
1506
+ 'number',
1507
+ 'stub menus.create'
1508
+ );
1509
+ assert.strictEqual(
1510
+ typeof menus.getTargetElement,
1511
+ 'function',
1512
+ 'menus.getTargetElement'
1513
+ );
1514
+ assert.strictEqual(
1515
+ typeof menus.getTargetElement.callCount,
1516
+ 'number',
1517
+ 'stub menus.getTargetElement'
1518
+ );
1519
+ assert.strictEqual(typeof menus.removeAll, 'function', 'menus.removeAll');
1520
+ assert.strictEqual(
1521
+ typeof menus.removeAll.callCount,
1522
+ 'number',
1523
+ 'stub menus.removeAll'
1524
+ );
1183
1525
  assert.strictEqual(typeof notifications, 'object', 'notifications');
1184
- assert.strictEqual(typeof notifications.create, 'function',
1185
- 'notifications.create');
1186
- assert.strictEqual(typeof notifications.create.callCount, 'number',
1187
- 'stub notifications.create');
1188
- assert.strictEqual(typeof notifications.onClosed, 'object',
1189
- 'notifications.onClosed');
1190
- assert.strictEqual(typeof notifications.onClosed.addListener, 'function',
1191
- 'notifications.onClosed.addListener');
1192
- assert.strictEqual(typeof notifications.onClosed.addListener.callCount,
1193
- 'number', 'stub notifications.onClosed.addListener');
1526
+ assert.strictEqual(
1527
+ typeof notifications.create,
1528
+ 'function',
1529
+ 'notifications.create'
1530
+ );
1531
+ assert.strictEqual(
1532
+ typeof notifications.create.callCount,
1533
+ 'number',
1534
+ 'stub notifications.create'
1535
+ );
1536
+ assert.strictEqual(
1537
+ typeof notifications.onClosed,
1538
+ 'object',
1539
+ 'notifications.onClosed'
1540
+ );
1541
+ assert.strictEqual(
1542
+ typeof notifications.onClosed.addListener,
1543
+ 'function',
1544
+ 'notifications.onClosed.addListener'
1545
+ );
1546
+ assert.strictEqual(
1547
+ typeof notifications.onClosed.addListener.callCount,
1548
+ 'number',
1549
+ 'stub notifications.onClosed.addListener'
1550
+ );
1194
1551
  assert.strictEqual(typeof permissions, 'object', 'permissions');
1195
- assert.strictEqual(typeof permissions.request, 'function',
1196
- 'permissions.request');
1197
- assert.strictEqual(typeof permissions.request.callCount, 'number',
1198
- 'stub permissions.request');
1199
- assert.strictEqual(typeof privacy.network.tlsVersionRestrictionConfig,
1200
- 'object', 'privacy.network.tlsVersionRestrictionConfig');
1552
+ assert.strictEqual(
1553
+ typeof permissions.request,
1554
+ 'function',
1555
+ 'permissions.request'
1556
+ );
1557
+ assert.strictEqual(
1558
+ typeof permissions.request.callCount,
1559
+ 'number',
1560
+ 'stub permissions.request'
1561
+ );
1562
+ assert.strictEqual(
1563
+ typeof privacy.network.tlsVersionRestrictionConfig,
1564
+ 'object',
1565
+ 'privacy.network.tlsVersionRestrictionConfig'
1566
+ );
1201
1567
  assert.strictEqual(typeof runtime, 'object', 'runtime');
1202
- assert.strictEqual(typeof runtime.connect, 'function',
1203
- 'runtime.connect');
1204
- assert.strictEqual(typeof runtime.connect.callCount, 'number',
1205
- 'stub runtime.connect');
1568
+ assert.strictEqual(typeof runtime.connect, 'function', 'runtime.connect');
1569
+ assert.strictEqual(
1570
+ typeof runtime.connect.callCount,
1571
+ 'number',
1572
+ 'stub runtime.connect'
1573
+ );
1206
1574
  assert.strictEqual(typeof runtime.Port, 'object', 'runtime.Port');
1207
- assert.strictEqual(typeof runtime.Port.disconnect, 'function',
1208
- 'runtime.Port.disconnect');
1209
- assert.strictEqual(typeof runtime.Port.onDisconnect.addListener,
1210
- 'function', 'runtime.Port.disconnect');
1211
- assert.strictEqual(typeof runtime.Port.onDisconnect.addListener,
1212
- 'function', 'runtime.Port.onDisconnect.addListener');
1575
+ assert.strictEqual(
1576
+ typeof runtime.Port.disconnect,
1577
+ 'function',
1578
+ 'runtime.Port.disconnect'
1579
+ );
1580
+ assert.strictEqual(
1581
+ typeof runtime.Port.onDisconnect.addListener,
1582
+ 'function',
1583
+ 'runtime.Port.disconnect'
1584
+ );
1585
+ assert.strictEqual(
1586
+ typeof runtime.Port.onDisconnect.addListener,
1587
+ 'function',
1588
+ 'runtime.Port.onDisconnect.addListener'
1589
+ );
1213
1590
  assert.strictEqual(typeof sessions, 'object', 'sessions');
1214
- assert.strictEqual(typeof sessions.getRecentlyClosed, 'function',
1215
- 'sessions.getRecentlyClosed');
1216
- assert.strictEqual(typeof sessions.getRecentlyClosed.callCount, 'number',
1217
- 'stub sessions.getRecentlyClosed');
1591
+ assert.strictEqual(
1592
+ typeof sessions.getRecentlyClosed,
1593
+ 'function',
1594
+ 'sessions.getRecentlyClosed'
1595
+ );
1596
+ assert.strictEqual(
1597
+ typeof sessions.getRecentlyClosed.callCount,
1598
+ 'number',
1599
+ 'stub sessions.getRecentlyClosed'
1600
+ );
1218
1601
  assert.strictEqual(typeof storage, 'object', 'storage');
1219
1602
  assert.strictEqual(typeof storage.local, 'object', 'storage.local');
1220
- assert.strictEqual(typeof storage.local.get, 'function',
1221
- 'storage.local.get');
1222
- assert.strictEqual(typeof storage.local.get.callCount, 'number',
1223
- 'stub storage.local.get');
1224
- assert.strictEqual(typeof storage.onChanged, 'object',
1225
- 'storage.onChanged');
1226
- assert.strictEqual(typeof storage.onChanged.addListener, 'function',
1227
- 'storage.onChanged.addListener');
1228
- assert.strictEqual(typeof storage.onChanged.addListener.callCount,
1229
- 'number', 'stub storage.onChanged.addListener');
1603
+ assert.strictEqual(
1604
+ typeof storage.local.get,
1605
+ 'function',
1606
+ 'storage.local.get'
1607
+ );
1608
+ assert.strictEqual(
1609
+ typeof storage.local.get.callCount,
1610
+ 'number',
1611
+ 'stub storage.local.get'
1612
+ );
1613
+ assert.strictEqual(
1614
+ typeof storage.onChanged,
1615
+ 'object',
1616
+ 'storage.onChanged'
1617
+ );
1618
+ assert.strictEqual(
1619
+ typeof storage.onChanged.addListener,
1620
+ 'function',
1621
+ 'storage.onChanged.addListener'
1622
+ );
1623
+ assert.strictEqual(
1624
+ typeof storage.onChanged.addListener.callCount,
1625
+ 'number',
1626
+ 'stub storage.onChanged.addListener'
1627
+ );
1230
1628
  assert.strictEqual(typeof tabs, 'object', 'tabs');
1231
- assert.strictEqual(typeof tabs.get, 'function',
1232
- 'tabs.get');
1233
- assert.strictEqual(typeof tabs.get.callCount, 'number',
1234
- 'stub tabs.get');
1629
+ assert.strictEqual(typeof tabs.get, 'function', 'tabs.get');
1630
+ assert.strictEqual(typeof tabs.get.callCount, 'number', 'stub tabs.get');
1235
1631
  assert.strictEqual(typeof theme, 'object', 'theme');
1236
- assert.strictEqual(typeof theme.getCurrent, 'function',
1237
- 'theme.getCurrent');
1238
- assert.strictEqual(typeof theme.getCurrent.callCount, 'number',
1239
- 'stub theme.getCurrent');
1632
+ assert.strictEqual(
1633
+ typeof theme.getCurrent,
1634
+ 'function',
1635
+ 'theme.getCurrent'
1636
+ );
1637
+ assert.strictEqual(
1638
+ typeof theme.getCurrent.callCount,
1639
+ 'number',
1640
+ 'stub theme.getCurrent'
1641
+ );
1240
1642
  assert.strictEqual(typeof windows, 'object', 'windows');
1241
- assert.strictEqual(typeof windows.get, 'function',
1242
- 'windows.get');
1243
- assert.strictEqual(typeof windows.get.callCount, 'number',
1244
- 'stub windows.get');
1643
+ assert.strictEqual(typeof windows.get, 'function', 'windows.get');
1644
+ assert.strictEqual(
1645
+ typeof windows.get.callCount,
1646
+ 'number',
1647
+ 'stub windows.get'
1648
+ );
1245
1649
  });
1246
1650
 
1247
1651
  it('should access sandbox', () => {
1248
1652
  const browser = new Schema().mock();
1249
1653
  assert.strictEqual(typeof browser._sandbox, 'object', 'sandbox');
1250
- assert.strictEqual(typeof browser._sandbox.stub, 'function',
1251
- 'stub');
1654
+ assert.strictEqual(typeof browser._sandbox.stub, 'function', 'stub');
1252
1655
  const i = browser.runtime.connect.callCount;
1253
1656
  browser.runtime.connect();
1254
1657
  assert.strictEqual(browser.runtime.connect.callCount, i + 1, 'called');
@@ -1268,10 +1671,16 @@ describe('Schema', () => {
1268
1671
  const port2 = mockConnect({ name: 'bar' });
1269
1672
  assert.strictEqual(port1.name, 'foo', 'name');
1270
1673
  assert.strictEqual(port2.name, 'bar', 'name');
1271
- assert.strictEqual(typeof port1.onDisconnect.addListener, 'function',
1272
- 'function');
1273
- assert.strictEqual(typeof port2.onDisconnect.addListener, 'function',
1274
- 'function');
1674
+ assert.strictEqual(
1675
+ typeof port1.onDisconnect.addListener,
1676
+ 'function',
1677
+ 'function'
1678
+ );
1679
+ assert.strictEqual(
1680
+ typeof port2.onDisconnect.addListener,
1681
+ 'function',
1682
+ 'function'
1683
+ );
1275
1684
 
1276
1685
  // reset
1277
1686
  mockConnect.reset();